From 3f37b6961216048f92b5fa82d8f33d395e27c05b Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Wed, 8 May 1996 23:34:34 +0000 Subject: [PATCH] * breakpoint.c (clear_momentary_breakpoints): Remove dead code that is referenced nowhere else. (set_breakpoint): Ditto. (do_enable_breakpoint): Created from enable_once_breakpoint with a couple of changes. (enable_breakpoint): Call do_enable_breakpoint with an appropriate bpdisp enum value to set disposition of breakpoint. (enable_once_breakpoint): Ditto. (enable_delete_breakpoint): Ditto. * breakpoint.h (clear_momentary_breakpoints): Remove prototype. * symtab.c (find_pc_line): Improve comments. * gdbtk.c: Fix a couple of misspellings. * xcoffread.c: Ditto. --- gdb/ChangeLog | 16 ++++ gdb/breakpoint.c | 227 ++++++++++++----------------------------------- gdb/gdbtk.c | 4 +- gdb/xcoffread.c | 4 +- 4 files changed, 77 insertions(+), 174 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dd9393de51a..5854fb387e5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,19 @@ +Wed May 8 14:07:50 1996 Fred Fish + + * breakpoint.c (clear_momentary_breakpoints): Remove dead code + that is referenced nowhere else. + (set_breakpoint): Ditto. + (do_enable_breakpoint): Created from enable_once_breakpoint + with a couple of changes. + (enable_breakpoint): Call do_enable_breakpoint with an appropriate + bpdisp enum value to set disposition of breakpoint. + (enable_once_breakpoint): Ditto. + (enable_delete_breakpoint): Ditto. + * breakpoint.h (clear_momentary_breakpoints): Remove prototype. + * symtab.c (find_pc_line): Improve comments. + * gdbtk.c: Fix a couple of misspellings. + * xcoffread.c: Ditto. + Tue May 7 18:37:06 1996 Stan Shebs * target.c (debug_to_xfer_memory): Insert line breaks when diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f01e6857361..d9960ed1861 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2209,19 +2209,6 @@ set_momentary_breakpoint (sal, frame, type) return b; } -#if 0 -void -clear_momentary_breakpoints () -{ - register struct breakpoint *b, *temp; - ALL_BREAKPOINTS_SAFE (b, temp) - if (b->disposition == delete) - { - delete_breakpoint (b); - break; - } -} -#endif /* Tell the user we have just set a breakpoint B. */ @@ -2290,43 +2277,6 @@ mention (b) printf_filtered ("\n"); } -#if 0 -/* Nobody calls this currently. */ -/* Set a breakpoint from a symtab and line. - If TEMPFLAG is nonzero, it is a temporary breakpoint. - ADDR_STRING is a malloc'd string holding the name of where we are - setting the breakpoint. This is used later to re-set it after the - program is relinked and symbols are reloaded. - Print the same confirmation messages that the breakpoint command prints. */ - -void -set_breakpoint (s, line, tempflag, addr_string) - struct symtab *s; - int line; - int tempflag; - char *addr_string; -{ - register struct breakpoint *b; - struct symtab_and_line sal; - - sal.symtab = s; - sal.line = line; - sal.pc = 0; - resolve_sal_pc (&sal); /* Might error out */ - describe_other_breakpoints (sal.pc); - - b = set_raw_breakpoint (sal); - set_breakpoint_count (breakpoint_count + 1); - b->number = breakpoint_count; - b->type = bp_breakpoint; - b->cond = 0; - b->addr_string = addr_string; - b->enable = enabled; - b->disposition = tempflag ? delete : donttouch; - - mention (b); -} -#endif /* 0 */ /* Set a breakpoint according to ARG (function, linenum or *address) flag: first bit : 0 non-temporary, 1 temporary. @@ -3673,113 +3623,6 @@ map_breakpoint_numbers (args, function) } } -void -enable_breakpoint (bpt) - struct breakpoint *bpt; -{ - struct frame_info *save_selected_frame = NULL; - int save_selected_frame_level = -1; - int target_resources_ok, other_type_used; - struct value *mark; - - if (bpt->type == bp_hardware_breakpoint) - { - int i; - i = hw_breakpoint_used_count(); - target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT( - bp_hardware_breakpoint, i+1, 0); - if (target_resources_ok == 0) - error ("No hardware breakpoint support in the target."); - else if (target_resources_ok < 0) - error ("Hardware breakpoints used exceeds limit."); - } - bpt->enable = enabled; - check_duplicates (bpt->address); - - if (bpt->type == bp_watchpoint || bpt->type == bp_hardware_watchpoint || - bpt->type == bp_read_watchpoint || bpt->type == bp_access_watchpoint) - { - if (bpt->exp_valid_block != NULL) - { - struct frame_info *fr = - find_frame_addr_in_frame_chain (bpt->watchpoint_frame); - if (fr == NULL) - { - printf_filtered ("\ -Cannot enable watchpoint %d because the block in which its expression\n\ -is valid is not currently in scope.\n", bpt->number); - bpt->enable = disabled; - return; - } - - save_selected_frame = selected_frame; - save_selected_frame_level = selected_frame_level; - select_frame (fr, -1); - } - - value_free (bpt->val); - mark = value_mark (); - bpt->val = evaluate_expression (bpt->exp); - release_value (bpt->val); - if (VALUE_LAZY (bpt->val)) - value_fetch_lazy (bpt->val); - - if (bpt->type == bp_hardware_watchpoint || - bpt->type == bp_read_watchpoint || - bpt->type == bp_access_watchpoint) - { - int i = hw_watchpoint_used_count (bpt->type, &other_type_used); - int mem_cnt = can_use_hardware_watchpoint (bpt->val); - - target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT( - bpt->type, i + mem_cnt, other_type_used); - /* we can consider of type is bp_hardware_watchpoint, convert to - bp_watchpoint in the following condition */ - if (target_resources_ok < 0) - { - printf_filtered("\ -Cannot enable watchpoint %d because target watch resources\n\ -have been allocated for other watchpoints.\n", bpt->number); - bpt->enable = disabled; - value_free_to_mark (mark); - return; - } - } - - if (save_selected_frame_level >= 0) - select_frame (save_selected_frame, save_selected_frame_level); - value_free_to_mark (mark); - } - - if (modify_breakpoint_hook) - modify_breakpoint_hook (bpt); -} - -/* ARGSUSED */ -static void -enable_command (args, from_tty) - char *args; - int from_tty; -{ - struct breakpoint *bpt; - if (args == 0) - ALL_BREAKPOINTS (bpt) - switch (bpt->type) - { - case bp_breakpoint: - case bp_hardware_breakpoint: - case bp_watchpoint: - case bp_hardware_watchpoint: - case bp_read_watchpoint: - case bp_access_watchpoint: - enable_breakpoint (bpt); - default: - continue; - } - else - map_breakpoint_numbers (args, enable_breakpoint); -} - void disable_breakpoint (bpt) struct breakpoint *bpt; @@ -3824,16 +3667,17 @@ disable_command (args, from_tty) } static void -enable_once_breakpoint (bpt) +do_enable_breakpoint (bpt, disposition) struct breakpoint *bpt; + enum bpdisp disposition; { struct frame_info *save_selected_frame = NULL; int save_selected_frame_level = -1; int target_resources_ok, other_type_used; struct value *mark; - if (bpt->type == bp_hardware_breakpoint) - { + if (bpt->type == bp_hardware_breakpoint) + { int i; i = hw_breakpoint_used_count(); target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT( @@ -3845,7 +3689,7 @@ enable_once_breakpoint (bpt) } bpt->enable = enabled; - bpt->disposition = disable; + bpt->disposition = disposition; check_duplicates (bpt->address); breakpoints_changed (); @@ -3882,9 +3726,10 @@ is valid is not currently in scope.\n", bpt->number); bpt->type == bp_access_watchpoint) { int i = hw_watchpoint_used_count (bpt->type, &other_type_used); - int mem_cnt = can_use_hardware_watchpoint(bpt->val); + int mem_cnt = can_use_hardware_watchpoint (bpt->val); + target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT( - bpt->type, i+mem_cnt, other_type_used); + bpt->type, i + mem_cnt, other_type_used); /* we can consider of type is bp_hardware_watchpoint, convert to bp_watchpoint in the following condition */ if (target_resources_ok < 0) @@ -3892,8 +3737,9 @@ is valid is not currently in scope.\n", bpt->number); printf_filtered("\ Cannot enable watchpoint %d because target watch resources\n\ have been allocated for other watchpoints.\n", bpt->number); - bpt->enable = disabled; - value_free_to_mark (mark); + bpt->enable = disabled; + value_free_to_mark (mark); + return; } } @@ -3901,6 +3747,51 @@ have been allocated for other watchpoints.\n", bpt->number); select_frame (save_selected_frame, save_selected_frame_level); value_free_to_mark (mark); } + if (modify_breakpoint_hook) + modify_breakpoint_hook (bpt); +} + +void +enable_breakpoint (bpt) + struct breakpoint *bpt; +{ + do_enable_breakpoint (bpt, donttouch); +} + +/* The enable command enables the specified breakpoints (or all defined + breakpoints) so they once again become (or continue to be) effective + in stopping the inferior. */ + +/* ARGSUSED */ +static void +enable_command (args, from_tty) + char *args; + int from_tty; +{ + register struct breakpoint *bpt; + if (args == 0) + ALL_BREAKPOINTS (bpt) + switch (bpt->type) + { + case bp_breakpoint: + case bp_hardware_breakpoint: + case bp_watchpoint: + case bp_hardware_watchpoint: + case bp_read_watchpoint: + case bp_access_watchpoint: + enable_breakpoint (bpt); + default: + continue; + } + else + map_breakpoint_numbers (args, enable_breakpoint); +} + +static void +enable_once_breakpoint (bpt) + struct breakpoint *bpt; +{ + do_enable_breakpoint (bpt, disable); } /* ARGSUSED */ @@ -3916,11 +3807,7 @@ static void enable_delete_breakpoint (bpt) struct breakpoint *bpt; { - bpt->enable = enabled; - bpt->disposition = del; - - check_duplicates (bpt->address); - breakpoints_changed (); + do_enable_breakpoint (bpt, del); } /* ARGSUSED */ diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index 3c8cfbbc0d1..bf5c251b75f 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -50,7 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif /* Some versions (1.3.79, 1.3.81) of Linux don't support SIOCSPGRP the way - gdbtk wants to us it... */ + gdbtk wants to use it... */ #ifdef __linux__ #undef SIOCSPGRP #endif @@ -1235,7 +1235,7 @@ gdbtk_init () discard_cleanups (old_chain); } -/* Come here during initialze_all_files () */ +/* Come here during initialize_all_files () */ void _initialize_gdbtk () diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index b0b96121b6e..c2e790575e2 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -370,8 +370,8 @@ compare_lte (lte1, lte2) return lte1->pc - lte2->pc; } -/* Give a line table with function entries are marked, arrange its functions - in assending order and strip off function entry markers and return it in +/* Given a line table with function entries are marked, arrange its functions + in ascending order and strip off function entry markers and return it in a newly created table. If the old one is good enough, return the old one. */ /* FIXME: I think all this stuff can be replaced by just passing sort_linevec = 1 to end_symtab. */ -- 2.30.2