public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27159] New: maintenance command to ignore probes
@ 2021-01-08 10:04 vries at gcc dot gnu.org
  2022-12-05 13:50 ` [Bug cli/27159] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-01-08 10:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27159

            Bug ID: 27159
           Summary: maintenance command to ignore probes
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On f.i. current openSUSE, libs like libgcc and glibc contain probes, which gdb
uses for various things.

There may be a fallback scenario for the case when probes are not present. 
F.i., for installing a master exception breakpoint, if the libgcc/unwind probe
is not present, the libgcc hook _Unwind_DebugHook is used instead.

It may be interesting or necessary (to test a fix) to test the fallback
scenario, but AFAICT it's not possible to do this without modifying sources. 
There is a command to disable individual probes, but for the libgcc/unwind one,
I get:
...
(gdb) disable probes libgcc unwind
Probe libgcc:unwind cannot be disabled.
...

F.i., I did this to disable all probes:
...
diff --git a/gdb/elfread.c b/gdb/elfread.c
index ce63d6b4b56..6667b6799e7 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1404,10 +1404,12 @@ elf_get_probes (struct objfile *objfile)
     {
       probes_per_bfd = probe_key.emplace (objfile->obfd);

+#if 0
       /* Here we try to gather information about all types of probes from the
         objfile.  */
       for (const static_probe_ops *ops : all_static_probe_ops)
        ops->get_probes (probes_per_bfd, objfile);
+#endif
     }

   return *probes_per_bfd;
...
to be able to test whether the code using _Unwind_DebugHook still worked.

So perhaps a command "maintenance probes-disable" could be convenient.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug cli/27159] maintenance command to ignore probes
  2021-01-08 10:04 [Bug gdb/27159] New: maintenance command to ignore probes vries at gcc dot gnu.org
@ 2022-12-05 13:50 ` vries at gcc dot gnu.org
  2022-12-05 14:48 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2022-12-05 13:50 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27159

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|gdb                         |cli

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug cli/27159] maintenance command to ignore probes
  2021-01-08 10:04 [Bug gdb/27159] New: maintenance command to ignore probes vries at gcc dot gnu.org
  2022-12-05 13:50 ` [Bug cli/27159] " vries at gcc dot gnu.org
@ 2022-12-05 14:48 ` vries at gcc dot gnu.org
  2022-12-07  9:03 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2022-12-05 14:48 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27159

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 14481
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14481&action=edit
Tentative patch

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug cli/27159] maintenance command to ignore probes
  2021-01-08 10:04 [Bug gdb/27159] New: maintenance command to ignore probes vries at gcc dot gnu.org
  2022-12-05 13:50 ` [Bug cli/27159] " vries at gcc dot gnu.org
  2022-12-05 14:48 ` vries at gcc dot gnu.org
@ 2022-12-07  9:03 ` vries at gcc dot gnu.org
  2022-12-14 15:25 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2022-12-07  9:03 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27159

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #1)
> Created attachment 14481 [details]
> Tentative patch

https://sourceware.org/pipermail/gdb-patches/2022-December/194535.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug cli/27159] maintenance command to ignore probes
  2021-01-08 10:04 [Bug gdb/27159] New: maintenance command to ignore probes vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-12-07  9:03 ` vries at gcc dot gnu.org
@ 2022-12-14 15:25 ` vries at gcc dot gnu.org
  2022-12-31  9:23 ` cvs-commit at gcc dot gnu.org
  2022-12-31  9:38 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2022-12-14 15:25 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27159

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #2)
> (In reply to Tom de Vries from comment #1)
> > Created attachment 14481 [details]
> > Tentative patch
> 
> https://sourceware.org/pipermail/gdb-patches/2022-December/194535.html

That was an RFC, now here's a proper submission.

https://sourceware.org/pipermail/gdb-patches/2022-December/194750.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug cli/27159] maintenance command to ignore probes
  2021-01-08 10:04 [Bug gdb/27159] New: maintenance command to ignore probes vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-12-14 15:25 ` vries at gcc dot gnu.org
@ 2022-12-31  9:23 ` cvs-commit at gcc dot gnu.org
  2022-12-31  9:38 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-31  9:23 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27159

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=08c59458a106038c6d678621e7290948127671e2

commit 08c59458a106038c6d678621e7290948127671e2
Author: Tom de Vries <tdevries@suse.de>
Date:   Sat Dec 31 10:23:06 2022 +0100

    [gdb/cli] Add maintenance ignore-probes

    There's a command "disable probes", but SystemTap probes, for instance
    libc:longjmp cannot be disabled:
    ...
    $ gdb -q -batch a.out -ex start -ex "disable probes libc ^longjmp$"
      ...
    Probe libc:longjmp cannot be disabled.
    Probe libc:longjmp cannot be disabled.
    Probe libc:longjmp cannot be disabled.
    ...

    Add a command "maintenance ignore-probes" that ignores probes during
    get_probes, such that we can easily pretend to use a libc without the
    libc:longjmp probe:
    ...
    (gdb) maint ignore-probes -verbose libc ^longjmp$
    ignore-probes filter has been set to:
    PROVIDER: 'libc'
    PROBE_NAME: '^longjmp$'
    OBJNAME: ''
    (gdb) start ^M
      ...
    Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M
    Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M
    Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M
    ...

    The "Ignoring ..." messages can be suppressed by not using -verbose.

    Note that as with "disable probes", running simply "maint ignore-probes"
    ignores all probes.

    The ignore-probes filter can be reset by using:
    ...
    (gdb) maint ignore-probes -reset
    ignore-probes filter has been reset
    ...

    For now, the command is only supported for SystemTap probes.

    PR cli/27159
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27159

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug cli/27159] maintenance command to ignore probes
  2021-01-08 10:04 [Bug gdb/27159] New: maintenance command to ignore probes vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-12-31  9:23 ` cvs-commit at gcc dot gnu.org
@ 2022-12-31  9:38 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2022-12-31  9:38 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27159

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |14.1
         Resolution|---                         |FIXED

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Enhancement committed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-31  9:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 10:04 [Bug gdb/27159] New: maintenance command to ignore probes vries at gcc dot gnu.org
2022-12-05 13:50 ` [Bug cli/27159] " vries at gcc dot gnu.org
2022-12-05 14:48 ` vries at gcc dot gnu.org
2022-12-07  9:03 ` vries at gcc dot gnu.org
2022-12-14 15:25 ` vries at gcc dot gnu.org
2022-12-31  9:23 ` cvs-commit at gcc dot gnu.org
2022-12-31  9:38 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).