ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What causes a symbol to not be "in current context"?


From: David Price
Subject: What causes a symbol to not be "in current context"?
Date: Sat, 07 Dec 2002 07:06:31 -0700
User-agent: KMail/1.4.3

Hi

I don't feel good about asking this because I am sure there is a
logical answer that is displayed on a list of FAQs somewhere, but
I get this problem frequently, and, it seems, quite inconsistently.

I am using Fortran source code and this definitely has to be part
of the problem, because I think I have only ever seen this message
when debugging Fortran (either on Solaris using Sun f77 with dbx
as the inferior debugger, or on Linux using gnu g77 with gdb).

I will build the source using -g and I am able to load the program
and see the source. I can step through instructions in the main 
program and see and/or display values contained in variables. But
as soon as I step into a subroutine, sometimes (and only sometimes)
I get this message in the debugger console:

'No symbol "<x>" in current context'

where <x> of course is the name of the variable I want to look at.

>From this point on, I am royally stuck. 

The question of course is "why?". The variable DOES exist in the 
current context (subroutine, block, whatever), and it assuredly 
does contain information I want to examine. I have found that in
the specific case of Fortran, with case sensitivity left on from a
previous C debugging session perhaps, that I get this error because
a variable name in the source file was spelled with one or more 
uppercase letters.

I have found (as a work around) that catting all my separate
modules into a single humungous file usually (but not always)
solves the problem. This seems to work fine on Solaris but not
(as I am now discovering) with 3.3.1 on Linux. Formerlly, with 
gdb on Linux, accessing the values of variables was not a 
problem even when jumping between modules, but this has never
worked when I am debugging f77 with dbx on Solaris. Now, this
morning, I have just started trying to use 3.3.1 on SuSE 8.1 on
my system at home..... and I cannot see the contents of any 
local variables in my Fortran program. This seems to be the case
whether I use separate modules or even when I cat them all into
a single file.

I feel dejected and desperate!

Any insights would be appreciated.

David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]