🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Krishanu Debnath Tue, 15 Feb 2005 15:08
problem with gdb
#1250
Author: Krishanu Debnath
Date: Tue, 15 Feb 2005 15:08
57 lines
3677 bytes
Hello,

Following gdb session will help to illustrate my problem.

breakpoint 1, vrtDecompileDeclUsedinExpr(VreElabRoot*, VrlDecl*,
std::basic_ostringstream<char, std::char_traits<char>,
std::allocator<char> >&, eExprTrUtilToken*) (pElabRoot=0x8202118,
pDecl=0x81fc948, buffer=@0xbfffd730,
pUtilToken=0x81f9158) at src/VrtVeraDecompileExpr.cxx:177
177 VrlEventDecl *pEventDecl = (VrlEventDecl *)pDecl;
(gdb) p *pDecl
$1 = {<VrlBase> = {<VrlMemBase> = {_vptr.VrlMemBase = 0x81a7500,
eObjType = VRL_EVENTDECL}, pScope = 0x81fc758, nLineNumber = 4},
sDeclName = 0x81fc970 "clk", pWhenScope = 0x0}
(gdb) p *(VrlEventDecl *)pDecl
A parse error in expression, near `)pDecl'.
(gdb)


VrlEventDecl is derived class of VrlDecl. VrlDecl *pDecl actually points
to a
VrlEventDecl* object. I am quite surprised to see the error in second print.

I know gdb supports this syntax because it works with a small similar
testcase.

Also i didn't understand the reason of the following behaviour.

(gdb) p pDecl->decompile()

Program received signal SIGSEGV, Segmentation fault.
sentry (this=0xbfffd47c, __os=@0x4)
at
/usr/src/build/146482-i386/BUILD/gcc-3.2-20020903/obj-i386-redhat-linux/i386-redhat-linux/libstdc++-v3/include/bits/basic_ios.h:99
99
/usr/src/build/146482-i386/BUILD/gcc-3.2-20020903/obj-i386-redhat-linux/i386-redhat-linux/libstdc++-v3/include/bits/basic_ios.h:
No such file or directory.
in
/usr/src/build/146482-i386/BUILD/gcc-3.2-20020903/obj-i386-redhat-linux/i386-redhat-linux/libstdc++-v3/include/bits/basic_ios.h
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function
(VrlEventDecl::decompile(std::ostream&, unsigned) const) will be abandoned.
(gdb)

decompile is declared as ..

// virtual routine
VOID decompile(ostream &buffer = cout, UINT nIndents = 0) const = 0;


I am using gdb 5.3 and gcc 3.2 . Can anyone help?


Thanks
Krishanu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads