I compile with -O0 and -gdawrf-4.
When I do "info local" it prints some global variables, but not the locals of the function.
I then tried to debug a very simple program, and that fares even worse -- GDB doesn't even find the line numbers:
Code: Select all
pi@moneypitquattro /tmp $ cat foo.cpp
#include <stdio.h>
int main(int argc, char const *argv[]) {
printf("argc=%d\n");
printf("argv[1]=%p\n", argv[1]);
return 0;
}
pi@moneypitquattro /tmp $ g++ -o foo foo.cpp -g -O0
pi@moneypitquattro /tmp $ gdb ./foo
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 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 "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/foo...done.
(gdb) br main
Breakpoint 1 at 0x855c
(gdb) run -x -y
Starting program: /tmp/foo -x -y
Traceback (most recent call last):
File "/usr/lib/debug/usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named libstdcxx.v6.printers
Breakpoint 1, 0x0000855c in main ()
(gdb) print argc
No symbol "argc" in current context.
(gdb) print argv
No symbol "argv" in current context.
(gdb) next
Single stepping until exit from function main,
which has no line number information.
argc=2130704196
argv[1]=0x7efff86c
0x76d3581c in __libc_start_main () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb)