This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC/dwarf-2] Add support for included files
- From: Jim Blandy <jimb at redhat dot com>
- To: Joel Brobecker <brobecker at gnat dot com>
- Cc: Daniel Jacobowitz <drow at mvista dot com>, Eli Zaretskii <eliz at elta dot co dot il>, gdb-patches at sources dot redhat dot com
- Date: 14 Apr 2004 14:07:17 -0500
- Subject: Re: [RFC/dwarf-2] Add support for included files
- References: <vt2d66jdbd8.fsf@zenia.home> <20040413052021.GA1173@gnat.com>
Okay, let's take it as established that the speed impact is not too
bad. Given the improved accuracy, I think it's worth taking the
chance that we'll have to revisit it.
Could you try one more thing for me?
As you noticed, the only two functions that dwarf_decode_lines calls
to actually record the information it gets are
buildsym.c:start_subfile (via dwarf2_start_subfile) and
buildsym.c:record_line. Could you change dwarf_decode_lines to take
two function pointers (with an accompanying closure pointer) for those
two functions? I guess this is an instance of the 'builder' pattern,
so maybe name it something appropriately suggestive. Let
dwarf_decode_lines continue to call dwarf2_start_subfile directly,
just passing the builder func and closure along with filename and
dirname.
Then, instead of duplicating dwarf_decode_lines, have the existing
call in read_file_scope and the new call you've added just pass
different function/closures to it.
If it's easy, re-run your speed tests to make sure this doesn't make
some mysterious difference.