Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* deferred breakpoints
@ 2003-02-25 20:51 Kris Warkentin
  2003-02-25 20:57 ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Kris Warkentin @ 2003-02-25 20:51 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: deferred breakpoints
@ 2003-02-25 21:36 Kris Warkentin
  2003-02-25 21:59 ` Jason Molenda
  0 siblings, 1 reply; 8+ messages in thread
From: Kris Warkentin @ 2003-02-25 21:36 UTC (permalink / raw)
  To: gdb

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
>


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <1046355813.623.ezmlm@sources.redhat.com>]

end of thread, other threads:[~2003-03-01  2:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-25 20:51 deferred breakpoints Kris Warkentin
2003-02-25 20:57 ` Daniel Jacobowitz
2003-02-25 21:36 Kris Warkentin
2003-02-25 21:59 ` Jason Molenda
2003-02-26  2:22   ` Kris Warkentin
2003-02-26  4:47     ` Jason Molenda
2003-02-26 16:51       ` Kris Warkentin
     [not found] <1046355813.623.ezmlm@sources.redhat.com>
2003-03-01  2:16 ` Jim Ingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox