From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24560 invoked by alias); 30 Mar 2010 11:03:34 -0000 Received: (qmail 24484 invoked by uid 22791); 30 Mar 2010 11:03:33 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Mar 2010 11:03:29 +0000 Received: (qmail 6505 invoked from network); 30 Mar 2010 11:03:25 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Mar 2010 11:03:25 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] Whack some dead code Date: Tue, 30 Mar 2010 11:03:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: Stan Shebs References: <4BB144E7.1080800@codesourcery.com> In-Reply-To: <4BB144E7.1080800@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003301203.22533.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg01041.txt.bz2 On Tuesday 30 March 2010 01:25:11, Stan Shebs wrote: > 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. > * tracepoint.c (trace_find_line_command): Remove dead code. Errr, what does "dead" mean exactly? It's certainly exercisable, just like the comment in the code suggests: (top-gdb) help tfind line Select a trace frame by source line. Argument can be a line number (with optional source file), a function name, or '*' followed by an address. Default argument is 'the next source line that was traced'. (top-gdb) frame #0 0x00007ffff6b420a0 in memset () from /lib/libc.so.6 (top-gdb) tfind line *(long)$rip TFIND: No line number information available for address 0x7ffff6b420a0 ; -- will attempt to find by PC. Found trace frame 0, tracepoint -1 #0 0x00007ffff6b420a0 in memset () from /lib/libc.so.6 ( nevermind the "found some trace frame" bug :-) ) > 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? */ > ! } > ! } This somewhat matches "info line" (and this code seems to have been copied from there): (top-gdb) info line *(long)$rip No line number information available for address 0x7ffff6b420a0 Now, if the "-- will attempt to find by PC." fallback, or even just the the "at least let them have the symbolic address" bit aren't useful, that's another story. -- Pedro Alves