Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Whack some dead code
@ 2010-03-30  0:25 Stan Shebs
  2010-03-30 11:03 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Stan Shebs @ 2010-03-30  0:25 UTC (permalink / raw)
  To: gdb-patches

[-- 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)
    	{

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-30 17:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-30  0:25 [PATCH] Whack some dead code Stan Shebs
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox