* [4/9] associate bpstat with location
@ 2007-09-07 20:18 Vladimir Prus
2007-09-08 11:07 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Prus @ 2007-09-07 20:18 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 290 bytes --]
This patch makes bpstat point to bp_location, not to breakpoint.
This is necessary since in the end, when printing stop reason,
we should be able the address of the location at which we stopped.
If bpstat points to breakpoint, we don't know what location we're
stopped at. OK?
- Volodya
[-- Attachment #2: 4.ChangeLog --]
[-- Type: text/plain, Size: 676 bytes --]
* breakpoint.h (breakpoint_at): Change type
to bp_location*.
* breakpoint.c (bpstat_alloc): Take bp_location,
not breakpoint.
(bpstat_find_breakpoint): Look at bpstat's location's
owner, not at bpstat->breakpoint_at.
(bpstat_find_step_resume_breakpoint): Likewise.
(bpstat_num): Likewise.
(print_it_typical): Likewise.
(print_bp_stop_message): Likewise.
(watchpoint_check): Likewise.
(bpstat_what): Likewise.
(bpstat_get_triggered_catchpoints): Likewise.
(breakpoint_auto_delete): Likewise.
(delete_breakpoint): Likewise.
(bpstat_stop_status): Pass location, not breakpoint,
to bpstat_alloc. Look at bpstat's location's
owner, not at bpstat->breakpoint_at.
[-- Attachment #3: mainline_4_bpstat_owner.diff --]
[-- Type: text/x-diff, Size: 14854 bytes --]
--- gdb/breakpoint.c (/mirrors/gdb_mainline) (revision 4738)
+++ gdb/breakpoint.c (/work/mb_mainline/4_bpstat_owner) (revision 4738)
@@ -109,7 +109,7 @@ static void breakpoints_info (char *, in
static void breakpoint_1 (int, int);
-static bpstat bpstat_alloc (struct breakpoint *, bpstat);
+static bpstat bpstat_alloc (struct bp_location *, bpstat);
static int breakpoint_cond_eval (void *);
@@ -1968,7 +1968,7 @@ bpstat_find_breakpoint (bpstat bsp, stru
for (; bsp != NULL; bsp = bsp->next)
{
- if (bsp->breakpoint_at == breakpoint)
+ if (bsp->breakpoint_at && bsp->breakpoint_at->owner == breakpoint)
return bsp;
}
return NULL;
@@ -1994,10 +1994,10 @@ bpstat_find_step_resume_breakpoint (bpst
for (; bsp != NULL; bsp = bsp->next)
{
if ((bsp->breakpoint_at != NULL) &&
- (bsp->breakpoint_at->type == bp_step_resume) &&
- (bsp->breakpoint_at->thread == current_thread ||
- bsp->breakpoint_at->thread == -1))
- return bsp->breakpoint_at;
+ (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."));
@@ -2021,7 +2021,11 @@ bpstat_num (bpstat *bsp, int *num)
if ((*bsp) == NULL)
return 0; /* No more breakpoint values */
- b = (*bsp)->breakpoint_at;
+ /* We assume we'll never have several bpstats that
+ correspond to a single breakpoint -- otherwise,
+ this function might return the same number more
+ than once and this will look ugly. */
+ b = (*bsp)->breakpoint_at ? (*bsp)->breakpoint_at->owner : NULL;
*bsp = (*bsp)->next;
if (b == NULL)
return -1; /* breakpoint that's been deleted since */
@@ -2152,6 +2156,7 @@ static enum print_stop_action
print_it_typical (bpstat bs)
{
struct cleanup *old_chain, *ui_out_chain;
+ struct breakpoint *b;
struct ui_stream *stb;
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
@@ -2159,21 +2164,22 @@ print_it_typical (bpstat bs)
which has since been deleted. */
if (bs->breakpoint_at == NULL)
return PRINT_UNKNOWN;
+ b = bs->breakpoint_at->owner;
- switch (bs->breakpoint_at->type)
+ switch (b->type)
{
case bp_breakpoint:
case bp_hardware_breakpoint:
- if (bs->breakpoint_at->loc->address != bs->breakpoint_at->loc->requested_address)
- breakpoint_adjustment_warning (bs->breakpoint_at->loc->requested_address,
- bs->breakpoint_at->loc->address,
- bs->breakpoint_at->number, 1);
- annotate_breakpoint (bs->breakpoint_at->number);
+ if (b->loc->address != b->loc->requested_address)
+ breakpoint_adjustment_warning (b->loc->requested_address,
+ b->loc->address,
+ b->number, 1);
+ annotate_breakpoint (b->number);
ui_out_text (uiout, "\nBreakpoint ");
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason",
async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT));
- ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
+ ui_out_field_int (uiout, "bkptno", b->number);
ui_out_text (uiout, ", ");
return PRINT_SRC_AND_LOC;
break;
@@ -2200,42 +2206,42 @@ print_it_typical (bpstat bs)
break;
case bp_catch_load:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (loaded %s), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->triggered_dll_pathname);
+ b->number,
+ b->triggered_dll_pathname);
return PRINT_SRC_AND_LOC;
break;
case bp_catch_unload:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (unloaded %s), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->triggered_dll_pathname);
+ b->number,
+ b->triggered_dll_pathname);
return PRINT_SRC_AND_LOC;
break;
case bp_catch_fork:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (forked process %d), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->forked_inferior_pid);
+ b->number,
+ b->forked_inferior_pid);
return PRINT_SRC_AND_LOC;
break;
case bp_catch_vfork:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (vforked process %d), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->forked_inferior_pid);
+ b->number,
+ b->forked_inferior_pid);
return PRINT_SRC_AND_LOC;
break;
case bp_catch_exec:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (exec'd %s), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->exec_pathname);
+ b->number,
+ b->exec_pathname);
return PRINT_SRC_AND_LOC;
break;
@@ -2243,9 +2249,9 @@ print_it_typical (bpstat bs)
if (current_exception_event &&
(CURRENT_EXCEPTION_KIND == EX_EVENT_CATCH))
{
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (exception caught), "),
- bs->breakpoint_at->number);
+ b->number);
if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
printf_filtered (_("throw location %s:%d, "),
CURRENT_EXCEPTION_THROW_FILE,
@@ -2274,9 +2280,9 @@ print_it_typical (bpstat bs)
if (current_exception_event &&
(CURRENT_EXCEPTION_KIND == EX_EVENT_THROW))
{
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (exception thrown), "),
- bs->breakpoint_at->number);
+ b->number);
if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
printf_filtered (_("throw location %s:%d, "),
CURRENT_EXCEPTION_THROW_FILE,
@@ -2305,18 +2311,18 @@ print_it_typical (bpstat bs)
case bp_hardware_watchpoint:
if (bs->old_val != NULL)
{
- annotate_watchpoint (bs->breakpoint_at->number);
+ annotate_watchpoint (b->number);
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason",
async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER));
- mention (bs->breakpoint_at);
+ mention (b);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
ui_out_field_stream (uiout, "old", stb);
ui_out_text (uiout, "\nNew value = ");
- value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default);
+ value_print (b->val, stb->stream, 0, Val_pretty_default);
ui_out_field_stream (uiout, "new", stb);
do_cleanups (ui_out_chain);
ui_out_text (uiout, "\n");
@@ -2332,10 +2338,10 @@ print_it_typical (bpstat bs)
ui_out_field_string
(uiout, "reason",
async_reason_lookup (EXEC_ASYNC_READ_WATCHPOINT_TRIGGER));
- mention (bs->breakpoint_at);
+ mention (b);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nValue = ");
- value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default);
+ value_print (b->val, stb->stream, 0, Val_pretty_default);
ui_out_field_stream (uiout, "value", stb);
do_cleanups (ui_out_chain);
ui_out_text (uiout, "\n");
@@ -2345,12 +2351,12 @@ print_it_typical (bpstat bs)
case bp_access_watchpoint:
if (bs->old_val != NULL)
{
- annotate_watchpoint (bs->breakpoint_at->number);
+ annotate_watchpoint (b->number);
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason",
async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER));
- mention (bs->breakpoint_at);
+ mention (b);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
@@ -2361,7 +2367,7 @@ print_it_typical (bpstat bs)
}
else
{
- mention (bs->breakpoint_at);
+ mention (b);
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason",
@@ -2369,7 +2375,7 @@ print_it_typical (bpstat bs)
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nValue = ");
}
- value_print (bs->breakpoint_at->val, stb->stream, 0,Val_pretty_default);
+ value_print (b->val, stb->stream, 0,Val_pretty_default);
ui_out_field_stream (uiout, "new", stb);
do_cleanups (ui_out_chain);
ui_out_text (uiout, "\n");
@@ -2429,14 +2435,19 @@ print_bp_stop_message (bpstat bs)
break;
case print_it_normal:
- /* Normal case. Call the breakpoint's print_it method, or
- print_it_typical. */
- if (bs->breakpoint_at != NULL && bs->breakpoint_at->ops != NULL
- && bs->breakpoint_at->ops->print_it != NULL)
- return bs->breakpoint_at->ops->print_it (bs->breakpoint_at);
- else
- return print_it_typical (bs);
- break;
+ {
+ struct bp_location *bl = bs->breakpoint_at;
+ struct breakpoint *b = bl ? bl->owner : NULL;
+
+ /* Normal case. Call the breakpoint's print_it method, or
+ print_it_typical. */
+ /* FIXME: how breakpoint can ever be NULL here? */
+ if (b != NULL && b->ops != NULL && b->ops->print_it != NULL)
+ return b->ops->print_it (b);
+ else
+ return print_it_typical (bs);
+ }
+ break;
default:
internal_error (__FILE__, __LINE__,
@@ -2505,13 +2516,13 @@ breakpoint_cond_eval (void *exp)
/* Allocate a new bpstat and chain it to the current one. */
static bpstat
-bpstat_alloc (struct breakpoint *b, bpstat cbs /* Current "bs" value */ )
+bpstat_alloc (struct bp_location *bl, bpstat cbs /* Current "bs" value */ )
{
bpstat bs;
bs = (bpstat) xmalloc (sizeof (*bs));
cbs->next = bs;
- bs->breakpoint_at = b;
+ bs->breakpoint_at = bl;
/* If the condition is false, etc., don't do the commands. */
bs->commands = NULL;
bs->old_val = NULL;
@@ -2541,7 +2552,7 @@ watchpoint_check (void *p)
struct frame_info *fr;
int within_current_scope;
- b = bs->breakpoint_at;
+ b = bs->breakpoint_at->owner;
if (b->exp_valid_block == NULL)
within_current_scope = 1;
@@ -2588,7 +2599,7 @@ watchpoint_check (void *p)
we might be in the middle of evaluating a function call. */
struct value *mark = value_mark ();
- struct value *new_val = evaluate_expression (bs->breakpoint_at->exp);
+ struct value *new_val = evaluate_expression (b->exp);
if (!value_equal (b->val, new_val))
{
release_value (new_val);
@@ -2624,7 +2635,7 @@ watchpoint_check (void *p)
ui_out_field_string
(uiout, "reason", async_reason_lookup (EXEC_ASYNC_WATCHPOINT_SCOPE));
ui_out_text (uiout, "\nWatchpoint ");
- ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
+ ui_out_field_int (uiout, "wpnum", b->number);
ui_out_text (uiout, " deleted because the program has left the block in\n\
which its expression is valid.\n");
@@ -2760,7 +2771,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
/* Come here if it's a watchpoint, or if the break address matches */
- bs = bpstat_alloc (b, bs); /* Alloc a bpstat to explain stop */
+ bs = bpstat_alloc (b->loc, bs); /* Alloc a bpstat to explain stop */
/* Watchpoints may change this, if not found to have triggered. */
bs->stop = 1;
@@ -2971,9 +2982,9 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
/* The value of a hardware watchpoint hasn't changed, but the
intermediate memory locations we are watching may have. */
if (bs && !bs->stop &&
- (bs->breakpoint_at->type == bp_hardware_watchpoint ||
- bs->breakpoint_at->type == bp_read_watchpoint ||
- bs->breakpoint_at->type == bp_access_watchpoint))
+ (bs->breakpoint_at->owner->type == bp_hardware_watchpoint ||
+ bs->breakpoint_at->owner->type == bp_read_watchpoint ||
+ bs->breakpoint_at->owner->type == bp_access_watchpoint))
{
remove_breakpoints ();
insert_breakpoints ();
@@ -3134,7 +3145,7 @@ bpstat_what (bpstat bs)
/* I suspect this can happen if it was a momentary breakpoint
which has since been deleted. */
continue;
- switch (bs->breakpoint_at->type)
+ switch (bs->breakpoint_at->owner->type)
{
case bp_none:
continue;
@@ -3289,7 +3300,7 @@ bpstat_get_triggered_catchpoints (bpstat
for (; ep_list != NULL; ep_list = ep_list->next)
{
/* Is this eventpoint a catchpoint? If not, ignore it. */
- ep = ep_list->breakpoint_at;
+ ep = ep_list->breakpoint_at->owner;
if (ep == NULL)
break;
if ((ep->type != bp_catch_load) &&
@@ -3300,7 +3311,7 @@ bpstat_get_triggered_catchpoints (bpstat
continue;
/* Yes; add it to the list. */
- bs = bpstat_alloc (ep, bs);
+ bs = bpstat_alloc (ep_list->breakpoint_at, bs);
*bs = *ep_list;
bs->next = NULL;
bs = root_bs->next;
@@ -6849,9 +6860,9 @@ breakpoint_auto_delete (bpstat bs)
struct breakpoint *b, *temp;
for (; bs; bs = bs->next)
- if (bs->breakpoint_at && bs->breakpoint_at->disposition == disp_del
+ if (bs->breakpoint_at && bs->breakpoint_at->owner->disposition == disp_del
&& bs->stop)
- delete_breakpoint (bs->breakpoint_at);
+ delete_breakpoint (bs->breakpoint_at->owner);
ALL_BREAKPOINTS_SAFE (b, temp)
{
@@ -7041,7 +7052,7 @@ delete_breakpoint (struct breakpoint *bp
in event-top.c won't do anything, and temporary breakpoints
with commands won't work. */
for (bs = stop_bpstat; bs; bs = bs->next)
- if (bs->breakpoint_at == bpt)
+ if (bs->breakpoint_at && bs->breakpoint_at->owner == bpt)
{
bs->breakpoint_at = NULL;
bs->old_val = NULL;
--- gdb/breakpoint.h (/mirrors/gdb_mainline) (revision 4738)
+++ gdb/breakpoint.h (/work/mb_mainline/4_bpstat_owner) (revision 4738)
@@ -603,7 +603,7 @@ struct bpstats
place, and a bpstat reflects the fact that both have been hit. */
bpstat next;
/* Breakpoint that we are at. */
- struct breakpoint *breakpoint_at;
+ struct bp_location *breakpoint_at;
/* Commands left to be done. */
struct command_line *commands;
/* Old value associated with a watchpoint. */
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [4/9] associate bpstat with location
2007-09-07 20:18 [4/9] associate bpstat with location Vladimir Prus
@ 2007-09-08 11:07 ` Eli Zaretskii
2007-09-08 11:25 ` Vladimir Prus
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2007-09-08 11:07 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Sat, 8 Sep 2007 00:18:24 +0400
>
> (bpstat_find_breakpoint): Look at bpstat's location's
> owner, not at bpstat->breakpoint_at.
> (bpstat_find_step_resume_breakpoint): Likewise.
> (bpstat_num): Likewise.
> (print_it_typical): Likewise.
> (print_bp_stop_message): Likewise.
> (watchpoint_check): Likewise.
> (bpstat_what): Likewise.
> (bpstat_get_triggered_catchpoints): Likewise.
> (breakpoint_auto_delete): Likewise.
> (delete_breakpoint): Likewise.
A minor stylistic point: could we please avoid the annoying
"Likewise"s? The canonical way of writing a ChangeLog entry for
several functions with an identical change is this:
(bpstat_find_breakpoint, bpstat_find_step_resume_breakpoint)
(bpstat_num, print_it_typical): Look at bpstat's location's
owner, not at bpstat->breakpoint_at.
I'm quite sure the GNU coding standards describe this. (Yes, I know
that our ChangeLog's abuse "Likewise" too much.)
> - b = (*bsp)->breakpoint_at;
> + /* We assume we'll never have several bpstats that
> + correspond to a single breakpoint -- otherwise,
> + this function might return the same number more
> + than once and this will look ugly. */
> + b = (*bsp)->breakpoint_at ? (*bsp)->breakpoint_at->owner : NULL;
Is the assumption in the comment above really valid? I happen to put
several breakpoints on the same line quite a lot (each breakpoint has
a different condition and/or different commands list).
Can we do better, even if it requires to try harder?
> case bp_access_watchpoint:
> if (bs->old_val != NULL)
> {
> - annotate_watchpoint (bs->breakpoint_at->number);
> + annotate_watchpoint (b->number);
Watchpoints also? Did you make corresponding changes in the code that
sets watchpoints?
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [4/9] associate bpstat with location
2007-09-08 11:07 ` Eli Zaretskii
@ 2007-09-08 11:25 ` Vladimir Prus
2007-09-08 12:16 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Prus @ 2007-09-08 11:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Saturday 08 September 2007 15:07:08 Eli Zaretskii wrote:
> > From: Vladimir Prus <vladimir@codesourcery.com>
> > Date: Sat, 8 Sep 2007 00:18:24 +0400
> >
> > (bpstat_find_breakpoint): Look at bpstat's location's
> > owner, not at bpstat->breakpoint_at.
> > (bpstat_find_step_resume_breakpoint): Likewise.
> > (bpstat_num): Likewise.
> > (print_it_typical): Likewise.
> > (print_bp_stop_message): Likewise.
> > (watchpoint_check): Likewise.
> > (bpstat_what): Likewise.
> > (bpstat_get_triggered_catchpoints): Likewise.
> > (breakpoint_auto_delete): Likewise.
> > (delete_breakpoint): Likewise.
>
> A minor stylistic point: could we please avoid the annoying
> "Likewise"s? The canonical way of writing a ChangeLog entry for
> several functions with an identical change is this:
>
> (bpstat_find_breakpoint, bpstat_find_step_resume_breakpoint)
> (bpstat_num, print_it_typical): Look at bpstat's location's
> owner, not at bpstat->breakpoint_at.
>
> I'm quite sure the GNU coding standards describe this. (Yes, I know
> that our ChangeLog's abuse "Likewise" too much.)
I don't have an opinion here; I don't think this has any practical
difference to future readers of ChangeLog.
> > - b = (*bsp)->breakpoint_at;
> > + /* We assume we'll never have several bpstats that
> > + correspond to a single breakpoint -- otherwise,
> > + this function might return the same number more
> > + than once and this will look ugly. */
> > + b = (*bsp)->breakpoint_at ? (*bsp)->breakpoint_at->owner : NULL;
>
> Is the assumption in the comment above really valid? I happen to put
> several breakpoints on the same line quite a lot (each breakpoint has
> a different condition and/or different commands list).
The assumption is about different case -- that you'll never had two
bpstats that both correspond to a single breakpoint. Having two breakpoints
that correspond to single line of code is different, and is not a problem.
> Can we do better, even if it requires to try harder?
The reason why the assumption is valid is because the only way to have
several bpstats refer to one breakpoint is when breakpoint has two
locations, and both locations have the same address. That makes no sense --
there's no per-location data that can make those locations different
in behaviour, and so having two locations with same address would
be a bug.
> > case bp_access_watchpoint:
> > if (bs->old_val != NULL)
> > {
> > - annotate_watchpoint (bs->breakpoint_at->number);
> > + annotate_watchpoint (b->number);
>
> Watchpoints also? Did you make corresponding changes in the code that
> sets watchpoints?
No. This patch is not supposed to have any change in behaviour whatsoever,
it merely moves a data member. For watchpoints, you need extra indirection
to get from bpstat to breakpoint number. That indirection is useful
for code breakpoints, in future patches, and has no effect on watchpoints.
- Volodya
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [4/9] associate bpstat with location
2007-09-08 11:25 ` Vladimir Prus
@ 2007-09-08 12:16 ` Eli Zaretskii
2007-09-08 14:44 ` Vladimir Prus
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2007-09-08 12:16 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Sat, 8 Sep 2007 15:24:48 +0400
> Cc: gdb-patches@sources.redhat.com
>
> > A minor stylistic point: could we please avoid the annoying
> > "Likewise"s? The canonical way of writing a ChangeLog entry for
> > several functions with an identical change is this:
> >
> > (bpstat_find_breakpoint, bpstat_find_step_resume_breakpoint)
> > (bpstat_num, print_it_typical): Look at bpstat's location's
> > owner, not at bpstat->breakpoint_at.
> >
> > I'm quite sure the GNU coding standards describe this. (Yes, I know
> > that our ChangeLog's abuse "Likewise" too much.)
>
> I don't have an opinion here; I don't think this has any practical
> difference to future readers of ChangeLog.
It matters when you grep ChangeLog's for changes in a particular
function, for example.
> The reason why the assumption is valid is because the only way to have
> several bpstats refer to one breakpoint is when breakpoint has two
> locations, and both locations have the same address. That makes no sense --
> there's no per-location data that can make those locations different
> in behaviour, and so having two locations with same address would
> be a bug.
If this can happen only as a result of a bug, perhaps a gdb_assert is
in order.
> > > case bp_access_watchpoint:
> > > if (bs->old_val != NULL)
> > > {
> > > - annotate_watchpoint (bs->breakpoint_at->number);
> > > + annotate_watchpoint (b->number);
> >
> > Watchpoints also? Did you make corresponding changes in the code that
> > sets watchpoints?
>
> No. This patch is not supposed to have any change in behaviour whatsoever,
> it merely moves a data member.
Does that mean that the display of watchpoints for "info watch" will
be now different from "info break"?
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [4/9] associate bpstat with location
2007-09-08 12:16 ` Eli Zaretskii
@ 2007-09-08 14:44 ` Vladimir Prus
2007-09-19 18:27 ` Vladimir Prus
0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Prus @ 2007-09-08 14:44 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Saturday 08 September 2007 16:15:35 Eli Zaretskii wrote:
> > The reason why the assumption is valid is because the only way to have
> > several bpstats refer to one breakpoint is when breakpoint has two
> > locations, and both locations have the same address. That makes no sense --
> > there's no per-location data that can make those locations different
> > in behaviour, and so having two locations with same address would
> > be a bug.
>
> If this can happen only as a result of a bug, perhaps a gdb_assert is
> in order.
Yes, except there's no convenient place where assert can be placed.
To assert this assumption you have to actually walk though all bpstats
and check for duplication locations, and that's too much work.
> > > > case bp_access_watchpoint:
> > > > if (bs->old_val != NULL)
> > > > {
> > > > - annotate_watchpoint (bs->breakpoint_at->number);
> > > > + annotate_watchpoint (b->number);
> > >
> > > Watchpoints also? Did you make corresponding changes in the code that
> > > sets watchpoints?
> >
> > No. This patch is not supposed to have any change in behaviour whatsoever,
> > it merely moves a data member.
>
> Does that mean that the display of watchpoints for "info watch" will
> be now different from "info break"?
*This* patch does not change input of "info break". In fact, it does not change
any observable behaviour.
As for future patches, the basically have two output changes:
1. Printing of multiple locations, if any
2. Printing of "(p)"
Neither of those output changes are applicable to watchpoints. (1) is not
applicable because watchpoints can't have multiple locations, in the same
way breakpoints do. (2) is not applicable because gdb will never try to
set bp_shlib_disabled state for a watchpoint, neither in the current code, nor
after my patches.
- Volodya
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [4/9] associate bpstat with location
2007-09-08 14:44 ` Vladimir Prus
@ 2007-09-19 18:27 ` Vladimir Prus
2007-09-19 19:17 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Prus @ 2007-09-19 18:27 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Saturday 08 September 2007 18:43:46 Vladimir Prus wrote:
> On Saturday 08 September 2007 16:15:35 Eli Zaretskii wrote:
>
> > > The reason why the assumption is valid is because the only way to have
> > > several bpstats refer to one breakpoint is when breakpoint has two
> > > locations, and both locations have the same address. That makes no sense --
> > > there's no per-location data that can make those locations different
> > > in behaviour, and so having two locations with same address would
> > > be a bug.
> >
> > If this can happen only as a result of a bug, perhaps a gdb_assert is
> > in order.
>
> Yes, except there's no convenient place where assert can be placed.
> To assert this assumption you have to actually walk though all bpstats
> and check for duplication locations, and that's too much work.
>
> > > > > case bp_access_watchpoint:
> > > > > if (bs->old_val != NULL)
> > > > > {
> > > > > - annotate_watchpoint (bs->breakpoint_at->number);
> > > > > + annotate_watchpoint (b->number);
> > > >
> > > > Watchpoints also? Did you make corresponding changes in the code that
> > > > sets watchpoints?
> > >
> > > No. This patch is not supposed to have any change in behaviour whatsoever,
> > > it merely moves a data member.
> >
> > Does that mean that the display of watchpoints for "info watch" will
> > be now different from "info break"?
>
> *This* patch does not change input of "info break". In fact, it does not change
> any observable behaviour.
>
> As for future patches, the basically have two output changes:
>
> 1. Printing of multiple locations, if any
> 2. Printing of "(p)"
>
> Neither of those output changes are applicable to watchpoints. (1) is not
> applicable because watchpoints can't have multiple locations, in the same
> way breakpoints do. (2) is not applicable because gdb will never try to
> set bp_shlib_disabled state for a watchpoint, neither in the current code, nor
> after my patches.
Eli,
are you happy with the explanations above?
- Volodya
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [4/9] associate bpstat with location
2007-09-19 18:27 ` Vladimir Prus
@ 2007-09-19 19:17 ` Eli Zaretskii
2007-09-22 17:50 ` Vladimir Prus
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2007-09-19 19:17 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Wed, 19 Sep 2007 22:27:26 +0400
> Cc: gdb-patches@sources.redhat.com
>
> Eli,
> are you happy with the explanations above?
I'm still not convinced that a gdb_assert shouldn't be added where the
``impossible'' is described in a comment, but I'm willing to let it
go.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [4/9] associate bpstat with location
2007-09-19 19:17 ` Eli Zaretskii
@ 2007-09-22 17:50 ` Vladimir Prus
0 siblings, 0 replies; 8+ messages in thread
From: Vladimir Prus @ 2007-09-22 17:50 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 543 bytes --]
On Wednesday 19 September 2007 23:16:47 Eli Zaretskii wrote:
> > From: Vladimir Prus <vladimir@codesourcery.com>
> > Date: Wed, 19 Sep 2007 22:27:26 +0400
> > Cc: gdb-patches@sources.redhat.com
> >
> > Eli,
> > are you happy with the explanations above?
>
> I'm still not convinced that a gdb_assert shouldn't be added where the
> ``impossible'' is described in a comment, but I'm willing to let it
> go.
As I've explained, there's no single place where this assert can be
conveniently placed.
I've checked in the attached.
- Volodya
[-- Attachment #2: 4.diff --]
[-- Type: text/x-diff, Size: 16365 bytes --]
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.8702
diff -u -p -r1.8702 ChangeLog
--- ChangeLog 22 Sep 2007 01:09:18 -0000 1.8702
+++ ChangeLog 22 Sep 2007 17:48:15 -0000
@@ -1,3 +1,25 @@
+2007-09-22 Vladimir Prus <vladimir@codesourcery.com>
+
+ Associate bp_stat with bp_location, not breakpoint.
+ * breakpoint.h (breakpoint_at): Change type
+ to bp_location*.
+ * breakpoint.c (bpstat_alloc): Take bp_location,
+ not breakpoint.
+ (bpstat_find_breakpoint): Look at bpstat's location's
+ owner, not at bpstat->breakpoint_at.
+ (bpstat_find_step_resume_breakpoint): Likewise.
+ (bpstat_num): Likewise.
+ (print_it_typical): Likewise.
+ (print_bp_stop_message): Likewise.
+ (watchpoint_check): Likewise.
+ (bpstat_what): Likewise.
+ (bpstat_get_triggered_catchpoints): Likewise.
+ (breakpoint_auto_delete): Likewise.
+ (delete_breakpoint): Likewise.
+ (bpstat_stop_status): Pass location, not breakpoint,
+ to bpstat_alloc. Look at bpstat's location's
+ owner, not at bpstat->breakpoint_at.
+
2007-09-21 Jim Blandy <jimb@codesourcery.com>
* macrotab.h (new_macro_table): Document that removing information
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.263
diff -u -p -r1.263 breakpoint.c
--- breakpoint.c 29 Aug 2007 22:07:47 -0000 1.263
+++ breakpoint.c 22 Sep 2007 17:48:17 -0000
@@ -109,7 +109,7 @@ static void breakpoints_info (char *, in
static void breakpoint_1 (int, int);
-static bpstat bpstat_alloc (struct breakpoint *, bpstat);
+static bpstat bpstat_alloc (struct bp_location *, bpstat);
static int breakpoint_cond_eval (void *);
@@ -1968,7 +1968,7 @@ bpstat_find_breakpoint (bpstat bsp, stru
for (; bsp != NULL; bsp = bsp->next)
{
- if (bsp->breakpoint_at == breakpoint)
+ if (bsp->breakpoint_at && bsp->breakpoint_at->owner == breakpoint)
return bsp;
}
return NULL;
@@ -1994,10 +1994,10 @@ bpstat_find_step_resume_breakpoint (bpst
for (; bsp != NULL; bsp = bsp->next)
{
if ((bsp->breakpoint_at != NULL) &&
- (bsp->breakpoint_at->type == bp_step_resume) &&
- (bsp->breakpoint_at->thread == current_thread ||
- bsp->breakpoint_at->thread == -1))
- return bsp->breakpoint_at;
+ (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."));
@@ -2021,7 +2021,11 @@ bpstat_num (bpstat *bsp, int *num)
if ((*bsp) == NULL)
return 0; /* No more breakpoint values */
- b = (*bsp)->breakpoint_at;
+ /* We assume we'll never have several bpstats that
+ correspond to a single breakpoint -- otherwise,
+ this function might return the same number more
+ than once and this will look ugly. */
+ b = (*bsp)->breakpoint_at ? (*bsp)->breakpoint_at->owner : NULL;
*bsp = (*bsp)->next;
if (b == NULL)
return -1; /* breakpoint that's been deleted since */
@@ -2152,6 +2156,7 @@ static enum print_stop_action
print_it_typical (bpstat bs)
{
struct cleanup *old_chain, *ui_out_chain;
+ struct breakpoint *b;
struct ui_stream *stb;
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
@@ -2159,21 +2164,22 @@ print_it_typical (bpstat bs)
which has since been deleted. */
if (bs->breakpoint_at == NULL)
return PRINT_UNKNOWN;
+ b = bs->breakpoint_at->owner;
- switch (bs->breakpoint_at->type)
+ switch (b->type)
{
case bp_breakpoint:
case bp_hardware_breakpoint:
- if (bs->breakpoint_at->loc->address != bs->breakpoint_at->loc->requested_address)
- breakpoint_adjustment_warning (bs->breakpoint_at->loc->requested_address,
- bs->breakpoint_at->loc->address,
- bs->breakpoint_at->number, 1);
- annotate_breakpoint (bs->breakpoint_at->number);
+ if (b->loc->address != b->loc->requested_address)
+ breakpoint_adjustment_warning (b->loc->requested_address,
+ b->loc->address,
+ b->number, 1);
+ annotate_breakpoint (b->number);
ui_out_text (uiout, "\nBreakpoint ");
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason",
async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT));
- ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
+ ui_out_field_int (uiout, "bkptno", b->number);
ui_out_text (uiout, ", ");
return PRINT_SRC_AND_LOC;
break;
@@ -2200,42 +2206,42 @@ print_it_typical (bpstat bs)
break;
case bp_catch_load:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (loaded %s), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->triggered_dll_pathname);
+ b->number,
+ b->triggered_dll_pathname);
return PRINT_SRC_AND_LOC;
break;
case bp_catch_unload:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (unloaded %s), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->triggered_dll_pathname);
+ b->number,
+ b->triggered_dll_pathname);
return PRINT_SRC_AND_LOC;
break;
case bp_catch_fork:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (forked process %d), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->forked_inferior_pid);
+ b->number,
+ b->forked_inferior_pid);
return PRINT_SRC_AND_LOC;
break;
case bp_catch_vfork:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (vforked process %d), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->forked_inferior_pid);
+ b->number,
+ b->forked_inferior_pid);
return PRINT_SRC_AND_LOC;
break;
case bp_catch_exec:
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (exec'd %s), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->exec_pathname);
+ b->number,
+ b->exec_pathname);
return PRINT_SRC_AND_LOC;
break;
@@ -2243,9 +2249,9 @@ print_it_typical (bpstat bs)
if (current_exception_event &&
(CURRENT_EXCEPTION_KIND == EX_EVENT_CATCH))
{
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (exception caught), "),
- bs->breakpoint_at->number);
+ b->number);
if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
printf_filtered (_("throw location %s:%d, "),
CURRENT_EXCEPTION_THROW_FILE,
@@ -2274,9 +2280,9 @@ print_it_typical (bpstat bs)
if (current_exception_event &&
(CURRENT_EXCEPTION_KIND == EX_EVENT_THROW))
{
- annotate_catchpoint (bs->breakpoint_at->number);
+ annotate_catchpoint (b->number);
printf_filtered (_("\nCatchpoint %d (exception thrown), "),
- bs->breakpoint_at->number);
+ b->number);
if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
printf_filtered (_("throw location %s:%d, "),
CURRENT_EXCEPTION_THROW_FILE,
@@ -2305,18 +2311,18 @@ print_it_typical (bpstat bs)
case bp_hardware_watchpoint:
if (bs->old_val != NULL)
{
- annotate_watchpoint (bs->breakpoint_at->number);
+ annotate_watchpoint (b->number);
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason",
async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER));
- mention (bs->breakpoint_at);
+ mention (b);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
ui_out_field_stream (uiout, "old", stb);
ui_out_text (uiout, "\nNew value = ");
- value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default);
+ value_print (b->val, stb->stream, 0, Val_pretty_default);
ui_out_field_stream (uiout, "new", stb);
do_cleanups (ui_out_chain);
ui_out_text (uiout, "\n");
@@ -2332,10 +2338,10 @@ print_it_typical (bpstat bs)
ui_out_field_string
(uiout, "reason",
async_reason_lookup (EXEC_ASYNC_READ_WATCHPOINT_TRIGGER));
- mention (bs->breakpoint_at);
+ mention (b);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nValue = ");
- value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default);
+ value_print (b->val, stb->stream, 0, Val_pretty_default);
ui_out_field_stream (uiout, "value", stb);
do_cleanups (ui_out_chain);
ui_out_text (uiout, "\n");
@@ -2345,12 +2351,12 @@ print_it_typical (bpstat bs)
case bp_access_watchpoint:
if (bs->old_val != NULL)
{
- annotate_watchpoint (bs->breakpoint_at->number);
+ annotate_watchpoint (b->number);
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason",
async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER));
- mention (bs->breakpoint_at);
+ mention (b);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
@@ -2361,7 +2367,7 @@ print_it_typical (bpstat bs)
}
else
{
- mention (bs->breakpoint_at);
+ mention (b);
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason",
@@ -2369,7 +2375,7 @@ print_it_typical (bpstat bs)
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nValue = ");
}
- value_print (bs->breakpoint_at->val, stb->stream, 0,Val_pretty_default);
+ value_print (b->val, stb->stream, 0,Val_pretty_default);
ui_out_field_stream (uiout, "new", stb);
do_cleanups (ui_out_chain);
ui_out_text (uiout, "\n");
@@ -2429,14 +2435,19 @@ print_bp_stop_message (bpstat bs)
break;
case print_it_normal:
- /* Normal case. Call the breakpoint's print_it method, or
- print_it_typical. */
- if (bs->breakpoint_at != NULL && bs->breakpoint_at->ops != NULL
- && bs->breakpoint_at->ops->print_it != NULL)
- return bs->breakpoint_at->ops->print_it (bs->breakpoint_at);
- else
- return print_it_typical (bs);
- break;
+ {
+ struct bp_location *bl = bs->breakpoint_at;
+ struct breakpoint *b = bl ? bl->owner : NULL;
+
+ /* Normal case. Call the breakpoint's print_it method, or
+ print_it_typical. */
+ /* FIXME: how breakpoint can ever be NULL here? */
+ if (b != NULL && b->ops != NULL && b->ops->print_it != NULL)
+ return b->ops->print_it (b);
+ else
+ return print_it_typical (bs);
+ }
+ break;
default:
internal_error (__FILE__, __LINE__,
@@ -2505,13 +2516,13 @@ breakpoint_cond_eval (void *exp)
/* Allocate a new bpstat and chain it to the current one. */
static bpstat
-bpstat_alloc (struct breakpoint *b, bpstat cbs /* Current "bs" value */ )
+bpstat_alloc (struct bp_location *bl, bpstat cbs /* Current "bs" value */ )
{
bpstat bs;
bs = (bpstat) xmalloc (sizeof (*bs));
cbs->next = bs;
- bs->breakpoint_at = b;
+ bs->breakpoint_at = bl;
/* If the condition is false, etc., don't do the commands. */
bs->commands = NULL;
bs->old_val = NULL;
@@ -2541,7 +2552,7 @@ watchpoint_check (void *p)
struct frame_info *fr;
int within_current_scope;
- b = bs->breakpoint_at;
+ b = bs->breakpoint_at->owner;
if (b->exp_valid_block == NULL)
within_current_scope = 1;
@@ -2588,7 +2599,7 @@ watchpoint_check (void *p)
we might be in the middle of evaluating a function call. */
struct value *mark = value_mark ();
- struct value *new_val = evaluate_expression (bs->breakpoint_at->exp);
+ struct value *new_val = evaluate_expression (b->exp);
if (!value_equal (b->val, new_val))
{
release_value (new_val);
@@ -2624,7 +2635,7 @@ watchpoint_check (void *p)
ui_out_field_string
(uiout, "reason", async_reason_lookup (EXEC_ASYNC_WATCHPOINT_SCOPE));
ui_out_text (uiout, "\nWatchpoint ");
- ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
+ ui_out_field_int (uiout, "wpnum", b->number);
ui_out_text (uiout, " deleted because the program has left the block in\n\
which its expression is valid.\n");
@@ -2760,7 +2771,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
/* Come here if it's a watchpoint, or if the break address matches */
- bs = bpstat_alloc (b, bs); /* Alloc a bpstat to explain stop */
+ bs = bpstat_alloc (b->loc, bs); /* Alloc a bpstat to explain stop */
/* Watchpoints may change this, if not found to have triggered. */
bs->stop = 1;
@@ -2971,9 +2982,9 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
/* The value of a hardware watchpoint hasn't changed, but the
intermediate memory locations we are watching may have. */
if (bs && !bs->stop &&
- (bs->breakpoint_at->type == bp_hardware_watchpoint ||
- bs->breakpoint_at->type == bp_read_watchpoint ||
- bs->breakpoint_at->type == bp_access_watchpoint))
+ (bs->breakpoint_at->owner->type == bp_hardware_watchpoint ||
+ bs->breakpoint_at->owner->type == bp_read_watchpoint ||
+ bs->breakpoint_at->owner->type == bp_access_watchpoint))
{
remove_breakpoints ();
insert_breakpoints ();
@@ -3134,7 +3145,7 @@ bpstat_what (bpstat bs)
/* I suspect this can happen if it was a momentary breakpoint
which has since been deleted. */
continue;
- switch (bs->breakpoint_at->type)
+ switch (bs->breakpoint_at->owner->type)
{
case bp_none:
continue;
@@ -3289,7 +3300,7 @@ bpstat_get_triggered_catchpoints (bpstat
for (; ep_list != NULL; ep_list = ep_list->next)
{
/* Is this eventpoint a catchpoint? If not, ignore it. */
- ep = ep_list->breakpoint_at;
+ ep = ep_list->breakpoint_at->owner;
if (ep == NULL)
break;
if ((ep->type != bp_catch_load) &&
@@ -3300,7 +3311,7 @@ bpstat_get_triggered_catchpoints (bpstat
continue;
/* Yes; add it to the list. */
- bs = bpstat_alloc (ep, bs);
+ bs = bpstat_alloc (ep_list->breakpoint_at, bs);
*bs = *ep_list;
bs->next = NULL;
bs = root_bs->next;
@@ -6849,9 +6860,9 @@ breakpoint_auto_delete (bpstat bs)
struct breakpoint *b, *temp;
for (; bs; bs = bs->next)
- if (bs->breakpoint_at && bs->breakpoint_at->disposition == disp_del
+ if (bs->breakpoint_at && bs->breakpoint_at->owner->disposition == disp_del
&& bs->stop)
- delete_breakpoint (bs->breakpoint_at);
+ delete_breakpoint (bs->breakpoint_at->owner);
ALL_BREAKPOINTS_SAFE (b, temp)
{
@@ -7041,7 +7052,7 @@ delete_breakpoint (struct breakpoint *bp
in event-top.c won't do anything, and temporary breakpoints
with commands won't work. */
for (bs = stop_bpstat; bs; bs = bs->next)
- if (bs->breakpoint_at == bpt)
+ if (bs->breakpoint_at && bs->breakpoint_at->owner == bpt)
{
bs->breakpoint_at = NULL;
bs->old_val = NULL;
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.47
diff -u -p -r1.47 breakpoint.h
--- breakpoint.h 23 Aug 2007 18:08:26 -0000 1.47
+++ breakpoint.h 22 Sep 2007 17:48:17 -0000
@@ -603,7 +603,7 @@ struct bpstats
place, and a bpstat reflects the fact that both have been hit. */
bpstat next;
/* Breakpoint that we are at. */
- struct breakpoint *breakpoint_at;
+ struct bp_location *breakpoint_at;
/* Commands left to be done. */
struct command_line *commands;
/* Old value associated with a watchpoint. */
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-09-22 17:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-07 20:18 [4/9] associate bpstat with location Vladimir Prus
2007-09-08 11:07 ` Eli Zaretskii
2007-09-08 11:25 ` Vladimir Prus
2007-09-08 12:16 ` Eli Zaretskii
2007-09-08 14:44 ` Vladimir Prus
2007-09-19 18:27 ` Vladimir Prus
2007-09-19 19:17 ` Eli Zaretskii
2007-09-22 17:50 ` Vladimir Prus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox