This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: dynamic scope from frame, static scope from ???
- From: Jim Blandy <jimb at redhat dot com>
- To: Andrew Cagney <cagney at gnu dot org>
- Cc: gdb at sources dot redhat dot com
- Date: 22 Nov 2003 10:04:43 -0500
- Subject: Re: dynamic scope from frame, static scope from ???
- References: <3FBF77A7.2070207@gnu.org>
Andrew Cagney <cagney@gnu.org> writes:
> GDB's slowly pushing the frame through to the procedures that need
> access to the dynamic information. However, I don't know that we've
> addressed the case where a process needs access to the static
> information? Should there be dogma (similar to "there is always a
> frame") that covers the static case?
>
> Off hand I can think of several ways of doing this:
>
> - create a static-frame (it has no dynamic state) and use that
> - pass the source-and-line or block where needed
> functions would get both sal and a possibly null frame
> - pass some new structure that includes other info such as the
> selected language (if its different to what it should be)?
I think the meaning of a static context depends on the language in
which the user is working. For C and C++, for example, a static
context needs to include a specific source line, not just a block, so
as to be able to find which macros are in scope.
Internally, at least. As far as the user interface is concerned, GDB
should try to infer the appropriate language automatically.