This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: minimalistic MI catch support
> From: Nick Roberts <nickrob@snap.net.nz>
> Date: Fri, 10 Feb 2006 19:33:28 +1300
>
> (gdb) catch catch
> Catchpoint 2 (catch)
> (gdb) catch throw
> Catchpoint 3 (throw)
> (gdb) catch fork
> Catchpoint 4 (fork)
> (gdb) catch exec
> Catchpoint 5 (exec)
> (gdb) info break
> Num Type Disp Enb Address What
> 2 breakpoint keep y 0x07dae1aa exception catch
> 3 breakpoint keep y 0x07daf001 exception throw
> 4 catch fork keep y
> 5 catch exec keep y
>
> The first two are of type breakpoint and their nature is given under the
> heading "What".
>
> The second two have their own type: "catch fork" and "catch exec" (I must
> admit that I don't understand how this gives differerent behaviour from using
> "break fork" and "break exec"). Also for some reason, they have no address.
I think this is a bug (or undocumented misfeature) in
breakpoint.c:handle_gnu_v3_exceptions. You will see that it sets the
type of the raw breakpoint it creates to bp_breakpoint, instead of
using the argument ex_event that is passed by the caller. In
addition, for some reason, it forces a special function to be used for
printing these catchpoints, and that function
(print_one_exception_catchpoint) doesn't use the list of descriptions
in the bptypes[] array used by the more general code in
print_one_breakpoint. I think it's bad to have more than one place to
have these description strings.
Can someone explain why we should use special code for gnu_v3
exceptions?
As for the address not being printed, can you step with a debugger
through the function that prints these breakpoints and see why they
are skipped? I cannot for the moment see any reason, just looking at
the code.