Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Debugger problem
Debugger problem [message #704399] Thu, 28 July 2011 15:28 Go to next message
dd  is currently offline dd Friend
Messages: 4
Registered: July 2011
Junior Member
Hey all,

I'm having an issue getting the debugger to work.

Running:

Red Hat Enterprise Linux ES release 4
gdb version 7.2
Eclipse Helios SR 2, 20110218-0911

Error message:

Error in final launch sequence
Failed to execute MI command:
-break-insert -t myDemo
Error message from debugger back end:
"myDemo" is not a function
"myDemo" is not a function

myDemo is actually the class/constructor name. If I delete all break points and try it again, I still get this error.

The program implements the VTP(virtual terrain project) code. We have this working in a windows environment in Visual Studio 2005, but need to get this working under Linux for various reasons.

Any suggestions would be much appreciated! Thanks! -Edd
Re: Debugger problem [message #704413 is a reply to message #704399] Thu, 28 July 2011 15:47 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
I assume that for the "Stop on startup" option your replaced "main" with "myDemo". Is there a method called "myDemo"? GDB is trying to set a breakpoint at that method but it can't.

Marc
Re: Debugger problem [message #704442 is a reply to message #704413] Thu, 28 July 2011 16:23 Go to previous messageGo to next message
dd  is currently offline dd Friend
Messages: 4
Registered: July 2011
Junior Member
Thanks for the reply.

Yes, the "stop on startup" option was altered. The "myDemo" constructor will get called during normal program startup (although its not exactly a "main" replacement) since it is for a global application object. Un-checking the option seems to make the program start, but it hits a Segmentation fault right away.

The Disassembly window has a list of 0x0 to 0x13 filled in with "Cannot access memory at address 0x0, 0x1...0x13". Is the the debugger saying that it (more accurately, I) cannot determine where to actually start the executable?
Re: Debugger problem [message #704491 is a reply to message #704442] Thu, 28 July 2011 17:35 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
The Disassembly view is filled with GDB actually disassembles of the running program. If the program is not running properly, it may be the reason why you can't get the disassembly.

If you get a Segmentation fault then your program has a bug no?
You can set a breakpoint manually before the location where the segfault happens and start debugging.
Re: Debugger problem [message #704533 is a reply to message #704491] Thu, 28 July 2011 19:06 Go to previous messageGo to next message
dd  is currently offline dd Friend
Messages: 4
Registered: July 2011
Junior Member
well, I get the feeling I'm not setting up the program properly. The source compiles, build, debugs, and runs on our windows setup, but in Linux/Eclipse we can get it to compile/build, but are running into this snag getting the debugger going.

Also, it seems to indicate the program counter is either at address 0x0 or 0x1 when the "seg fault".

Edit:
heres a pic of what I mean
  • Attachment: debugger.png
    (Size: 1.08MB, Downloaded 106 times)

[Updated on: Thu, 28 July 2011 21:05]

Report message to a moderator

Re: Debugger problem [message #705175 is a reply to message #704533] Fri, 29 July 2011 14:36 Go to previous messageGo to next message
dd  is currently offline dd Friend
Messages: 4
Registered: July 2011
Junior Member
a little more info from the gdb trace console window:

602,028 ~"ESI:\e[0m"
602,028 ~" 0x00000000 \e[32m"
602,028 ~"EDI:\e[0m"
602,028 ~" 0x00000000 \e[32m"
602,028 ~"EBP:\e[0m"
602,029 ~" 0x00000000 \e[32m"
602,029 ~"ESP:\e[31m"
602,029 ~" 0xBFFFF394 \e[32m"
602,029 ~"EIP:\e[0m"
602,029 ~" 0x00000001\n "
602,029 ~"\e[32m"
602,029 ~"CS:\e[0m"
602,029 ~" 0073 \e[32m"
602,029 ~"DS:\e[0m"
602,029 ~" 007B \e[32m"
602,029 ~"ES:\e[0m"
602,029 ~" 007B \e[32m"
602,029 ~"FS:\e[0m"
602,029 ~" 0000 \e[32m"
602,029 ~"GS:\e[0m"
602,029 ~" 0000 \e[32m"
602,029 ~"SS:\e[0m"
602,029 ~" 007B\e[0m"
602,052 &"Error while running hook_stop:\n"
602,055 &"Cannot access memory at address 0x1\n"
602,056 *stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",\
frame={addr="0x00000001",func="??",args=[]},thread-id="1",stopped-threads="all",core="0"
602,059 (gdb)

(then a little farther down)

602,908 (gdb)
602,911 16-thread-info 1
602,984 17-data-disassemble -s 1 -e 45 -- 1
602,984 17^error,msg="Cannot access memory at address 0x1"
602,984 (gdb)
603,050 18-data-disassemble -s 0 -e 32 -- 1
603,051 18^error,msg="Cannot access memory at address 0x0"
603,051 (gdb)
603,087 19-data-disassemble -s 2 -e 54 -- 1
603,087 19^error,msg="Cannot access memory at address 0x2"
603,087 (gdb)
Re: Debugger problem [message #705192 is a reply to message #705175] Fri, 29 July 2011 14:54 Go to previous message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
602,056 *stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",\
frame={addr="0x00000001",func="??",args=[]},thread-id="1",stopped-threads="all",core="0"

means your program crashed. I don't know why GDB cannot report addr or func. Maybe your target is not reporting them.

Marc
Previous Topic:prevent switching between dos and windows
Next Topic:CooCox CoIDE-----393 components + 327 examples = A fulcrum for moving the world
Goto Forum:
  


Current Time: Sat Dec 20 00:14:57 GMT 2014

Powered by FUDForum. Page generated in 0.09048 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software