This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/commit/dwarf] Create partial symbols for nested subprograms
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Daniel> Not that I see any useful way around it, if subprograms really
Daniel> can be children of lexical blocks.
Tom> Can we do it only for languages where we know this can occur?
Tom> IOW, Ada?
Joel> That's what I was going to propose, but I wanted to do some measurement
Joel> too (tomorrow). Nested subprograms are possible in C, and aren't they
Joel> also available in C++? I don't mind supporting this only in Ada, though.
GNU C has nested functions. Standard C does not. I wrote a simple
test case and compiled it with GCC. The resulting DWARF (I appended a
snippet) does not nest functions here .. but perhaps this is a bug in
GCC, I couldn't say.
I don't know the situation with C++.
Tom
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
< c> DW_AT_stmt_list : 0
<10> DW_AT_high_pc : 0x17
<14> DW_AT_low_pc : 0
<18> DW_AT_producer : GNU C 4.1.2 20070925 (Red Hat 4.1.2-33)
<40> DW_AT_language : 1 (ANSI C)
<41> DW_AT_name : q.c
<45> DW_AT_comp_dir : /tmp
<1><4a>: Abbrev Number: 2 (DW_TAG_subprogram)
<4b> DW_AT_sibling : <84>
<4f> DW_AT_external : 1
<50> DW_AT_name : outer
<56> DW_AT_decl_file : 1
<57> DW_AT_decl_line : 2
<58> DW_AT_prototyped : 1
<59> DW_AT_type : <84>
<5d> DW_AT_low_pc : 0
<61> DW_AT_high_pc : 0xd
<65> DW_AT_frame_base : 0 (location list)
<2><69>: Abbrev Number: 3 (DW_TAG_subprogram)
<6a> DW_AT_name : inner
<70> DW_AT_decl_file : 1
<71> DW_AT_decl_line : 3
<72> DW_AT_prototyped : 1
<73> DW_AT_type : <84>
<77> DW_AT_low_pc : 0xd
<7b> DW_AT_high_pc : 0x17
<7f> DW_AT_frame_base : 0x2c (location list)