[RFC]: pending break support

J. Johnston jjohnstn@redhat.com
Wed Dec 3 01:35:00 GMT 2003

This is the next stage for the pending breakpoint support.  I have put together 
a real patch run through the testsuite with a new test case to verify the 
pending breakpoint support.

I consider the following default behaviors to be controlled at a later date with 

   1. For now, once a pending breakpoint is resolved, it is deleted and replaced
      with whatever breakpoint(s) would naturally occur at that point in time for
      the given input.  In most cases, it will be first found location after a
      shared library load.  It is possible for the symbol to exist in multiple
      shared libraries if the pending breakpoint is disabled, then enabled again
      after multiple shared libraries have been loaded.  Whatever the current
      breakpoint behavior for such a case will be followed (i.e. the breakpoint
      is simply issued at a later time).

   2. For now, a pending breakpoint queries the user as to what they want to do.

I foresee a setting that would allow pending breakpoints to be set by default 
and another one which would allow a pending breakpoint to stick around after 
resolution.  The latter setting would require support so that a breakpoint could 
be tied to the shared library it was found in.

I have added documentation on the pending breakpoint per Eli's request.

Break condition and command support exists mostly as normal, however, parsing of 
conditions does not occur until the breakpoint location is resolved.  I have 
tried to make sure that the original state existing at the point of the break 
command is restored when the breakpoint is resolved (e.g. language, input_radix).

To avoid a problem with restarting programs where pending breakpoints are yet to 
be resolved, I have set up a "silent_if_not_found" flag for decode_line_1.  It 
simply causes an exception to be thrown rather than calling error() if the 
source file or function cannot be found.  This flag is turned on by the code 
that checks for pending breakpoint resolution.  Without this code, you would see 
a score of error messages for every failed attempt at resolving a pending 
breakpoint when shared libraries are loaded.

Please let me know if it ok to commit?

-- Jeff J.

2003-12-02  Jeff Johnston  <jjohnstn@redhat.com>

	* breakpoint.c (condition_command): Only parse the expression if not a
	pending breakpoint.
	(insert_bp_location): Check for not pending when checking for an
	enabled breakpoint.
	(insert_breakpoints): Ditto.
	(remove_breakpoint): Ditto.
	(breakpoint_here_p): Ditto.
	(breakpoint_thread_match): Ditto.
	(bpstat_stop_status): Ditto.
	(bpstat_should_stop): Ditto.
	(bpstat_have_active_hw_watchpoints): Ditto.
	(check_duplicates): Ditto.
	(disable_breakpoints_in_shlibs): Ditto.
	(hw_watchpoint_used_count): Ditto.
	(delete_breakpoint): Ditto.
	(print_one_breakpoint): Add pending support.
	(mention): Ditto.
	(set_raw_breakpoint): Initialize pending flag to 0.
	(captured_parse_breakpoint_args): New structure.
	(resolve_pending_breakpoint): New function.
	(do_captured_parse_breakpoint): Ditto.
	(re_enable_breakpoints_in_shlibs): Try and resolve any existing
	pending breakpoints that are enabled.
	(solib_load_unload_1): Add additional parameter to decode_line_1 call.
	(break_at_finish_command_1): Ditto.
	(until_break_command): Ditto.
	(handle_gnu_v3_exceptions): Ditto.
	(decode_line_spec_1): Ditto.
	(breakpoint_re_set_one): Ditto.  Also check for pending flag.
	(parse_breakpoint_sals): Add new silent_flag parameter and pass this
	parameter on to decode_line_1.
	(do_captured_breakpoint): Account for new parameter when calling
	(break_command_1): Indirectly call parse_breakpoint_sals via
	catch_errors.  Support pending breakpoint if file or function not found.
	(do_enable_breakpoint): Check for enabling a disabled pending breakpoint
	in which case try and resolve the pending breakpoint.
	* breakpoint.h (struct breakpoint): Add new from_tty, flag, and pending
	* linespec.c (symtab_from_filename): Add new silent_if_not_found
	parameter.  Do not call error() for missing file.
	(decode_variable): Ditto.  Do not call error() for missing function.
	(decode_line_1): Add new silent_if_not_found parameter.  Pass new
	parameter to symtab_from_filename() and decode_variable().
	* linespec.h (decode_line_1): Add new silent_if_not_found parameter.
	* symtab.c (decode_line_spec): Change call to decode_line_1 to add
	default 0 last parameter.
	* tracepoint.c (trace_command, scope_info): Ditto.
	* cli/cli-cmds.c (edit_command, list_command): Change call to
	decode_line_1 to add default 0 last parameter.


2003-12-03  Jeff Johnston  <jjohnstn@redhat.com>

	* gdb.texinfo: Add documentation for pending breakpoint support.


	* lib/gdb.exp (gdb_breakpoint): Add support for pending breakpoint
	* gdb.base/pending.exp: New test.
	* gdb.base/pending.c: New file.
	* gdb.base/pendshr1.c: Ditto.
	* gdb.base/langs.exp: Fix to ignore pending breakpoint message.
	* gdb.base/shlib-call.exp: Use gdb_breakpoint for shr1 breakpoint.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pending.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20031203/3e5957f1/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: penddoc.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20031203/3e5957f1/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pendtest.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20031203/3e5957f1/attachment-0002.ksh>

More information about the Gdb-patches mailing list