RTP gdb problem

Hello.

I just (month ago) started with QNX RTP. I’m quite experienced GNU/Linux user, so I was glad that I can use gcc and gdb as well. Unfortunately, I’ve experienced gdb problem I don’t know how to deal with.
Say I write simplest C++ program possible, like that:

#include <iostream.h>

int main( )
{
cout << “Hello!\n”;
}

It gets compiled (with gcc -o name -g) and works very well, but when I tried to debug this (and also other programs) I got following error:

$ gdb ./t
This GDB was configured as “i386-qnx”…
(gdb) break main
Breakpoint 1 at 0x80484ba: file test.cpp, line 6.
(gdb) run
Starting program: ./t
Debug server launched.
Launching on pty /dev/ptyp0
(gdb) bt
#0 0xb032c3c4 in ?? ()
Cannot access memory at address 0x0.
(gdb) p main
$1 = {int ()} 0x80484b4
(gdb)

As you see, I’m able to load program into gdb, set a break and run it as well, but when it stops, I’m not in any sensible place (at least I think so). Last command shows that gdb sees my program’s symbol table, so what’s the problem ?

Of course, problem appeared also when I tried use ddd.
Anybody knows solution for this problem ?

Michal

PS. Please CC any replies to kamikaze@master.pds.net.pl, I’ve got network problems here, and I don’t want to miss any reply…

Our gdb doesn’t continue when you type run. You are trying to backtrace
from the programs entry point. Try issuing a continue, and you should
hit your main breakpoint.

Michal Adamczak <michal@reks.energocontrol.com.pl> wrote:

Hello.

I just (month ago) started with QNX RTP. I’m quite experienced GNU/Linux user, so I was glad that I can use gcc and gdb as well. Unfortunately, I’ve experienced gdb problem I don’t know how to deal with.
Say I write simplest C++ program possible, like that:

#include <iostream.h

int main( )
{
cout << “Hello!\n”;
}

It gets compiled (with gcc -o name -g) and works very well, but when I tried to debug this (and also other programs) I got following error:

$ gdb ./t
This GDB was configured as “i386-qnx”…
(gdb) break main
Breakpoint 1 at 0x80484ba: file test.cpp, line 6.
(gdb) run
Starting program: ./t
Debug server launched.
Launching on pty /dev/ptyp0
(gdb) bt
#0 0xb032c3c4 in ?? ()
Cannot access memory at address 0x0.
(gdb) p main
$1 = {int ()} 0x80484b4 <main
(gdb)

As you see, I’m able to load program into gdb, set a break and run it as well, but when it stops, I’m not in any sensible place (at least I think so). Last command shows that gdb sees my program’s symbol table, so what’s the problem ?

Of course, problem appeared also when I tried use ddd.
Anybody knows solution for this problem ?

Michal

PS. Please CC any replies to > kamikaze@master.pds.net.pl> , I’ve got network problems here, and I don’t want to miss any reply…


cburgess@qnx.com

Also, this is a qnx4 newsgroup - you should be posting in

qdn.public.qnxrtp.devtools

Michal Adamczak <michal@reks.energocontrol.com.pl> wrote:

Hello.

I just (month ago) started with QNX RTP. I’m quite experienced GNU/Linux user, so I was glad that I can use gcc and gdb as well. Unfortunately, I’ve experienced gdb problem I don’t know how to deal with.
Say I write simplest C++ program possible, like that:

#include <iostream.h

int main( )
{
cout << “Hello!\n”;
}

It gets compiled (with gcc -o name -g) and works very well, but when I tried to debug this (and also other programs) I got following error:

$ gdb ./t
This GDB was configured as “i386-qnx”…
(gdb) break main
Breakpoint 1 at 0x80484ba: file test.cpp, line 6.
(gdb) run
Starting program: ./t
Debug server launched.
Launching on pty /dev/ptyp0
(gdb) bt
#0 0xb032c3c4 in ?? ()
Cannot access memory at address 0x0.
(gdb) p main
$1 = {int ()} 0x80484b4 <main
(gdb)

As you see, I’m able to load program into gdb, set a break and run it as well, but when it stops, I’m not in any sensible place (at least I think so). Last command shows that gdb sees my program’s symbol table, so what’s the problem ?

Of course, problem appeared also when I tried use ddd.
Anybody knows solution for this problem ?

Michal

PS. Please CC any replies to > kamikaze@master.pds.net.pl> , I’ve got network problems here, and I don’t want to miss any reply…


cburgess@qnx.com