When using the GNAT GPS debugger on a gpr file, when I try to display a value in the debugger data window it never shows the value, just the variable name. I'm assuming since I haven't seen anything on this issue in some other website, that I'm missing something that is common knowledge.
Asked
Active
Viewed 261 times
0
-
You could start by explaining us what you have done. There could be any of the usual issues; gdb not installed, debugging information not enabled, you don't run the program, ... – Jacob Sparre Andersen Jan 15 '16 at 17:57
-
I presume you mean using the debugger on an Ada source file? ... because I see exactly this problem (selecting ‘print’ on a record shows the content, selecting ‘display’ just shows the name). You can proceed by typing GDB commands in the debugger tab. – Simon Wright Jan 15 '16 at 18:18
-
I just tried again, and now I see the content of a variable in the graph display just fine (when it’s valid, i.e. in the scope surrounding the current program counter). Don’t know why I had trouble before. – Simon Wright Jan 17 '16 at 22:07
1 Answers
0
Various solutions, as already mentioned by others: make sure your source is compiled with "-g" (and preferably "-O0" or "-O1", not "-O2").
GPS always uses the print
command, never the display
command. The most likely case is that you are trying to display an integer variable that is in fact stored in a register, and cannot be display by the debugger (gdb). You could try adding a "pragma Volatile" on the variable to force it to be stored in memory (there is a performance penalty).

manuBriot
- 2,755
- 13
- 21