This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug debug/36728] [stack]: gdb doesn't work with stack alignment



------- Comment #1 from hjl dot tools at gmail dot com  2008-07-04 13:17 -------
Created an attachment (id=15852)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15852&action=view)
A testcase with drap 

[hjl@gnu-6 stack-10]$
/export/build/gnu/gcc-stack-internal/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-stack-internal/build-x86_64-linux/gcc/ -m32 foo.c -g
[hjl@gnu-6 stack-10]$ gdb a.out 
GNU gdb 6.8.50.20080605-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...
(gdb) b foo
Breakpoint 1 at 0x80483a8: file foo.c, line 7.
(gdb) r
Starting program: /export/home/hjl/bugs/gcc/stack-10/a.out 

Breakpoint 1, foo (dummy1=-5725018, dummy2=0, dummy3=-5724977, 
    dummy4=-5724952, dummy5=-5724933, dummy6=-5724905, size=-5724890)
    at foo.c:7
7       {
(gdb) next
8         volatile char * ptr=__builtin_alloca(size);
(gdb) 
11        xxx = 2;
(gdb) 
12        ptr [1]= 30;
(gdb) 
13        printf ("%d: %d\n", xxx, ptr [1]);
(gdb) p xxx
$1 = 0
(gdb) p ptr [1]
$2 = 0 '\0'
(gdb)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36728


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