This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] fbreak (Finish Breakpoints by Name)
- From: Tom Tromey <tromey at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 21 Oct 2013 15:52:38 -0600
- Subject: Re: [rfc] fbreak (Finish Breakpoints by Name)
- Authentication-results: sourceware.org; auth=none
- References: <52397B9C dot 1050002 at redhat dot com>
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> This command is a usability skin for finish breakpoints. The command,
Phil> "fbreak" takes a location, and sets a breakpoint on that location.
Phil> When the breakpoint is hit, the "stop" callback on the initial
Phil> breakpoint is called. This initial breakpoint then turns on process
Phil> record, and places a finish breakpoint in that function to catch
Phil> function exit. When the function completes, the finish breakpoint
Phil> will print a message.
I think it is cool but I'm not sure about tying it to process record.
Process record has a lot of limitations.
It seems to me that it would really great as a user if I could attach
commands to a breakpoint like this. However, right now such commands
would attach to the initial breakpoint -- not the one that is hit when
the internal finish breakpoint is hit.
I suppose if we could set commands on both the initial and the finish
breakpoints, then it would be easy to ask for "record" behavior by hand.
Anyway I think maybe more experimentation is needed.
We could use a place to keep things like this -- useful Python hacks
that we think aren't quite fully baked enough to put in the core.
Phil> + gdb.write("The finish breakpoint has triggered. If the target\n\
I was under the impression we preferred normal "print" to the use of
gdb.write.
Phil> + def invoke (self, arg, from_tty):
Phil> + if arg != "":
Phil> + linespec = gdb.decode_line (str(arg))
You shouldn't need 'str' here.
Phil> + # Before we set the breakpoint, warn if there was anything
Phil> + # unparsed.
Phil> + if linespec[0] != None:
Phil> + gdb.write("Warning: parts of the expression are unparsed.\n")
IMO this ought to be an error.
Tom