Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: "Alexandra Hájková" <ahajkova@redhat.com>
Cc: gdb-patches@sourceware.org,  ezulian@redhat.com
Subject: Re: [PATCH] Add drg_why_sleeping.py
Date: Tue, 01 Sep 2026 10:52:31 -0600	[thread overview]
Message-ID: <87ik4o7w34.fsf@tromey.com> (raw)
In-Reply-To: <20260831205514.1987454-2-ahajkova@redhat.com> ("Alexandra =?utf-8?B?SMOhamtvdsOhIidz?= message of "Mon, 31 Aug 2026 22:54:54 +0200")

>>>>> "Alexandra" == Alexandra Hájková <ahajkova@redhat.com> writes:

Hi.  Thanks for the patch.

I'm not sure this is really something gdb ought to ship.

Alexandra>  sleep_test.c                                  | 76 +++++++++++++++++++

This file shouldn't be here.

Alexandra> +           (gdb) source ~/binutils-gdb/gdb/python/lib/gdb/command/drgn_why_sleeping.py

Normally commands are auto-installed.

Alexandra> +           (gdb) drgn_why_sleeping

This isn't a very gdb-ish name.  At the very least gdb usually uses "-"
as a separator; I always thought maybe it inherited a Lispy style from
the RMS days.  But maybe a prefix command would be better anyhow.

Alexandra> +            raise gdb.GdbError(
Alexandra> +                (
Alexandra> +                    "Can't find selected thread. "
Alexandra> +                )
Alexandra> +            )

Extra parens?

Alexandra> +                    "Can't read /proc/kcore, %s. Try running GDB as root. " % str(e)

We can't ever recommend running gdb as root.

I don't normally like to make drastic pronouncements like that, but gdb
is nowhere near hardened enough for this kind of thing.  In fact it's
more accurate to say that gdb doesn't even try, it's ridiculously
exposed.

Tom

  reply	other threads:[~2026-09-01 16:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 20:54 [RFC PATCH 0/1] gdb/python: add drg_why_sleeping command Alexandra Hájková
2026-08-31 20:54 ` [PATCH] Add drg_why_sleeping.py Alexandra Hájková
2026-09-01 16:52   ` Tom Tromey [this message]
2026-09-02 15:29     ` Alexandra Petlanova Hajkova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ik4o7w34.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=ahajkova@redhat.com \
    --cc=ezulian@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox