Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Kris Warkentin" <kewarken@qnx.com>
To: <gdb@sources.redhat.com>
Subject: Re: deferred breakpoints
Date: Tue, 25 Feb 2003 21:36:00 -0000	[thread overview]
Message-ID: <016801c2dd16$862cb0d0$2a00a8c0@dash> (raw)

I took a look at the sources from apple and it looks like what they're doing
is relatively simple.  I think most of the wiring is already in gdb.

1) Attempt to set break. If that fails:
2) Create a raw breakpoint and set it to be shlib_disabled.  That way gdb
attempts to reset it every time a shlib is loaded.

I believe that you might get a lot of error messages with this method when
gdb complains about not being able to set the breakpoints but I may be
wrong.  The relevant code is below.  Interesting.  I'll see if I can do it
with a newer version (the apple source is for gdb-4.18)

cheers,

Kris

      struct symtab_and_line sal =
      {0, 0};
      struct breakpoint *b = set_raw_breakpoint (sal);

      printf_unfiltered
 ("Will attempt to resolve \"%s\" on future dynamic loads.\n", args);

      b->number = ++breakpoint_count;
      b->addr_string = savestring (args, strlen (args));
      b->enable = shlib_disabled;
      b->inserted = 0;
      b->disposition = donttouch;
      b->type = bp_breakpoint;
      if (modify_breakpoint_hook)
 modify_breakpoint_hook (b);

> How difficult do you think deferred breakpoints would be to implement?  We
> have a customer who does a lot of work with shared objects and they'd like
> to be able to set breakpoints in them and have them persist across runs.
> I'm thinking that creating a list of breakpoints that could be run through
> every time a shared object was loaded would do the trick.  Can anyone
point
> out any obvious gotcha's?
>
> Kris
>


             reply	other threads:[~2003-02-25 21:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-25 21:36 Kris Warkentin [this message]
2003-02-25 21:59 ` Jason Molenda
2003-02-26  2:22   ` Kris Warkentin
2003-02-26  2:26     ` gdb detach Smita
2003-02-26  4:47     ` deferred breakpoints Jason Molenda
2003-02-26 16:51       ` Kris Warkentin
     [not found] <1046355813.623.ezmlm@sources.redhat.com>
2003-03-01  2:16 ` Jim Ingham
  -- strict thread matches above, loose matches on Subject: below --
2003-02-25 20:51 Kris Warkentin
2003-02-25 20:57 ` Daniel Jacobowitz

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='016801c2dd16$862cb0d0$2a00a8c0@dash' \
    --to=kewarken@qnx.com \
    --cc=gdb@sources.redhat.com \
    /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