From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22389 invoked by alias); 26 Sep 2002 05:00:56 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 22355 invoked from network); 26 Sep 2002 05:00:55 -0000 Received: from unknown (HELO is.elta.co.il) (199.203.121.2) by sources.redhat.com with SMTP; 26 Sep 2002 05:00:55 -0000 Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id GAA13068; Thu, 26 Sep 2002 06:58:01 +0200 (IST) Date: Wed, 25 Sep 2002 22:00:00 -0000 From: Eli Zaretskii X-Sender: eliz@is To: Alexander Larsson cc: Elena Zannoni , gdb@sources.redhat.com, Jim Blandy Subject: Re: External debug symbols In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-09/txt/msg00422.txt.bz2 On Wed, 25 Sep 2002, Alexander Larsson wrote: > Oh, I missed a place where I should be using IS_DIR_SEPARATOR, new patch > attached. See a couple of comments below. > Still, I just hardcode / when i want to add directory > separators, but this seems to be common in gdb. That's okay in general, since DOS/Windows filesystems support forward slashes as well as backslashes. + fd = open (name, O_RDONLY); + if (fd < 0) + return 0; This `open' call should use a binary mode (O_BINARY or'ed with O_RDONLY). + /* Strip off filename part */ + for (i = strlen(dir) - 1; i >= 0; i--) + { + if (IS_DIR_SEPARATOR (dir[i])) + break; + } + dir[i+1] = '\0'; This will fail for file names such as "d:foo.c", but I'm not sure this case is worth pursuing. + debug_file_search_path = xstrdup (DEBUGDIR); + c = add_set_cmd ("debug-file-search-path", class_support, var_string, + (char *) &debug_file_search_path, + "Set the search path for loading separate debug symbols.\n" + "Separate debug symbols are first searched for in the same\n" + "directory as the binary, then in the .debug subdirectory,\n" + "and lastly at the path of the directory of the binary with\n" + "the global debug-file search path prepended\n", + &setlist); Isn't the use of ``search-path'' here confusing? The variable holds a name of a single directory, not a colon-separated list of directories, right? If so, shouldn't we call it ``debug-file-directory'' or some such? Finally, this new feature should be documented in the manual. (Sorry if you already posted the patch for that and I forgot.)