gdb problems

Hello!

I’d like to know if there is a new version of gdb for QNX RTP?

http://groups.google.com/groups?hl=en&lr=&selm=aam83h%24duu%241%40nntp.qnx.com

We are having some problems with gdb 5.0 included in QNX 6.1 trying to
debug our multi-threaded applications : when doing ‘run’, it starts but
come back to the prompt immediately without any message (exception,
segfault, something!).

I did a simple hello program and it does the same thing!!!

===
QCC -g hw.C -o hw (also tried g++)
$ gdb ./hw
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “–host=x86-pc-nto-qnx --target=ntox86”…
(gdb) break main
Breakpoint 1 at 0x804aaa6: file hw.C, line 5.
(gdb) run
Starting program: /home/ch7905/subsrc/sm3/src/Tests/./hw
(gdb) n
Cannot find bounds of current function
(gdb) quit
The program is running. Exit anyway? (y or n) y

Expected behavior (comparison to a RH7.3 box):

===
[rngadam@sonia2 rngadam]$ gdb ./hw
GNU gdb Red Hat Linux (5.1-1)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “i386-redhat-linux”…
(gdb) break main
Breakpoint 1 at 0x8048656
(gdb) run
Starting program: /home/rngadam/./hw

Breakpoint 1, 0x08048656 in main ()
(gdb) n
Single stepping until exit from function main,
which has no line number information.
hello world

Program exited normally.
(gdb) quit

Thanks,


Ricky Ng-Adam, stagiaire laboratoire de robotique
(450) 652-8499 x 2757, local BR0.50
Hydro-Québec, Montréal, Canada

Hi.

The QNX port of GDB requires that you also type “continue”
after you type “run”. The inferior is loaded in a stopped
state after the run command, and you have to tell it to
continue:

[gp] src:>gdb ./foo -nx
GNU gdb 5.0 (UI_OUT)
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “–host=x86-pc-nto-qnx --target=ntox86”…
(gdb) run
Starting program: /home/gp/src/./foo
(gdb) b main
Breakpoint 1 at 0x80483e2: file foo.c, line 13.
(gdb) c
Continuing.

Breakpoint 1, main () at foo.c:13
13 printf(“GP\n”);
(gdb) c
Continuing.
GP

Program exited normally.
(gdb)

Regards,
GP

Ricky Ng-Adam <ng-adam.ricky@ireq.ca> wrote:

Hello!

I’d like to know if there is a new version of gdb for QNX RTP?

http://groups.google.com/groups?hl=en&lr=&selm=aam83h%24duu%241%40nntp.qnx.com

We are having some problems with gdb 5.0 included in QNX 6.1 trying to
debug our multi-threaded applications : when doing ‘run’, it starts but
come back to the prompt immediately without any message (exception,
segfault, something!).

I did a simple hello program and it does the same thing!!!

===
QCC -g hw.C -o hw (also tried g++)
$ gdb ./hw
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “–host=x86-pc-nto-qnx --target=ntox86”…
(gdb) break main
Breakpoint 1 at 0x804aaa6: file hw.C, line 5.
(gdb) run
Starting program: /home/ch7905/subsrc/sm3/src/Tests/./hw
(gdb) n
Cannot find bounds of current function
(gdb) quit
The program is running. Exit anyway? (y or n) y

Expected behavior (comparison to a RH7.3 box):

===
[rngadam@sonia2 rngadam]$ gdb ./hw
GNU gdb Red Hat Linux (5.1-1)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “i386-redhat-linux”…
(gdb) break main
Breakpoint 1 at 0x8048656
(gdb) run
Starting program: /home/rngadam/./hw

Breakpoint 1, 0x08048656 in main ()
(gdb) n
Single stepping until exit from function main,
which has no line number information.
hello world

Program exited normally.
(gdb) quit

Thanks,


Ricky Ng-Adam, stagiaire laboratoire de robotique
(450) 652-8499 x 2757, local BR0.50
Hydro-Quebec, Montreal, Canada

Ricky Ng-Adam <ng-adam.ricky@ireq.ca> wrote:

Hello Graeme!

Argh! Ok, that was simple! Thanks!

You’re welcome. I am always tripping up the other way, using gdb
on other *NIX platforms. “Argh! It ran!” (note to self, set
breakpoints before typing ‘run’…)

Regards,
GP

Graeme Peterson wrote:

Hi.

The QNX port of GDB requires that you also type “continue”
after you type “run”. The inferior is loaded in a stopped
state after the run command, and you have to tell it to
continue:

[gp] src:>gdb ./foo -nx
GNU gdb 5.0 (UI_OUT)
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “–host=x86-pc-nto-qnx --target=ntox86”…
(gdb) run
Starting program: /home/gp/src/./foo
(gdb) b main
Breakpoint 1 at 0x80483e2: file foo.c, line 13.
(gdb) c
Continuing.

Breakpoint 1, main () at foo.c:13
13 printf(“GP\n”);
(gdb) c
Continuing.
GP

Program exited normally.
(gdb)

Regards,
GP


Ricky Ng-Adam, stagiaire laboratoire de robotique
(450) 652-8499 x 2757, local BR0.50
Hydro-Quebec, Montreal, Canada

Hello Graeme!

Argh! Ok, that was simple! Thanks!

Graeme Peterson wrote:

Hi.

The QNX port of GDB requires that you also type “continue”
after you type “run”. The inferior is loaded in a stopped
state after the run command, and you have to tell it to
continue:

[gp] src:>gdb ./foo -nx
GNU gdb 5.0 (UI_OUT)
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “–host=x86-pc-nto-qnx --target=ntox86”…
(gdb) run
Starting program: /home/gp/src/./foo
(gdb) b main
Breakpoint 1 at 0x80483e2: file foo.c, line 13.
(gdb) c
Continuing.

Breakpoint 1, main () at foo.c:13
13 printf(“GP\n”);
(gdb) c
Continuing.
GP

Program exited normally.
(gdb)

Regards,
GP


Ricky Ng-Adam, stagiaire laboratoire de robotique
(450) 652-8499 x 2757, local BR0.50
Hydro-Québec, Montréal, Canada