[RFC] Don't loose compilation directory in Dwarf2 line-tables

Jason Molenda jason-swarelist@molenda.com
Thu Apr 13 19:58:00 GMT 2006


Frederic,

For what it's worth, I fixed the same bug yesterday.  Our changes
are similar - in dwarf2_start_subfile I used this code at the end
of the function:

  /* APPLE LOCAL: If FILENAME isn't an absolute path and DIRNAME is either
     NULL or a relative path, prepend COMP_DIR on there to get an absolute
     path.  */

  if (!IS_ABSOLUTE_PATH (filename) && dirname == NULL)
    dirname = comp_dir;
  else 
    if (!IS_ABSOLUTE_PATH (filename) && !IS_ABSOLUTE_PATH (dirname))
      {
        dirname = concat (comp_dir, SLASH_STRING, dirname, (char *) NULL);
        make_cleanup (xfree, dirname);
      }
  start_subfile (filename, dirname);
  do_cleanups (clean);


(with 'cleanup' initialized to a null_cleanup at the top of the file,
naturally.)

J



More information about the Gdb-patches mailing list