gdb 7.0 warnings: Wrong size fpregset in core file

1k views Asked by At

reWhen analyzing a core file, my gdb 7.0 outputs several warnings:

warning: Wrong size gregset in core file.
warning: Wrong size fpregset in core file.
warning: Wrong size gregset in core file.
warning: Wrong size fpregset in core file.
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

I am not sure if its related, but I am unable to get a backtrace:

(gdb) bt
#0  0x00000000 in ?? ()

OS architecture is SUN Solaris 10 SPARC.

Questions:

  1. What is the reason/cause of these warnings?
  2. Why can't I retrieve a backtrace?
  3. How to fix these problems?
2

There are 2 answers

0
Yodo On

The problem can in gdb as well in your program. I would recommend to update gdb to the most recent version (7.3.1). Also it could be helpful to create simple test program and analyze its core with gdb to be sure that your utility works fine.

"gregset" and other error indicate that gdb unable read the data from the core file. It can happen if your program gone wild and corrupt stack. gregset error means that gdb was unable to read general-purpose register set from a core file. fpregset is for floating-point register set. The expected register size is platform dependent.

bt would not work if you cant read core file properly.

0
thorstenhirsch On

I also had the fpregset warnings (and no stack trace) when I tried to work on a 64bit core dump with gdb 7.6.2 on Solaris 10. The cause seems to be, that the userspace applications of Solaris 10 are compiled with 32bits by default - and without support for 64bit core cumps.

The guys in GDB's IRC channel gave me the following parameter:

--enable-64-bit-bfd

I also compiled a 64bit version of gdb (-m64), but that shouldn't be necessary. Now gdb could work on the 64bit core dump and create the stack trace without any warnings.