From: Stan Shebs <stan@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Whack some dead code
Date: Tue, 30 Mar 2010 00:25:00 -0000 [thread overview]
Message-ID: <4BB144E7.1080800@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
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.
[-- Attachment #2: deadcode-patch-1 --]
[-- Type: text/plain, Size: 1719 bytes --]
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)
{
next reply other threads:[~2010-03-30 0:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-30 0:25 Stan Shebs [this message]
2010-03-30 11:03 ` Pedro Alves
2010-03-30 17:05 ` Stan Shebs
2010-03-30 17:41 ` Pedro Alves
2010-03-30 17:44 ` Michael Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BB144E7.1080800@codesourcery.com \
--to=stan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox