I'm having some problems with static data members and gdb. (This would
be current sourceware GDB, via the 'src' repository on RH 6.2/x86) 

To get the ball rolling, I've made a simple test case:


struct __ios_flags
 {
   typedef short __int_type;
   static const __int_type _S_boolalpha =       1;
  };

int main()
{
  __ios_flags obj; // p obj::_S_boolalpha
  int i = __ios_flags::_S_boolalpha;
  return 0;
}


(gdb) p __ios_flags::_S_boolalpha
Internal error: could not find static variable _S_boolalpha
(gdb) p i
$1 = 1
(gdb) p obj
$2 = {static _S_boolalpha = <optimized out>}
(gdb) 

This is showing just one problem: most often, I see cases where gdb
says things like: can't display result 0x0000... 

anyway.

-benjamin



Reply via email to