bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug found!


From: woodw
Subject: bug found!
Date: Wed, 8 Jan 2003 12:48:40 +0800 (CST)

bug found!
I'm  runing gdb 5.3 on sun880 solaris 2.8, 64 bit.
I'v compiled gdb5.3 by gcc with these options:
"gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9 -O2"

so,when I use gdb,some problems occur,


uaop $cat b.c
#include <stdio.h>
int main(int argc,char **argv)
{
        int ch;
        short   ret = 0;

        ch = 0;
        ret = 1;
        ch = 1;
        ret = 2;
        ret = ch * ret;
        printf("running..%d,%d\n",ch,ret);
}
uaop $gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9 -g -O2 -o b b.c
uaop $./b
running..1,2
uaop $gdb b
GNU gdb 5.3
Copyright 2002 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 "sparc-sun-solaris2.8"...
(gdb) l
3       {
4               int ch;
5               short   ret = 0;
6
7               ch = 0;
8               ret = 1;
9               ch = 1;
10              ret = 2;
11              ret = ch * ret;
12              printf("running..%d,%d\n",ch,ret);
(gdb) b 8
Breakpoint 1 at 0x100000840: file b.c, line 8.
(gdb) r
Starting program: /sys/uaop/compile/compudmp/b

Breakpoint 1, main (argc=1, argv=0xffffffff7ffff808) at b.c:12
12              printf("running..%d,%d\n",ch,ret);

*****************************************************
didn't stop at line 8,but at line 12
*****************************************************


(gdb) p ret
No symbol "ret" in current context.

*****************************************************
why cannot find "ret"
*****************************************************

(gdb) p ch
No symbol "ch" in current context.
(gdb) where
#0  main (argc=1, argv=0xffffffff7ffff808) at b.c:12
(gdb) l
12              printf("running..%d,%d\n",ch,ret);
13      }
(gdb) c
Continuing.
running..1,2

Program exited with code 015.
(gdb) quit
uaop $

and I also compiled a gdb with no 64 bit options named gdb32.

uaop $gcc -g -o b32 b.c
uaop $gdb32 b32
GNU gdb 5.3
Copyright 2002 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 "sparc-sun-solaris2.8"...
(gdb) l
1       #include <stdio.h>
2       int main(int argc,char **argv)
3       {
4               int ch;
5               short   ret = 0;
6
7               ch = 0;
8               ret = 1;
9               ch = 1;
10              ret = 2;
(gdb) b 7
Breakpoint 1 at 0x106a4: file b.c, line 7.
(gdb) r
Starting program: /sys/uaop/compile/compudmp/b32

Breakpoint 1, main (argc=1, argv=0xffbef924) at b.c:7
7               ch = 0;

************************************************
it was running ok!
************************************************

(gdb) p ret
$1 = 0
(gdb) p ch
$2 = 0
(gdb) c
Continuing.
running..1,2

Program exited with code 015.
(gdb)

why didn't work at 64 bit mode?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]