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: [RFA/DWARF2] Handle nested subprograms in CU pc bound calculation


> > Actually, now that I think of it, a slightly cleaner approach would
> > probably be to extend the language vector to add a flag set to non-zero
> > for the languages that want nested-subprogram handling.  The only slight
> > issue is that the CU references the language enum, which means we need
> > to go from that enum to the language_defn to get access to the flag.
> 
> I think you should stick with a language test in the DWARF reader.

OK. Would the following kind of patch be what you have in mind?
Or would you prefer that the function simply take a language,
rather than a CU. Or actually no function at all?

2008-09-30  Joel Brobecker  <brobecker@adacore.com>

        * dwarf2read.c (dwarf2_handle_nested_subprograms_p): New function.
        (add_partial_subprogram): Replace check of Ada language by call
        to dwarf2_handle_nested_subprograms_p.
        (dwarf2_get_subprogram_pc_bounds, load_partial_dies): Likewise.

This is only just for comments, as there is still one question open:
For Ada, we store the symbols for nested subprograms in the global
context.  This allows us to break on these functions even when these
functions are not defined in the current context.  Do we want to do
the same with Pascal? Right now, I left this functionality out...
In Ada, we have found it to be extremely convenient to not have to
be inside the enclosing function before we can insert the breakpoint.
When there are ambiguities (say two functions have a nested subprogram
with the same name), the ambiguity can be resolved using the fully
qualified name.

Tested on x86-linux, no regression (but I don't have a Pascal compiler).

-- 
Joel

Attachment: pascal-nested.diff
Description: Text document


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