This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: tracepoint implementation question
On 3/20/06, Der Herr Hofrat <der.herr@hofr.at> wrote:
> Frist - thanks for the clarification - it would have taken me quite some time
> to figure that out.
> Second - the file is on the web at: http://dslab.lzu.edu.cn/hello.readelf
Okay, here's the entry for 'someint':
<2><1ae9>: Abbrev Number: 32 (DW_TAG_formal_parameter)
DW_AT_name : someint
DW_AT_decl_file : 1
DW_AT_decl_line : 6
DW_AT_type : <1b0b>
DW_AT_location : 2 byte block: 91 8 (DW_OP_fbreg: 8)
(Quick DWARF intro: the info is a tree; the first number in <angle
brackets> at the top is the nesting level, so each <2> is the child of
the most recent preceding <1>, etc. The <1ae9> is the offset of this
entry in the debug data; entries point to others by their offset. So
if you find the entry at <1b0b>, you'll find someint's type.)
DW_AT_location describes the variable's location, and it is using a
DWARF expression, as I guessed. That's why the tracepoint code
dosen't know what to do with it. It's a pretty simple expression,
though, and one that the existing dwarf2_tracepoint_var_ref code would
handle.
> If I write up thos functions (no idea yet how hard that will be and if I can
> actually do it), what would be the procedure to get these changes into GDB ?
> The tracepoint implementation I should do is intended for release under GPL
> so I would like to get it clean from the start.
The file gdb/CONTRIBUTE explains how to contribute to GDB. The only
thing I'd add is that it's best to work against the current GDB
sources: http://sourceware.org/gdb/current/
I've also been finding quilt really handy for breaking a large patch
into small, separable units: http://savannah.nongnu.org/projects/quilt