From: Martin Str|mberg Subject: Re: i686-pc-msdosdjgpp-g++ problems (long) Newsgroups: comp.os.msdos.djgpp References: <1036779663 DOT 158618 AT queeg DOT ludd DOT luth DOT se> <1h6osuka51oan46817ptm2o1loq3k6fqm7 AT 4ax DOT com> <200211082039 DOT gA8Kdck00835 AT envy DOT delorie DOT com> <1036845028 DOT 195290 AT queeg DOT ludd DOT luth DOT se> User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha)) Message-ID: <1036944551.298873@queeg.ludd.luth.se> Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Date: 10 Nov 2002 16:09:11 GMT Lines: 69 NNTP-Posting-Host: queeg.ludd.luth.se X-Trace: 1036944551 news.luth.se 7337 130.240.16.109 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Charles Wilkins 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