From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18264 invoked by alias); 3 Aug 2007 01:14:53 -0000 Received: (qmail 18256 invoked by uid 22791); 3 Aug 2007 01:14:52 -0000 X-Spam-Check-By: sourceware.org Received: from b.mail.sonic.net (HELO b.mail.sonic.net) (64.142.19.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 01:14:47 +0000 Received: from webmail.sonic.net (b.webmail.sonic.net [64.142.100.148]) by b.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id l731EjDT001587 for ; Thu, 2 Aug 2007 18:14:45 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Thu, 2 Aug 2007 18:14:44 -0700 (PDT) Message-ID: <10431.12.7.175.2.1186103684.squirrel@webmail.sonic.net> Date: Fri, 03 Aug 2007 01:14:00 -0000 Subject: [PATCH] symfile.c, find_separate_debug_file From: msnyder@sonic.net To: gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070802181444_68020" 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: 2007-08/txt/msg00028.txt.bz2 ------=_20070802181444_68020 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 227 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. ------=_20070802181444_68020 Content-Type: text/plain; name="debug-file-dir.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="debug-file-dir.txt" Content-length: 996 2007-08-02 Michael Snyder * 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); ------=_20070802181444_68020--