This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Handling corner case in building symbol table when "debug_line" includes compilation directory
- From: Daniel Jacobowitz <drow at false dot org>
- To: Maxim Grigoriev <maxim at tensilica dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 10 Apr 2007 17:03:46 -0400
- Subject: Re: Handling corner case in building symbol table when "debug_line" includes compilation directory
- References: <45F8A771.2060008@hq.tensilica.com> <20070315022735.GA9613@caradoc.them.org> <45F8CBDF.9090501@hq.tensilica.com>
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