This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Whack some dead code
- From: Stan Shebs <stan at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 29 Mar 2010 17:25:11 -0700
- Subject: [PATCH] Whack some dead code
A while back, Vladimir Prus noticed a chunk of dead code in
trace_find_line_command; basically, if you don't have symbolic info,
there is no plausible fallback for line numbers, you just have to give
up. Committed to trunk.
Stan
2010-03-29 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_find_line_command): Remove dead code.
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -p -r1.163 -r1.164
*** tracepoint.c 29 Mar 2010 23:45:06 -0000 1.163
--- tracepoint.c 30 Mar 2010 00:19:43 -0000 1.164
*************** trace_find_line_command (char *args, int
*** 2043,2075 ****
sals.sals[0] = sal;
}
else
! {
sals = decode_line_spec (args, 1);
sal = sals.sals[0];
}
old_chain = make_cleanup (xfree, sals.sals);
if (sal.symtab == 0)
! {
! printf_filtered ("TFIND: No line number information available");
! if (sal.pc != 0)
! {
! /* This is useful for "info line *0x7f34". If we can't
! tell the user about a source line, at least let them
! have the symbolic address. */
! printf_filtered (" for address ");
! wrap_here (" ");
! print_address (get_current_arch (), sal.pc, gdb_stdout);
! printf_filtered (";\n -- will attempt to find by PC. \n");
! }
! else
! {
! printf_filtered (".\n");
! return; /* No line, no PC; what can we do? */
! }
! }
! else if (sal.line > 0
! && find_line_pc_range (sal, &start_pc, &end_pc))
{
if (start_pc == end_pc)
{
--- 2043,2058 ----
sals.sals[0] = sal;
}
else
! {
sals = decode_line_spec (args, 1);
sal = sals.sals[0];
}
old_chain = make_cleanup (xfree, sals.sals);
if (sal.symtab == 0)
! error (_("No line number information available."));
!
! if (sal.line > 0 && find_line_pc_range (sal, &start_pc, &end_pc))
{
if (start_pc == end_pc)
{