This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/3] Remove dead code for dprintf.
Hi,
For a given dprintf B, B->commands can never be null, so the condition
below is always false. This patch is to remove it as sort of dead
code.
When creating a dprintf B, the following call chain can be found
unconditionally,
init_breakpoint_sal
--> update_dprintf_command_list (because B->extra_string can't be null)
--> breakpoint_set_commands (because PRINT_LINE can't be null)
--> set B->commands.
gdb:
2012-12-12 Yao Qi <yao@codesourcery.com>
* breakpoint.c (print_one_breakpoint_location): Remove dead code.
---
gdb/breakpoint.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index e1da50b..65bdc2c 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6091,15 +6091,6 @@ print_one_breakpoint_location (struct breakpoint *b,
ui_out_text (uiout, " bytes\n");
}
}
-
- if (!part_of_multiple && b->extra_string
- && b->type == bp_dprintf && !b->commands)
- {
- annotate_field (7);
- ui_out_text (uiout, "\t(agent printf) ");
- ui_out_field_string (uiout, "printf", b->extra_string);
- ui_out_text (uiout, "\n");
- }
l = b->commands ? b->commands->commands : NULL;
if (!part_of_multiple && l)
--
1.7.7.6