Author Topic: GDB local/auto variables displaying value "void"  (Read 7188 times)

redcar

  • Community Member
  • Posts: 32
  • Hero Points: 0
GDB local/auto variables displaying value "void"
« on: September 22, 2012, 08:10:22 AM »
Using v17.0.2 32bit linux with GDB, the values of some local and auto variables are displayed as "void".  I did not have this problem with Slickedit v12. 

If I query the gdb via the command line, the values of the variables are correct, so it seems to be a problem with v17 not interpreting the GDB format correctly.

Are there any settings that I might need to adjust?

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: GDB local/auto variables displaying value "void"
« Reply #1 on: September 27, 2012, 04:45:04 PM »
Are those variables STL types?
Do you have GDB configured to pretty-print STL (or other types such as Boost)?
Have you tried re-configuring SlickEdit debugging to use the GDB that is shipped with SlickEdit?  (Debug > Debugger Options... > Configurations, add a new configuration for slickedit/bin/gdb).

redcar

  • Community Member
  • Posts: 32
  • Hero Points: 0
Re: GDB local/auto variables displaying value "void"
« Reply #2 on: September 27, 2012, 06:41:00 PM »
Thanks for the supplementary questions, I was a bit short on detail...
I am cross-debugging to a remote ARM target using a codesourcery toolset. 
The source code is C. The configuration appears to be the same as I used with SE v12.
Structures and unions seem to display OK, as do some scalars, but the value of most scalars and enum types are just not displayed. (the same applies to watch windows).

I am very pleased with the overall improvement in debugging stability with v12, just spoiled by this small issue.

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: GDB local/auto variables displaying value "void"
« Reply #3 on: September 28, 2012, 01:49:45 PM »
If you turn on the macro variable "def_debug_logging", (Macro > Set Variable...), and then start you debugging session and get the the point where some things aren't displayed, then stop debugging, then you could post the log file (located under logs/debug.log in your configuration directory) here so I could look at what is going on.

JakeMontgomery

  • Community Member
  • Posts: 79
  • Hero Points: 9
Re: GDB local/auto variables displaying value "void"
« Reply #4 on: October 02, 2012, 10:41:42 PM »
I also have had the same problem since I upgraded. I am remote debugging Unix systems on VM's from windows. Worked in 16, and now many values get "void" in 17.0.2. I have mostly (only?) noticed it for enumeration values.

If I have the following code:
Code: [Select]
enum TestEnum
{
  None,
  Millisec,
  Seconds,
  Minutes
};

int main (int argc, char *argv[])
{
   TestEnum te=Millisec;
   return 1;
}


A watch on "te" shows "void", but a watch on "(int)te" shows "1".

One thing that may, or may not, be related - If I call  dbg_session_do_command(), with a command of "p te", the result I get back is:
Code: [Select]
$1 = Millisec"

Note the trailing quote, with no quote at the start of the line.

Attached is a debug log file for the code above, with a single watch on "te".

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: GDB local/auto variables displaying value "void"
« Reply #5 on: October 03, 2012, 08:26:02 PM »
Thanks for the good example.  I was able to reproduce the problem, and a fix will be in the next release.  Unfortunately, this one is not hot-fixable.

JakeMontgomery

  • Community Member
  • Posts: 79
  • Hero Points: 9
Re: GDB local/auto variables displaying value "void"
« Reply #6 on: October 03, 2012, 09:12:58 PM »
Any hint as to what the problem is? I have the ability to modify and recompile gdb on both the remote and local machines, so perhaps I could "adjust" the results that it gives to satisfy SE. I do a lot of this type of debugging, and it would be really great if I could create a workaround.

Thanks!

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: GDB local/auto variables displaying value "void"
« Reply #7 on: October 03, 2012, 09:15:26 PM »
If you can mod GDB to cast the enum to an int and just return the integer value, that would work.  Unfortunately, then you wouldn't be able to see the human-readable value.

redcar

  • Community Member
  • Posts: 32
  • Hero Points: 0
Re: GDB local/auto variables displaying value "void"
« Reply #8 on: December 01, 2012, 07:16:28 AM »
I just tried this in 17.0.3, and it seems to  be fixed.
Thank you.