This is the mail archive of the gdb-patches@sourceware.org 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: [RFC] Don't lose compilation directory in Dwarf2 line-tables


On Tue, Apr 18, 2006 at 02:32:09PM +0200, Frederic RISS wrote:
> All this file matching seems quite fragile, and the current approach
> will get it wrong sometimes. Shouldn't the loop in dwarf2_start_subfile
> be killed in favor of a search using both xfullpath(dirname'/'filename)
> at the start of buildsym.c::start_subfile?

The problem with using xfullpath is that it requires the file to exist
and already be found; as long as we are consistent, it's not too
fragile, because we're checking against our own output.

> @@ -6757,6 +6756,19 @@ dwarf2_start_subfile (char *filename, ch
>  	}
>        xfree (fullname);
>      }
> +
> +  /* Make the dirname as absolute as possible. */

Two spaces after periods please.

> +
> +  if (dirname == NULL)
> +    dirname = comp_dir;
> +  else
> +    if (!IS_ABSOLUTE_PATH (dirname) && comp_dir != NULL)
> +      {
> +	dirname = concat (comp_dir, SLASH_STRING, dirname, (char *)NULL);
> +	/* do_cleanups is called after line info procesing */
> +	make_cleanup (xfree, dirname);

Comment formatting again (and "processing").  But this is really nasty. 
Why not free it before we return?  We don't return dirname, and
start_subfile takes a copy.

-- 
Daniel Jacobowitz
CodeSourcery


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