Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] symfile.c, find_separate_debug_file
@ 2007-08-03  1:14 msnyder
  2007-08-03  1:30 ` Daniel Jacobowitz
  2007-08-03  5:54 ` Mark Kettenis
  0 siblings, 2 replies; 16+ messages in thread
From: msnyder @ 2007-08-03  1:14 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 227 bytes --]

Just for a change, here's one that was not inspired by Coverity.

Find separate debug file does not work in the case where the path
lies in the global debug file directory -- because we stick an extra
slash into the pathname.


[-- Attachment #2: debug-file-dir.txt --]
[-- Type: text/plain, Size: 996 bytes --]

2007-08-02  Michael Snyder  <msnyder@access-company.com>

	* symfile.c (find_separate_debug_file): While consing up a path, 
	don't stick in an extra DIR_SEPARATOR.

Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.189
diff -p -r1.189 symfile.c
*** symfile.c	31 Jul 2007 21:42:19 -0000	1.189
--- symfile.c	3 Aug 2007 01:10:42 -0000
*************** find_separate_debug_file (struct objfile
*** 1355,1361 ****
  
    /* Then try in the global debugfile directory.  */
    strcpy (debugfile, debug_file_directory);
!   strcat (debugfile, "/");
    strcat (debugfile, dir);
    strcat (debugfile, basename);
  
--- 1355,1364 ----
  
    /* Then try in the global debugfile directory.  */
    strcpy (debugfile, debug_file_directory);
! 
!   if (debugfile[strlen (debugfile) - 1] != '/' && dir[0] != '/')
!     strcat (debugfile, "/");
! 
    strcat (debugfile, dir);
    strcat (debugfile, basename);
  

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

end of thread, other threads:[~2007-08-03 17:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-03  1:14 [PATCH] symfile.c, find_separate_debug_file msnyder
2007-08-03  1:30 ` Daniel Jacobowitz
2007-08-03  4:41   ` Michael Snyder
2007-08-03 11:40     ` Daniel Jacobowitz
2007-08-03 14:47       ` Michael Snyder
2007-08-03 15:00         ` Daniel Jacobowitz
2007-08-03 15:09           ` Michael Snyder
2007-08-03 15:19             ` Daniel Jacobowitz
2007-08-03 15:49           ` Andreas Schwab
2007-08-03 12:31     ` Eli Zaretskii
2007-08-03 14:43       ` Michael Snyder
2007-08-03 14:51         ` Daniel Jacobowitz
2007-08-03 17:12         ` Eli Zaretskii
2007-08-03 17:26           ` Michael Snyder
2007-08-03  5:54 ` Mark Kettenis
2007-08-03  7:15   ` Michael Snyder

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