Mail Archives: djgpp/2002/11/10/11:15:04
Charles Wilkins <chas AT pcscs DOT com> wrote:
: -========================-
: Gdb stuff:
: -========================-
: Here is the output of using gdb on welcome.exe
: compiled with djgpp-g++ -g welcome.cpp -o welcome.exe
: gdb welcome.exe
: (gdb) list
: 1 welcome.cpp: No such file or directory (ENOENT).
: in welcome.cpp
: (gdb)
: (gdb) run
: Starting program: c:/Archives/RIP2/DJGPP/bin/welcome.exe
: Program received signal SIGSEGV, Segmentation fault.
: 0x0001f47f in std::ostream::sentry::sentry(std::ostream&) ()
: (gdb)
: not exactly a productive gdb session...
: any suggestions to get more information?
: Here is the output of using gdb on welcome.exe (no -g)
: compiled with djgpp-g++ welcome.cpp -o welcome.exe
: (gdb) list
: 1 globals.cc: No such file or directory (ENOENT).
: in globals.cc
: (gdb)
: (gdb) run
: Starting program: c:/Archives/RIP2/DJGPP/bin/welcome.exe
: Program received signal SIGSEGV, Segmentation fault.
: 0x0001f47f in std::ostream::sentry::sentry(std::ostream&) ()
: (gdb)
Ok. Now do "br 0x0001f47f" or "br *0x0001f47f" (I forget the exact
syntax) and "run". Now you should stop just before the crash. Examine
the registers and figure out what's wrong. Do "disass 0x0001f47f" or
"disass *0x0001f47f" to see the exact machine instruction that
crashes. ("objdump -d welcome.exe should be able to do that as well.)
Get the C++ file that contains that
std::ostream::sentry::sentry(std::ostream&) () and add it to the
compile line after welcome.cpp. Now you might get the source
displayed.
: Note that globals.cc is a source file in the libstdc++-v3 source tree.
: The very first include directive in this file is #include
: "bits/c++config.h" Notice the c++ in the name. Unlike the DOS
: releases of DJGPP where this same file would be "bits/cxxconfig.h"
It's usually no good to "list" anything until having "run" and
stopping on a break point. Just because what runs first is startup
code which usually hasn't been compiled with debug information. Its
source code isn't available anyway if you don't make it available in
some way. That's what that adding on compile line and copying is
supposed to try to do.
Are your testings done in plain DOZE?
Right,
MartinS
- Raw text -