This is the mail archive of the gdb@sources.redhat.com 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]

gdb can't access some symbols


gdb seems not to recognize some symbols (function names) even when it is
within the function.  There is some indication it might be using stale
data, but I don't know where it would get it.  Can anyone explain what's
going on or help me to diagnose the problem?

The function is a method on a C++ class.
gdb 6.3-5
gcc 3.3.5-12 (build flags include  -g -O0)
Linux kernel 2.4.27, Debian testing system
AMD AthlonMP chip

find reports only one Specification.o in the whole tree I use.
$ nm debugTest/Specification.o | grep evaluate | c++filt
00000312 t global constructors keyed to
_ZNK6mspath13Specification8evaluateERNS_11EnvironmentE
00000000 T mspath::Specification::evaluate(mspath::Environment&) const

However, when in gdb, if I type
b mspath::Specification::eval
and try for completions, I see
mspath::Specification::eval_expr
mspath::Specification::eval_expr_multdiv
mspath::Specification::eval_expr_val
mspath::Specification::eval_if
mspath::Specification::evaluateHistoryComputers
mspath::Specification::evaluateHistoryComputers()

even when I'm tracing inside the function:
(gdb) s
mspath::Specification::evaluate (this=0x80afb08, theEnv=@0xbfffefa0)
    at mspath.web:6226
(so in this context gdb does know the symbols; it doesn't when I try to
set a breakpoint).

Here are failures to find the symbol:
(gdb) b mspath::Specification::evaluate(mspath::Environment&)
Function "mspath::Specification::evaluate(mspath::Environment&)" not
defined.
(gdb) b mspath::Specification::evaluate(mspath::Environment&) const
Function "mspath::Specification::evaluate(mspath::Environment&)" not
defined.
(gdb) b const mspath::Double2D&
mspath::Specification::evaluate(mspath::Environment&) const
Function "const mspath::Double2D&
mspath::Specification::evaluate(mspath::Environment&)" not defined.
(sorry about the line breaks)

Some other possibly relevant info:

Suspiciously, there is no evaluateHistoryComputers() function (mentioned
in the completion list), though I think there used to be.

I mostly use gdb mode in emacs, but a spot check running in a terminal
produced the same behavior.

The function I'm looking for is public, declared
	const Double2D& evaluate(Environment& theEnv) const;
within the Specification class in the mspath namespace.

The .o file comes from a .cc file, which in turn is generated from the
mspath.web mentioned in the trace.  The .cc file uses extensive #line
directives to report lines in the original mspath.web file.

I use the dir directive to pick up various files; as noted, only one
directory (the same one as the executable) has the Specification.o file.

-- 
Ross Boylan                                      wk:  (415) 502-4031
530 Parnassus Avenue (Library) rm 115-4          ross@biostat.ucsf.edu
Dept of Epidemiology and Biostatistics           fax: (415) 476-9856
University of California, San Francisco
San Francisco, CA 94143-0840                     hm:  (415) 550-1062


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