This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fix to debugging problem on Alpha


    I've applied Alexandre's patch to the gcc 2.95.2 source, and 
*finally* I can step over function calls (something I haven't been 
able to do on Tru64 UNIX since gcc 2.8.1).  Wonderful!  Thank you!

(Here comes the other shoe)

   Unfortunately, when I step into a function the parameters aren't 
interpreted correctly:


$ cat x.c
void funct (int i, char *c)
{
    printf ("%d %s\n", i, c);
}



int main (int argc, char* argv[])
{
    funct (3, "abc");
}

$ gcc -g -o x x.c

$ gdb x
GNU gdb 4.18
Copyright 1998 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 "alphaev6-dec-osf4.0e"...
(gdb) b main
Breakpoint 1 at 0x120001208: file x.c, line 9.
(gdb) r
Starting program: /usr/users/w/weber/test/pw/x

Breakpoint 1, main (argc=536875264, argv=0x0) at x.c:9
9       {
(gdb) print argc
$1 = 536875264
(gdb) print *argv
Error accessing memory address 0x0: Invalid argument.
(gdb) n
10         funct (3, "abc");
(gdb) print argc
$2 = 1
(gdb) print *argv
$3 = 0x11ffffa60 "/usr/users/w/weber/test/pw/x"
(gdb) s
funct (i=-2147394304,
     c=0x1400210c8 <Error reading address 0x1400210c8: Invalid argument>)
     at x.c:2
2       {
(gdb) print i
$4 = -2147394304
(gdb) print c
$5 = 0x1400210c8 <Error reading address 0x1400210c8: Invalid argument>
(gdb) n
3          printf ("%d %s\n", i, c);
(gdb) print i
$6 = 3
(gdb) print c
$7 = 0x14000001f "abc"
(gdb) n
3 abc
4       }
(gdb) c
Continuing.

Program exited with code 06.
(gdb) q
$
-- 

     Chris Weber
     Bucknell Information Services and Resources

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]