From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18453 invoked by alias); 5 Apr 2010 10:11:10 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 18148 invoked by uid 9674); 5 Apr 2010 10:11:04 -0000 Date: Mon, 05 Apr 2010 10:11:00 -0000 Message-ID: <20100405101103.18124.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] master: Merge remote branch 'gdb/master' X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: d7e58fcbe0967f09883b314a2b414f265c41121a X-Git-Newrev: 57303b18fb693cb2d299f3ae922ce2ba15070dd1 X-SW-Source: 2010-q2/txt/msg00004.txt.bz2 List-Id: The branch, master has been updated via 57303b18fb693cb2d299f3ae922ce2ba15070dd1 (commit) via 07d9fe7c61bc1b0ad689957904b1565c09f306a2 (commit) via 693a21a0d6289b9cf29ae161c392c201ad305793 (commit) via e6e5e0c6e011759aec776260969dfc3e55c01729 (commit) via d2ddf83a91c8bf81f421f425699fd7b2b8e7f911 (commit) via 91d6d46b0c1d3b5ae3602be139cb8780ded5b418 (commit) via ef9b9ef1ad140e93ebeec10320972a2c639d2e57 (commit) from d7e58fcbe0967f09883b314a2b414f265c41121a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 57303b18fb693cb2d299f3ae922ce2ba15070dd1 Merge: d7e58fcbe0967f09883b314a2b414f265c41121a 07d9fe7c61bc1b0ad689957904b1565c09f306a2 Author: Jan Kratochvil Date: Mon Apr 5 12:10:41 2010 +0200 Merge remote branch 'gdb/master' commit 07d9fe7c61bc1b0ad689957904b1565c09f306a2 Author: Alan Modra Date: Mon Apr 5 00:00:07 2010 +0000 daily update commit 693a21a0d6289b9cf29ae161c392c201ad305793 Author: gdbadmin Date: Mon Apr 5 00:00:03 2010 +0000 *** empty log message *** commit e6e5e0c6e011759aec776260969dfc3e55c01729 Author: Stan Shebs Date: Sun Apr 4 23:46:58 2010 +0000 2010-04-04 Stan Shebs Nathan Sidwell * breakpoint.c (breakpoint_1): Add filter argument, return number of breakpoints printed. (is_hardware_watchpoint): Make argument const. (is_watchpoint): Ditto. (is_tracepoint): Merge of tracepoint_type and breakpoint_is_tracepoint, use it everywhere. (breakpoints_info): Pass NULL to breakpoint_1. (maintenance_info_breakpoints): Ditto. (watchpoints_info): New function. (tracepoints_info): Use breakpoint_1 filter. (set_ignore_count): Warn that tracepoint ignore count will be ignored. (_initialize_breakpoint): Make "info watchpoints" its own command. * breakpoint.h (is_tracepoint): Rename from breakpoint_is_tracepoint. * mi/mi-cmd-break.c (mi_cmd_break_commands): Use is_tracepoint. * gdb.texinfo (Setting Breakpoints): "info watch" no longer a synonym. (Setting Watchpoints): Update description of "info watch". (Disabling Breakpoints): Only "info break" lists all. * gdb.base/completion.exp: Update for new "info watchpoints". * gdb.base/default.exp: Ditto. * gdb.base/help.exp: Ditto. * gdb.base/watchpoint.exp: Ditto. * gdb.trace/infotrace.exp: Update "info tracpoints" output. commit d2ddf83a91c8bf81f421f425699fd7b2b8e7f911 Author: Stan Shebs Date: Sun Apr 4 23:31:19 2010 +0000 2010-04-04 Stan Shebs * tracepoint.c (tfile_fetch_registers): Add fallback case. * gdb.texinfo (Tracepoint Restrictions): Document PC inference. (tdump): Explain how tdump works. * gdb.trace/tfile.exp: Sharpen tfind test. commit 91d6d46b0c1d3b5ae3602be139cb8780ded5b418 Author: Jan Kratochvil Date: Sun Apr 4 22:12:04 2010 +0000 gdb/ * infcmd.c (run_command_1): Call proceed with regcache_read_pc address. * config/djgpp/fnchange.lst: Add translation for break-entry.exp. gdb/testsuite/ * gdb.base/break-entry.exp: New. commit ef9b9ef1ad140e93ebeec10320972a2c639d2e57 Author: Jan Kratochvil Date: Sun Apr 4 13:54:42 2010 +0000 gdb/ * breakpoint.c (bpstat_find_step_resume_breakpoint): Remove. * breakpoint.h (bpstat_find_step_resume_breakpoint): Remove. ----------------------------------------------------------------------- Summary of changes: bfd/version.h | 2 +- gdb/ChangeLog | 32 ++++++ gdb/breakpoint.c | 190 +++++++++++++++---------------- gdb/breakpoint.h | 13 +-- gdb/config/djgpp/fnchange.lst | 1 + gdb/doc/ChangeLog | 9 ++ gdb/doc/gdb.texinfo | 39 ++++++- gdb/infcmd.c | 5 +- gdb/mi/mi-cmd-break.c | 2 +- gdb/testsuite/ChangeLog | 16 +++ gdb/testsuite/gdb.base/break-entry.exp | 43 +++++++ gdb/testsuite/gdb.base/completion.exp | 2 +- gdb/testsuite/gdb.base/default.exp | 2 +- gdb/testsuite/gdb.base/help.exp | 2 +- gdb/testsuite/gdb.base/watchpoint.exp | 10 +- gdb/testsuite/gdb.trace/infotrace.exp | 2 +- gdb/testsuite/gdb.trace/tfile.exp | 5 +- gdb/tracepoint.c | 40 +++++++- gdb/version.in | 2 +- 19 files changed, 282 insertions(+), 135 deletions(-) create mode 100644 gdb/testsuite/gdb.base/break-entry.exp First 500 lines of diff: diff --git a/bfd/version.h b/bfd/version.h index fb0f801..d687826 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20100404 +#define BFD_VERSION_DATE 20100405 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0bcb4a1..d47b862 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,35 @@ +2010-04-04 Stan Shebs + Nathan Sidwell + + * breakpoint.c (breakpoint_1): Add filter argument, return number of + breakpoints printed. + (is_hardware_watchpoint): Make argument const. + (is_watchpoint): Ditto. + (is_tracepoint): Merge of tracepoint_type and breakpoint_is_tracepoint, + use it everywhere. + (breakpoints_info): Pass NULL to breakpoint_1. + (maintenance_info_breakpoints): Ditto. + (watchpoints_info): New function. + (tracepoints_info): Use breakpoint_1 filter. + (set_ignore_count): Warn that tracepoint ignore count will be ignored. + (_initialize_breakpoint): Make "info watchpoints" its own command. + * breakpoint.h (is_tracepoint): Rename from breakpoint_is_tracepoint. + * mi/mi-cmd-break.c (mi_cmd_break_commands): Use is_tracepoint. + +2010-04-04 Stan Shebs + + * tracepoint.c (tfile_fetch_registers): Add fallback case. + +2010-04-04 Jan Kratochvil + + * infcmd.c (run_command_1): Call proceed with regcache_read_pc address. + * config/djgpp/fnchange.lst: Add translation for break-entry.exp. + +2010-04-04 Jan Kratochvil + + * breakpoint.c (bpstat_find_step_resume_breakpoint): Remove. + * breakpoint.h (bpstat_find_step_resume_breakpoint): Remove. + 2010-04-02 Jan Kratochvil * dwarf2read.c (read_namespace_type): Use common "return set_die_type" diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 46a50b9..2efb766 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -130,7 +130,9 @@ static int watchpoint_locations_match (struct bp_location *loc1, static void breakpoints_info (char *, int); -static void breakpoint_1 (int, int); +static void watchpoints_info (char *, int); + +static int breakpoint_1 (int, int, int (*) (const struct breakpoint *)); static bpstat bpstat_alloc (const struct bp_location *, bpstat); @@ -204,9 +206,9 @@ static void update_global_location_list (int); static void update_global_location_list_nothrow (int); -static int is_hardware_watchpoint (struct breakpoint *bpt); +static int is_hardware_watchpoint (const struct breakpoint *bpt); -static int is_watchpoint (struct breakpoint *bpt); +static int is_watchpoint (const struct breakpoint *bpt); static void insert_breakpoint_locations (void); @@ -366,7 +368,7 @@ static int overlay_events_enabled; #define ALL_TRACEPOINTS(B) \ for (B = breakpoint_chain; B; B = B->next) \ - if (tracepoint_type (B)) + if (is_tracepoint (B)) /* Chains of all breakpoints defined. */ @@ -464,14 +466,6 @@ clear_breakpoint_hit_counts (void) b->hit_count = 0; } -/* Encapsulate tests for different types of tracepoints. */ - -static int -tracepoint_type (const struct breakpoint *b) -{ - return (b->type == bp_tracepoint || b->type == bp_fast_tracepoint); -} - /* Allocate a new counted_command_line with reference count of 1. The new structure owns COMMANDS. */ @@ -817,20 +811,14 @@ check_no_tracepoint_commands (struct command_line *commands) } } +/* Encapsulate tests for different types of tracepoints. */ + int -breakpoint_is_tracepoint (const struct breakpoint *b) +is_tracepoint (const struct breakpoint *b) { - switch (b->type) - { - case bp_tracepoint: - case bp_fast_tracepoint: - return 1; - default: - return 0; - - } + return (b->type == bp_tracepoint || b->type == bp_fast_tracepoint); } - + /* A helper function that validsates that COMMANDS are valid for a breakpoint. This function will throw an exception if a problem is found. */ @@ -839,7 +827,7 @@ static void validate_commands_for_breakpoint (struct breakpoint *b, struct command_line *commands) { - if (breakpoint_is_tracepoint (b)) + if (is_tracepoint (b)) { /* We need to verify that each top-level element of commands is valid for tracepoints, that there's at most one while-stepping @@ -949,7 +937,7 @@ do_map_commands_command (struct breakpoint *b, void *data) l = read_command_lines (str, info->from_tty, 1, - (breakpoint_is_tracepoint (b) + (is_tracepoint (b) ? check_tracepoint_command : 0), b); @@ -1175,7 +1163,7 @@ insert_catchpoint (struct ui_out *uo, void *args) /* Return true if BPT is of any hardware watchpoint kind. */ static int -is_hardware_watchpoint (struct breakpoint *bpt) +is_hardware_watchpoint (const struct breakpoint *bpt) { return (bpt->type == bp_hardware_watchpoint || bpt->type == bp_read_watchpoint @@ -1186,7 +1174,7 @@ is_hardware_watchpoint (struct breakpoint *bpt) software. */ static int -is_watchpoint (struct breakpoint *bpt) +is_watchpoint (const struct breakpoint *bpt) { return (is_hardware_watchpoint (bpt) || bpt->type == bp_watchpoint); @@ -1589,7 +1577,7 @@ should_be_inserted (struct bp_location *bpt) /* Tracepoints are inserted by the target at a time of its choosing, not by us. */ - if (tracepoint_type (bpt->owner)) + if (is_tracepoint (bpt->owner)) return 0; return 1; @@ -2963,36 +2951,6 @@ bpstat_find_breakpoint (bpstat bsp, struct breakpoint *breakpoint) return NULL; } -/* Find a step_resume breakpoint associated with this bpstat. - (If there are multiple step_resume bp's on the list, this function - will arbitrarily pick one.) - - It is an error to use this function if BPSTAT doesn't contain a - step_resume breakpoint. - - See wait_for_inferior's use of this function. */ -struct breakpoint * -bpstat_find_step_resume_breakpoint (bpstat bsp) -{ - int current_thread; - - gdb_assert (bsp != NULL); - - current_thread = pid_to_thread_id (inferior_ptid); - - for (; bsp != NULL; bsp = bsp->next) - { - if ((bsp->breakpoint_at != NULL) - && (bsp->breakpoint_at->owner->type == bp_step_resume) - && (bsp->breakpoint_at->owner->thread == current_thread - || bsp->breakpoint_at->owner->thread == -1)) - return bsp->breakpoint_at->owner; - } - - internal_error (__FILE__, __LINE__, _("No step_resume breakpoint found.")); -} - - /* Put in *NUM the breakpoint number of the first breakpoint we are stopped at. *BSP upon return is a bpstat which points to the remaining breakpoints stopped at (but which is not guaranteed to be good for @@ -3733,7 +3691,7 @@ bpstat_check_location (const struct bp_location *bl, /* By definition, the inferior does not report stops at tracepoints. */ - if (tracepoint_type (b)) + if (is_tracepoint (b)) return 0; if (b->type != bp_watchpoint @@ -4788,7 +4746,7 @@ print_one_breakpoint_location (struct breakpoint *b, because the condition is an internal implementation detail that we do not want to expose to the user. */ annotate_field (7); - if (tracepoint_type (b)) + if (is_tracepoint (b)) ui_out_text (uiout, "\ttrace only if "); else ui_out_text (uiout, "\tstop only if "); @@ -4968,7 +4926,7 @@ user_settable_breakpoint (const struct breakpoint *b) return (b->type == bp_breakpoint || b->type == bp_catchpoint || b->type == bp_hardware_breakpoint - || tracepoint_type (b) + || is_tracepoint (b) || b->type == bp_watchpoint || b->type == bp_read_watchpoint || b->type == bp_access_watchpoint @@ -4976,11 +4934,14 @@ user_settable_breakpoint (const struct breakpoint *b) } /* Print information on user settable breakpoint (watchpoint, etc) - number BNUM. If BNUM is -1 print all user settable breakpoints. - If ALLFLAG is non-zero, include non- user settable breakpoints. */ + number BNUM. If BNUM is -1 print all user-settable breakpoints. + If ALLFLAG is non-zero, include non-user-settable breakpoints. If + FILTER is non-NULL, call it on each breakpoint and only include the + ones for which it returns non-zero. Return the total number of + breakpoints listed. */ -static void -breakpoint_1 (int bnum, int allflag) +static int +breakpoint_1 (int bnum, int allflag, int (*filter) (const struct breakpoint *)) { struct breakpoint *b; struct bp_location *last_loc = NULL; @@ -4998,6 +4959,10 @@ breakpoint_1 (int bnum, int allflag) if (bnum == -1 || bnum == b->number) { + /* If we have a filter, only list the breakpoints it accepts. */ + if (filter && !filter (b)) + continue; + if (allflag || user_settable_breakpoint (b)) { int addr_bit = breakpoint_address_bits (b); @@ -5053,6 +5018,10 @@ breakpoint_1 (int bnum, int allflag) if (bnum == -1 || bnum == b->number) { + /* If we have a filter, only list the breakpoints it accepts. */ + if (filter && !filter (b)) + continue; + /* We only print out user settable breakpoints unless the allflag is set. */ if (allflag || user_settable_breakpoint (b)) @@ -5064,11 +5033,15 @@ breakpoint_1 (int bnum, int allflag) if (nr_printable_breakpoints == 0) { - if (bnum == -1) - ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n"); - else - ui_out_message (uiout, 0, "No breakpoint or watchpoint number %d.\n", - bnum); + /* If there's a filter, let the caller decide how to report empty list. */ + if (!filter) + { + if (bnum == -1) + ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n"); + else + ui_out_message (uiout, 0, "No breakpoint or watchpoint number %d.\n", + bnum); + } } else { @@ -5079,6 +5052,8 @@ breakpoint_1 (int bnum, int allflag) /* FIXME? Should this be moved up so that it is only called when there have been breakpoints? */ annotate_breakpoints_table_end (); + + return nr_printable_breakpoints; } static void @@ -5089,7 +5064,26 @@ breakpoints_info (char *bnum_exp, int from_tty) if (bnum_exp) bnum = parse_and_eval_long (bnum_exp); - breakpoint_1 (bnum, 0); + breakpoint_1 (bnum, 0, NULL); +} + +static void +watchpoints_info (char *wpnum_exp, int from_tty) +{ + int wpnum = -1, num_printed; + + if (wpnum_exp) + wpnum = parse_and_eval_long (wpnum_exp); + + num_printed = breakpoint_1 (wpnum, 0, is_watchpoint); + + if (num_printed == 0) + { + if (wpnum == -1) + ui_out_message (uiout, 0, "No watchpoints.\n"); + else + ui_out_message (uiout, 0, "No watchpoint number %d.\n", wpnum); + } } static void @@ -5100,7 +5094,7 @@ maintenance_info_breakpoints (char *bnum_exp, int from_tty) if (bnum_exp) bnum = parse_and_eval_long (bnum_exp); - breakpoint_1 (bnum, 1); + breakpoint_1 (bnum, 1, NULL); } static int @@ -5429,7 +5423,7 @@ set_breakpoint_location_function (struct bp_location *loc) { if (loc->owner->type == bp_breakpoint || loc->owner->type == bp_hardware_breakpoint - || tracepoint_type (loc->owner)) + || is_tracepoint (loc->owner)) { find_pc_partial_function (loc->address, &(loc->function_name), NULL, NULL); @@ -5716,7 +5710,7 @@ disable_breakpoints_in_shlibs (void) if (((b->type == bp_breakpoint) || (b->type == bp_jit_event) || (b->type == bp_hardware_breakpoint) - || (tracepoint_type (b))) + || (is_tracepoint (b))) && loc->pspace == current_program_space && !loc->shlib_disabled #ifdef PC_SOLIB @@ -9072,7 +9066,7 @@ update_global_location_list (int should_insert) || !loc->enabled || loc->shlib_disabled || !breakpoint_address_is_meaningful (b) - || tracepoint_type (b)) + || is_tracepoint (b)) continue; /* Permanent breakpoint should always be inserted. */ @@ -9732,6 +9726,14 @@ set_ignore_count (int bptnum, int count, int from_tty) ALL_BREAKPOINTS (b) if (b->number == bptnum) { + if (is_tracepoint (b)) + { + if (from_tty && count != 0) + printf_filtered (_("Ignore count ignored for tracepoint %d."), + bptnum); + return; + } + b->ignore_count = count; if (from_tty) { @@ -10451,29 +10453,20 @@ create_tracepoint_from_upload (struct uploaded_tp *utp) static void tracepoints_info (char *tpnum_exp, int from_tty) { - struct breakpoint *b; - int tps_to_list = 0; + int tpnum = -1, num_printed; + + if (tpnum_exp) + tpnum = parse_and_eval_long (tpnum_exp); - /* In the no-arguments case, say "No tracepoints" if none found. */ - if (tpnum_exp == 0) + num_printed = breakpoint_1 (tpnum, 0, is_tracepoint); + + if (num_printed == 0) { - ALL_TRACEPOINTS (b) - { - if (b->number >= 0) - { - tps_to_list = 1; - break; - } - } - if (!tps_to_list) - { - ui_out_message (uiout, 0, "No tracepoints.\n"); - return; - } + if (tpnum == -1) + ui_out_message (uiout, 0, "No tracepoints.\n"); + else + ui_out_message (uiout, 0, "No tracepoint number %d.\n", tpnum); } - - /* Otherwise be the same as "info break". */ - breakpoints_info (tpnum_exp, from_tty); } /* The 'enable trace' command enables tracepoints. @@ -10522,7 +10515,7 @@ delete_trace_command (char *arg, int from_tty) { ALL_BREAKPOINTS_SAFE (b, temp) { - if (tracepoint_type (b) + if (is_tracepoint (b) && b->number >= 0) delete_breakpoint (b); } @@ -11164,8 +11157,9 @@ A watchpoint stops execution of your program whenever the value of\n\ an expression is either read or written.")); set_cmd_completer (c, expression_completer); - add_info ("watchpoints", breakpoints_info, - _("Synonym for ``info breakpoints''.")); + add_info ("watchpoints", watchpoints_info, _("\ +Status of watchpoints, or watchpoint number NUMBER.")); + /* XXX: cagney/2005-02-23: This should be a boolean, and should diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 3da6188..912cc3c 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -651,17 +651,6 @@ struct bpstat_what bpstat_what (bpstat); /* Find the bpstat associated with a breakpoint. NULL otherwise. */ bpstat bpstat_find_breakpoint (bpstat, struct breakpoint *); -/* Find a step_resume breakpoint associated with this bpstat. - (If there are multiple step_resume bp's on the list, this function - will arbitrarily pick one.) - - It is an error to use this function if BPSTAT doesn't contain a - step_resume breakpoint. - - See wait_for_inferior's use of this function. - */ -extern struct breakpoint *bpstat_find_step_resume_breakpoint (bpstat); - /* Nonzero if a signal that we got in wait() was due to circumstances explained by the BS. */ /* Currently that is true if we have hit a breakpoint, or if there is @@ -1041,7 +1030,7 @@ extern struct breakpoint *get_tracepoint_by_number (char **arg, int multi_p, is newly allocated; the caller should free when done with it. */ extern VEC(breakpoint_p) *all_tracepoints (void); -extern int breakpoint_is_tracepoint (const struct breakpoint *b); +extern int is_tracepoint (const struct breakpoint *b); /* Function that can be passed to read_command_line to validate that each command is suitable for tracepoint command list. */ diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst index 3982f1d..eb9e835 100644 --- a/gdb/config/djgpp/fnchange.lst +++ b/gdb/config/djgpp/fnchange.lst @@ -371,6 +371,7 @@ @V@/gdb/testsuite/gdb.arch/powerpc-prologue.exp @V@/gdb/testsuite/gdb.arch/ppc-prologue.exp @V@/gdb/testsuite/gdb.base/bitfields2.c @V@/gdb/testsuite/gdb.base/bitfiel2.c @V@/gdb/testsuite/gdb.base/bitfields2.exp @V@/gdb/testsuite/gdb.base/bitfiel2.exp +@V@/gdb/testsuite/gdb.base/break-entry.exp @V@/gdb/testsuite/gdb.base/brkentry.exp @V@/gdb/testsuite/gdb.base/coremaker2.c @V@/gdb/testsuite/gdb.base/core2maker.c @V@/gdb/testsuite/gdb.base/hashline1.exp @V@/gdb/testsuite/gdb.base/hash1line.exp @V@/gdb/testsuite/gdb.base/hashline2.exp @V@/gdb/testsuite/gdb.base/hash2line.exp diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index a792152..9d9939f 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,12 @@ +2010-04-04 Stan Shebs + + * gdb.texinfo (Setting Breakpoints): "info watch" no longer a synonym. + (Setting Watchpoints): Update description of "info watch". hooks/post-receive -- Repository for Project Archer.