Question about the gdb.base/nodebug.exp test

Carl Love cel@us.ibm.com
Mon Oct 25 22:23:35 GMT 2021


Tom, Simon:

The debug info package is installed.

The bug that Tom pointed to looks exactly like what I am seeing.  
> 
> FWIW, I recently debugged a failure in this testcase (with target
> board
> unix/-m32/-fPIE/-pie), similar to what you describe.  Filed at
> https://sourceware.org/bugzilla/show_bug.cgi?id=28467  .
> 
> The problem is roughly that malloc gets resolved to malloc@plt in the
> executable, which seems to assume that the caller has the pic
> register
> setup.  And gdb fails to do that.
> 
> The test-case uses nosharedlibrary, so I'd expect whether
> glibc-debuginfo is installed or not, not to make a difference.
> 
> Perhaps the difference between distros is PIE vs no-PIE by default?

I am not sure what the pic is but I am guessing that is an X86 term?

I am guessing the pic is the equivalent of the contents of r2 on
Powerpc.  r2 is called the TOC (table of contents).  I am guessing the
r2 is not setup.  Anyway, I am guessing the GDB routines in infcall.c
is where the calls are made to evaluate the inferior function that
calls malloc.  I am guessing somewhere in there GDB needs to setup a
frame for the call and r2 is not getting set.  Not sure if you have any
hints from Intel that might be helpful to figure out how all this
works.   Thanks for the help.

                          Carl 



More information about the Gdb-patches mailing list