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 loose compilation directory in Dwarf2 line-tables


Hi, Frederic.  Thanks for the patch!  I think you're right about how
GDB should interpret DW_AT_comp_dir and directories in the line number
information.  Some comments:

You should generally include a ChangeLog entry along with the patch;
you'll have to write it anyway, and it helps reviewers get oriented
for what they're going to see in the patch itself.

Ideally, the use of SLASH_STRING would be a separate patch, but that's
not a big deal.

When you add a new argument to dwarf2_start_subfile, you need to
adjust the comments above the file that describe what the arguments
mean.

The patch changes the logic of dwarf2_start_subfile in a circuitous
way.  If dirname and comp_dir are absolute and different, and filename
is relative, then you end up passing start_subfile two absolute paths.
 I'd rather see the code changed like this:

- Since dwarf2_start_subfile now knows about comp_dir, there's no need
to use comp_dir as a default in dwarf_decode_lines.  Just pass NULL
for dirname when the dir_index is zero.

- Then, at the top of dwarf2_start_subfile, check if dirname is
relative, and if comp_dir is available, prepend comp_dir to it.  At
this point, we know dirname is as absolute as it can be.  Then proceed
as in the original unpatched code.  (Watch out for allocation issues.)

Also, in the comments, "loose" is the opposite of "tight"; you mean "lose".


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