[Core] [RFA/DWARF2] Handle nested subprograms in CU pc bound calculation

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Oct 1 10:30:07 CEST 2008

On 01 Oct 2008, at 09:42, Pierre Muller wrote:

> De : Joel Brobecker [mailto:brobecker at adacore.com]
>> 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?
>  I believe that, at least with the Free Pascal compiler and
> stabs debugging format (which is the format I worked on), all
> nested subprograms where also in the global context and thus
> I would not mind to do the same for pascal language.
>  I must confess that I stopped working for the Free Pascal compiler
> more or less when the dwarf debugging format was added, and I almost  
> don't
> know
> anything about that format...
>  The only thing that I can tell, is that last time I checked
> Free Pascal (version 2.2.0 windows 32bit target) with -gw (dwarf  
> debugging
> format)
> I still got lots of errors while trying to load the compiler inside  
> gdb :(

At least under Mac OS X, FPC with dwarf works fairly well. I believe  
it works ok under Linux too. I don't know about win32.

>  I must confess that I don't even know if the full specification
> would work for pascal in case the same name is used globally and as
> a nested procedure (I do know that you are allowed
> to reuse a name defined globally as a local procedure, function or  
> variable
> inside a function, but I don't know if the
> (gdb) break GlobalFuntion.LocalFunction
> would work)

It doesn't work with FPC and stabs under 6.6-45.fc8rh at least  
(neither when using only upper case nor when using the casing as it  
appears in the source code). Was support for this only added in a  
later gdb version?


More information about the Gpc mailing list