gdb say "No stack" and SegFault

I am trying to debug my program:

gdb$ file ./myprg
gdb$ break main
gdb$ run
gdb$ cont

gdb$ kill
gdb$ file ./myprg

… trying to load symbol table … No Stack
No Stack.

I am repeat last command sequence:

gdb$ kill
gdb$ file ./myprg

… trying to load symbol table …Segmentation fault …

I am needing to exit from gdb and enter again. Is it right ?

P.S. My FreeBSD or Linux box do that without any problem …


Mike Gorchak
CJSC Malva
System Programmer

i’ve submitted this to bugs.qnx.com
i can reproduce this here…

Mike Gorchak <deflektor@crosswinds.net> wrote:

I am trying to debug my program:

gdb$ file ./myprg
gdb$ break main
gdb$ run
gdb$ cont

gdb$ kill
gdb$ file ./myprg

… trying to load symbol table … No Stack
No Stack.

I am repeat last command sequence:

gdb$ kill
gdb$ file ./myprg

… trying to load symbol table …Segmentation fault …

I am needing to exit from gdb and enter again. Is it right ?

P.S. My FreeBSD or Linux box do that without any problem …


Mike Gorchak
CJSC Malva
System Programmer


Randy Martin randy@qnx.com
Manager of FAE Group, North America
QNX Software Systems www.qnx.com
175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
Tel: 613-591-0931 Fax: 613-591-3579

Randy Martin <randy@qnx.com> wrote:

i’ve submitted this to bugs.qnx.com
i can reproduce this here…

This bug is fixed in gdb5, which will be the next version
of gdb released.

Here is the output of my session, using a #pragma pack() test
program called ‘prag’:

=============================
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) file /home/gp/src/prag
Reading symbols from /home/gp/src/prag…done.
(gdb) break main
Breakpoint 1 at 0x80483d2: file prag.c, line 23.
(gdb) run
Starting program: /home/gp/src/prag
(gdb) cont
Continuing.

Breakpoint 1, main () at prag.c:23
23 printf(“five %d, six %d, eight %d\n”, sizeof(five), sizeof(six), sizeof(eight));
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb) file /home/gp/src/prag
Load new symbol table from “/home/gp/src/prag”? (y or n) y

Reading symbols from /home/gp/src/prag…done.
(gdb) r
Starting program: /home/gp/src/prag
(gdb) c
Continuing.

Breakpoint 1, main () at prag.c:23
23 printf(“five %d, six %d, eight %d\n”, sizeof(five), sizeof(six), sizeof(eight));
(gdb)

Regards,
GP


Mike Gorchak <> deflektor@crosswinds.net> > wrote:
I am trying to debug my program:

gdb$ file ./myprg
gdb$ break main
gdb$ run
gdb$ cont

gdb$ kill
gdb$ file ./myprg

… trying to load symbol table … No Stack
No Stack.

I am repeat last command sequence:

gdb$ kill
gdb$ file ./myprg

… trying to load symbol table …Segmentation fault …

I am needing to exit from gdb and enter again. Is it right ?

P.S. My FreeBSD or Linux box do that without any problem …


Mike Gorchak
CJSC Malva
System Programmer


Randy Martin > randy@qnx.com
Manager of FAE Group, North America
QNX Software Systems > www.qnx.com
175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
Tel: 613-591-0931 Fax: 613-591-3579