GDB 5.0 won't build on GNU/Linux/sparc

Kevin Buettner
Mon May 22 19:12:00 GMT 2000

On May 20,  4:21am, Alexandre Oliva wrote:

> gdb/sparc-tdep.c contains code in supply_gregset() and fill_gregset()
> that will only compile on Solaris/sparc.  glibc doesn't define
> prgreg_t, R_I7, R_PS, R_PC, R_nPC nor R_Y.  In fact, registers from i0
> to i7 aren't even available in glibc's gregset.  The solution is to
> disable USE_PROC_FS, which can be accomplished by #including the
> generic config/nm-linux.h from config/sparc/nm-linux.h, as all other
> architecture-specific `nm-linux.h's do

I'm more than a little surprised that supply_gregset() and fill_gregset()
appear in sparc-tdep.c!  In my opinion, they belong in sparc-nat.c.

The reason is that, some day, we'll get gdb fully multiarched.  When
this happens, you may wish to build an i386-*-linux* hosted gdb which
is capable of debugging natively as well as remote sparc targets.  To
do so will require that both i386-linux-nat.c AND sparc-tdep.c be linked
into the same executable.  Both of these files define supply_gregset().
This is clearly wrong; supply_gregset() needs to be defined only once
and (IMO) it should only be defined in the *-nat.c files.

> (actually, it's also missing
> from config/powerpc/nm-linux.h).  Unfortunately, I don't have access to a
> GNU/Linux/powerpc platform to test the second change.  On
> GNU/Linux/sparc, it builds correctly, but it still doesn't work :-(
> child_resume is called with step==1, and aborts because
> SOFTWARE_SINGLE_STEP_P is also 1.  I'm investigating.  Meanwhile, ok
> to install?  Release branch?

I've tested your change to config/powerpc/nm-linux.h; everything builds
okay and I see no regressions.  Therefore this change is approved for
the trunk.

It could probably go on the release branch as well, but I haven't
tested it there and would rather not have it go on the release branch
unless it's tested.  Also, I see no compelling reason for it to go in
the release branch.  To the best of my knowledge, the spurious
definition of USE_PROC_FS does not cause problems for the PowerPC
GNU/Linux port.  (However I do agree that it would be better if it
were undefined.)

After the generic nm-linux.h file is included in the powerpc specific
nm-linux.h file, this latter file needs to be cleaned up somewhat as
it contains some defines which are duplicates of those contained in
the generic version.  But I will do this after you commit your change
for config/powerpc/nm-linux.h.


More information about the Gdb-patches mailing list