1/1

|
How to print local variables using GDB
by avamsi on Jun 4, 2012 |
avamsi
Posts: 54 Joined: Apr 16, 2012 Last seen: Jul 30, 2014 |
||
|
Hi,
or32-elf-gdb could print the global variable's values during debug process. But it could not print the local variables with in the functions though the control stays in that context. I tried with the file name (melloctest.c) syntax also like (gdb) p melloctest:x No symbol "melloctest" in current context. (gdb) print x No symbol "x" in current context. Can any one suggest the commands to print the local variables on or32-elf-gdb. Thanks, A.Vamsi |
|||
|
RE: How to print local variables using GDB
by jeremybennett on Jun 5, 2012 |
jeremybennett
Posts: 815 Joined: May 29, 2008 Last seen: Jun 13, 2019 |
||
|
Hi A Vamsi, have you compiled your code with -g? Without the DWARF2 debug info, gdb cannot find out about local variables. If it still does not work, please post a full testcase - program, command line and the commands you used in GDB. HTH, Jeremy
-- |
|||
1/1

