This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: External debug symbols


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.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]