Unable to see local variables when debugging (NDK r9, x86 emulator)

564 views
Skip to first unread message

folecr

unread,
Aug 13, 2013, 9:22:59 PM8/13/13
to andro...@googlegroups.com
I'm using the NDK r9 on the x86 emulator (Android 16 system image)

I'm able to step through my C++ source code in a full debug build. I am NOT able to see any local variables. gdb does not find them. "info locals" shows one single static variable (defined in the file that holds the function I hit the breakpoint on.)

Has anybody encountered this? How do I get past this and actually print the contents of local variables?

I've tried all kinds of things - removing the strip command completely, removing the release flags from the command line (even though these flags are reset by the debug flags) My remaining option is to move to an older version of the NDK because I *was* able to debug a few months ago...

Thanks.

folecr

unread,
Aug 13, 2013, 9:47:37 PM8/13/13
to andro...@googlegroups.com
Ah! The problem seems to be with GCC 4.8 and the DWARF4.


Adding -gdwarf-2 seems to allow me to see local variables

thehesiod

unread,
Feb 24, 2014, 8:42:55 PM2/24/14
to andro...@googlegroups.com
awesome, I've been scratching my head awhile about this.  Thanks!

Sida Li

unread,
Apr 9, 2014, 2:54:50 PM4/9/14
to andro...@googlegroups.com
Hello, could you elebrate how did you add -gdwarf-2 to the NDK build? Thanks!

mk wasabara

unread,
Apr 10, 2014, 7:54:00 PM4/10/14
to andro...@googlegroups.com

何潇峰

unread,
Jun 7, 2014, 3:25:03 AM6/7/14
to andro...@googlegroups.com
Thanks dude, It works.
I was encountering this problem right after switching GCC 4.6 to 4.8.
Reply all
Reply to author
Forward
0 new messages