mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-17 13:10:12 +08:00
* 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.
This commit is contained in:
parent
db1e2aa7e4
commit
3f37b69612
@ -1,3 +1,19 @@
|
||||
Wed May 8 14:07:50 1996 Fred Fish <fnf@cygnus.com>
|
||||
|
||||
* 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 <shebs@andros.cygnus.com>
|
||||
|
||||
* target.c (debug_to_xfer_memory): Insert line breaks when
|
||||
|
247
gdb/breakpoint.c
247
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.
|
||||
@ -3674,27 +3624,74 @@ map_breakpoint_numbers (args, function)
|
||||
}
|
||||
|
||||
void
|
||||
enable_breakpoint (bpt)
|
||||
disable_breakpoint (bpt)
|
||||
struct breakpoint *bpt;
|
||||
{
|
||||
/* Never disable a watchpoint scope breakpoint; we want to
|
||||
hit them when we leave scope so we can delete both the
|
||||
watchpoint and its scope breakpoint at that time. */
|
||||
if (bpt->type == bp_watchpoint_scope)
|
||||
return;
|
||||
|
||||
bpt->enable = disabled;
|
||||
|
||||
check_duplicates (bpt->address);
|
||||
|
||||
if (modify_breakpoint_hook)
|
||||
modify_breakpoint_hook (bpt);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
disable_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:
|
||||
disable_breakpoint (bpt);
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
else
|
||||
map_breakpoint_numbers (args, disable_breakpoint);
|
||||
}
|
||||
|
||||
static void
|
||||
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)
|
||||
{
|
||||
int i;
|
||||
i = hw_breakpoint_used_count();
|
||||
target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT(
|
||||
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;
|
||||
bpt->disposition = disposition;
|
||||
check_duplicates (bpt->address);
|
||||
breakpoints_changed ();
|
||||
|
||||
if (bpt->type == bp_watchpoint || bpt->type == bp_hardware_watchpoint ||
|
||||
bpt->type == bp_read_watchpoint || bpt->type == bp_access_watchpoint)
|
||||
@ -3740,9 +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);
|
||||
return;
|
||||
bpt->enable = disabled;
|
||||
value_free_to_mark (mark);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3750,18 +3747,28 @@ 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;
|
||||
{
|
||||
struct breakpoint *bpt;
|
||||
register struct breakpoint *bpt;
|
||||
if (args == 0)
|
||||
ALL_BREAKPOINTS (bpt)
|
||||
switch (bpt->type)
|
||||
@ -3780,127 +3787,11 @@ enable_command (args, from_tty)
|
||||
map_breakpoint_numbers (args, enable_breakpoint);
|
||||
}
|
||||
|
||||
void
|
||||
disable_breakpoint (bpt)
|
||||
struct breakpoint *bpt;
|
||||
{
|
||||
/* Never disable a watchpoint scope breakpoint; we want to
|
||||
hit them when we leave scope so we can delete both the
|
||||
watchpoint and its scope breakpoint at that time. */
|
||||
if (bpt->type == bp_watchpoint_scope)
|
||||
return;
|
||||
|
||||
bpt->enable = disabled;
|
||||
|
||||
check_duplicates (bpt->address);
|
||||
|
||||
if (modify_breakpoint_hook)
|
||||
modify_breakpoint_hook (bpt);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
disable_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:
|
||||
disable_breakpoint (bpt);
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
else
|
||||
map_breakpoint_numbers (args, disable_breakpoint);
|
||||
}
|
||||
|
||||
static void
|
||||
enable_once_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;
|
||||
bpt->disposition = disable;
|
||||
check_duplicates (bpt->address);
|
||||
breakpoints_changed ();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if (save_selected_frame_level >= 0)
|
||||
select_frame (save_selected_frame, save_selected_frame_level);
|
||||
value_free_to_mark (mark);
|
||||
}
|
||||
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 */
|
||||
|
@ -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 ()
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user