gdb/
Code cleanup. * breakpoint.c (bpstat_clear_actions): Remove clearing of commands_left. (command_line_is_silent): New function. (bpstat_do_actions_1): No longer use commands_left, use command_line_is_silent for commands. (bpstat_alloc): Remove clearing of commands_left. (bpstat_stop_status): Remove initialization of commands_left, use command_line_is_silent. * breakpoint.h (struct bpstats): Remove commands_left.
This commit is contained in:
parent
66c70f7d55
commit
abf85f464b
3 changed files with 33 additions and 20 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2011-08-21 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Code cleanup.
|
||||||
|
* breakpoint.c (bpstat_clear_actions): Remove clearing of commands_left.
|
||||||
|
(command_line_is_silent): New function.
|
||||||
|
(bpstat_do_actions_1): No longer use commands_left, use
|
||||||
|
command_line_is_silent for commands.
|
||||||
|
(bpstat_alloc): Remove clearing of commands_left.
|
||||||
|
(bpstat_stop_status): Remove initialization of commands_left, use
|
||||||
|
command_line_is_silent.
|
||||||
|
* breakpoint.h (struct bpstats): Remove commands_left.
|
||||||
|
|
||||||
2011-08-18 Keith Seitz <keiths@redhat.com>
|
2011-08-18 Keith Seitz <keiths@redhat.com>
|
||||||
|
|
||||||
PR c++/12266
|
PR c++/12266
|
||||||
|
|
|
@ -3194,7 +3194,7 @@ bpstat_clear_actions (bpstat bs)
|
||||||
for (; bs != NULL; bs = bs->next)
|
for (; bs != NULL; bs = bs->next)
|
||||||
{
|
{
|
||||||
decref_counted_command_line (&bs->commands);
|
decref_counted_command_line (&bs->commands);
|
||||||
bs->commands_left = NULL;
|
|
||||||
if (bs->old_val != NULL)
|
if (bs->old_val != NULL)
|
||||||
{
|
{
|
||||||
value_free (bs->old_val);
|
value_free (bs->old_val);
|
||||||
|
@ -3231,6 +3231,16 @@ cleanup_executing_breakpoints (void *ignore)
|
||||||
executing_breakpoint_commands = 0;
|
executing_breakpoint_commands = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return non-zero iff CMD as the first line of a command sequence is `silent'
|
||||||
|
or its equivalent. */
|
||||||
|
|
||||||
|
static int
|
||||||
|
command_line_is_silent (struct command_line *cmd)
|
||||||
|
{
|
||||||
|
return cmd && (strcmp ("silent", cmd->line) == 0
|
||||||
|
|| (xdb_commands && strcmp ("Q", cmd->line) == 0));
|
||||||
|
}
|
||||||
|
|
||||||
/* Execute all the commands associated with all the breakpoints at
|
/* Execute all the commands associated with all the breakpoints at
|
||||||
this location. Any of these commands could cause the process to
|
this location. Any of these commands could cause the process to
|
||||||
proceed beyond this point, etc. We look out for such changes by
|
proceed beyond this point, etc. We look out for such changes by
|
||||||
|
@ -3279,10 +3289,13 @@ bpstat_do_actions_1 (bpstat *bsp)
|
||||||
the tree when we're done. */
|
the tree when we're done. */
|
||||||
ccmd = bs->commands;
|
ccmd = bs->commands;
|
||||||
bs->commands = NULL;
|
bs->commands = NULL;
|
||||||
this_cmd_tree_chain
|
this_cmd_tree_chain = make_cleanup_decref_counted_command_line (&ccmd);
|
||||||
= make_cleanup_decref_counted_command_line (&ccmd);
|
cmd = ccmd ? ccmd->commands : NULL;
|
||||||
cmd = bs->commands_left;
|
if (command_line_is_silent (cmd))
|
||||||
bs->commands_left = NULL;
|
{
|
||||||
|
/* The action has been already done by bpstat_stop_status. */
|
||||||
|
cmd = cmd->next;
|
||||||
|
}
|
||||||
|
|
||||||
while (cmd != NULL)
|
while (cmd != NULL)
|
||||||
{
|
{
|
||||||
|
@ -3474,7 +3487,6 @@ bpstat_alloc (struct bp_location *bl, bpstat **bs_link_pointer)
|
||||||
incref_bp_location (bl);
|
incref_bp_location (bl);
|
||||||
/* If the condition is false, etc., don't do the commands. */
|
/* If the condition is false, etc., don't do the commands. */
|
||||||
bs->commands = NULL;
|
bs->commands = NULL;
|
||||||
bs->commands_left = NULL;
|
|
||||||
bs->old_val = NULL;
|
bs->old_val = NULL;
|
||||||
bs->print_it = print_it_normal;
|
bs->print_it = print_it_normal;
|
||||||
return bs;
|
return bs;
|
||||||
|
@ -4151,16 +4163,9 @@ bpstat_stop_status (struct address_space *aspace,
|
||||||
bs->print = 0;
|
bs->print = 0;
|
||||||
bs->commands = b->commands;
|
bs->commands = b->commands;
|
||||||
incref_counted_command_line (bs->commands);
|
incref_counted_command_line (bs->commands);
|
||||||
bs->commands_left = bs->commands ? bs->commands->commands : NULL;
|
if (command_line_is_silent (bs->commands
|
||||||
if (bs->commands_left
|
? bs->commands->commands : NULL))
|
||||||
&& (strcmp ("silent", bs->commands_left->line) == 0
|
bs->print = 0;
|
||||||
|| (xdb_commands
|
|
||||||
&& strcmp ("Q",
|
|
||||||
bs->commands_left->line) == 0)))
|
|
||||||
{
|
|
||||||
bs->commands_left = bs->commands_left->next;
|
|
||||||
bs->print = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print nothing for this entry if we don't stop or don't print. */
|
/* Print nothing for this entry if we don't stop or don't print. */
|
||||||
|
|
|
@ -950,10 +950,6 @@ struct bpstats
|
||||||
/* The associated command list. */
|
/* The associated command list. */
|
||||||
struct counted_command_line *commands;
|
struct counted_command_line *commands;
|
||||||
|
|
||||||
/* Commands left to be done. This points somewhere in
|
|
||||||
base_command. */
|
|
||||||
struct command_line *commands_left;
|
|
||||||
|
|
||||||
/* Old value associated with a watchpoint. */
|
/* Old value associated with a watchpoint. */
|
||||||
struct value *old_val;
|
struct value *old_val;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue