public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Simon Sobisch <simonsobisch@gnu.org>
To: gdb@sourceware.org
Subject: Re: How to create maintenance breakpoints for running programs?
Date: Tue, 2 Nov 2021 17:43:14 +0100	[thread overview]
Message-ID: <111ac135-4dfa-7104-ea47-7f59aad400f8@gnu.org> (raw)
In-Reply-To: <6b1622f3-ef58-642a-b320-1ebfeae59b98@gnu.org>

I _guess_ GDB has an "internal" event handler which checks for libc 
being loaded in the inferior and sets those maintainance breakpoints 
then and likely also deletes them on unload of libc.

Can anyone point out a sample how to do the same for an own library from 
a python module, please?

Thank you,
Simon


Am 28.10.2021 um 11:35 schrieb Simon Sobisch:
> We can create  maintenance breakpoints with 
> gdb.Breakpoint(internal=True), which is good.
> 
> I've now stumbled over the problem that this _does_ work with not 
> running / attached targets but raises an error message "No symbol table 
> is loaded.  Use the "file" command."
> 
> the breakpoint is then shown under "maint info break" as PENDING (as 
> expected) and is resolved on "start".
> 
> 
> What I _want_ to achieve is the same as one can see with "plain GDB":
> 
> $ gdb -q
> (gdb) maint info break
> No breakpoints or watchpoints.
> (gdb) file prog
> (gdb) star
> ...
> (gdb) maint info break
> (gdb) maint info break
> Num     Type                  Disp Enb Address            What
> -1      shlib events          keep y   0x00007ffff7fe2590 
> <__GI__dl_debug_state> inf 1
> -1.1                               y   0x00007ffff7fe2590 
> <__GI__dl_debug_state> inf 1
> -2      longjmp master        keep n   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -2.1                               y   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -3      longjmp master        keep n   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -3.1                               y   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -4      longjmp master        keep n   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -4.1                               y   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -5      longjmp master        keep n   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -5.1                               y   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -6      longjmp master        keep n   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -6.1                               y   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -7      longjmp master        keep n   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -7.1                               y   0x00007ffff7db3950 
> <__libc_siglongjmp> inf 1
> -8      std::terminate master keep n   0x00007ffff59369c0 
> <std::terminate()> inf 1
> -8.1                               y   0x00007ffff59369c0 
> <std::terminate()> inf 1
> 
> 
> I'd like to do the same - is there any event I can register to so that I 
> don't create a <PENDING> breakpoint and an error but instead create the 
> breakpoint when GDB actually has a running program?
> 
> Thanks for any insights,
> Simon

      reply	other threads:[~2021-11-02 16:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28  9:35 Simon Sobisch
2021-11-02 16:43 ` Simon Sobisch [this message]

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=111ac135-4dfa-7104-ea47-7f59aad400f8@gnu.org \
    --to=simonsobisch@gnu.org \
    --cc=gdb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).