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: Handling corner case in building symbol table when "debug_line" includes compilation directory


On Wed, Mar 14, 2007 at 09:30:23PM -0700, Maxim Grigoriev wrote:
> I've attached the patch separately. Now, it should be fine. Sorry for 
> inconvenience.

Actually, I apologize - looks like it was my mailer to blame...

> So the compilation directory is listed in the directory table. And, there is
> a reference from the file table pointing to this directory.
> 
> Normally, we wouldn't see a compilation directory in a line table prologue.

Right.  Now I understand.

This stuff is all quite fragile; we don't keep good track of what
dirname is which.  I think I puzzled it out, but...

> +      char *subfile_name;
> +      if (IS_ABSOLUTE_PATH(name) && !IS_ABSOLUTE_PATH (subfile->name))
> +	{
> +	  subfile_name = concat (dirname, SLASH_STRING,
> +				 subfile->name, (char *)NULL);

Isn't that the wrong DIRNAME?  That's supposed to be a prefix to NAME,
but SUBFILE might be in a different directory.  You need
subfile->dirname (if it's not NULL).

As for the patch, watch out for your formatting.  Spaces around
parentheses and you don't need braces around a single statement.
Also, creating a cleanup in a function that doesn't call do_cleanups
is bad.  It would be better to free it immediately when we're done
with it.

-- 
Daniel Jacobowitz
CodeSourcery


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