public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Avoid short i386 register names on Solaris/x86 [PR25981]
@ 2020-06-13  0:20 gdb-buildbot
  2020-06-13  0:20 ` Failures on Fedora-i686, branch master gdb-buildbot
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gdb-buildbot @ 2020-06-13  0:20 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT e52a0f1bd949e1b6b6bcadc284c8f84464d46f2c ***

commit e52a0f1bd949e1b6b6bcadc284c8f84464d46f2c
Author:     Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
AuthorDate: Mon May 18 17:59:43 2020 +0200
Commit:     Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
CommitDate: Mon May 18 17:59:43 2020 +0200

    Avoid short i386 register names on Solaris/x86 [PR25981]
    
    This is the 32-bit companion to
    
            Remove unused ps_lgetLDT etc. on Solaris/x86 [PR25981]
            https://sourceware.org/pipermail/gdb-patches/2020-May/168713.html
    
    A 32-bit-default gdb fails to compile with the updated <sys/regset.h>.
    While it is also affected by the lack of a GS definition, which the
    compantion patch above fixes, it also fails to compile i386-sol2-nat.c like
    this
    
    /vol/src/gnu/gdb/hg/master/git/gdb/i386-sol2-nat.c:181:3: error: 'EAX' was not declared in this scope
      181 |   EAX, ECX, EDX, EBX,
          |   ^~~
    
    and several more.
    
    While this could be fixed by either including <ucontext.h> here or
    provding fallback definitions of the register macros, I chose to do what
    the 64-bit-default code in the same file
    (amd64_sol2_gregset32_reg_offset[]) does, namely just hardcode the
    numeric values instead.  They are part of the ABI and thus guaranteed
    not to change.
    
    With this patch, a i386-pc-solaris2.11 configuration on master compiles
    again, however, it doesn't work.  However, I could successfully test it
    on the gdb-9 branch.
    
    Compiling and testing proved to be messy, unfortunately:
    
    * For one, Solaris <sys/procfs.h> and largefile support used to be
      mutually exclusive (fixed in Solaris 11.4 and Illumos), which was
      exacerbated by the fact that g++ predefines _FILE_OFFSET_BITS=64 since
      GCC 9.1.0.  For now I've worked around this by adding
      -U_FILE_OFFSET_BITS to CXXFLAGS and configuring with
      --disable-largefile.  I hope to clean this up in a future patch.
    
    * gdb still defaults to startup-with-shell on.  However, /bin/bash is a
      64-bit executable which cannot be debugged by a 32-bit gdb.  I hacked
      around that part by pointing $SHELL at a 32-bit bash before running
      make check.
    
            PR build/25981
            * i386-sol2-nat.c [PR_MODEL_NATIVE != PR_MODEL_LP64] (regmap):
            Hardcode register numbers.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cba0464770..cc13e41c64 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2020-05-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
+	PR build/25981
+	* i386-sol2-nat.c [PR_MODEL_NATIVE != PR_MODEL_LP64] (regmap):
+	Hardcode register numbers.
+
 	PR build/25981
 	* procfs.c [(__i386__ || __x86_64__) && sun] (proc_get_LDT_entry,
 	procfs_find_LDT_entry): Remove.
diff --git a/gdb/i386-sol2-nat.c b/gdb/i386-sol2-nat.c
index f54b3b109e..054d2ec81b 100644
--- a/gdb/i386-sol2-nat.c
+++ b/gdb/i386-sol2-nat.c
@@ -178,10 +178,22 @@ fill_fpregset (const struct regcache *regcache,
    format and GDB's register array layout.  */
 static int regmap[] =
 {
-  EAX, ECX, EDX, EBX,
-  UESP, EBP, ESI, EDI,
-  EIP, EFL, CS, SS,
-  DS, ES, FS, GS
+  11	/* EAX */,
+  10	/* ECX */,
+  9	/* EDX */,
+  8	/* EBX */,
+  17	/* UESP */,
+  6	/* EBP */,
+  5	/* ESI */,
+  4	/* EDI */,
+  14	/* EIP */,
+  16	/* EFL */,
+  15	/* CS */,
+  18	/* SS */,
+  3	/* DS */,
+  2	/* ES */,
+  1	/* FS */,
+  0	/* GS */
 };
 
 /* Fill GDB's register array with the general-purpose register values


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-06-13  3:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-13  0:20 [binutils-gdb] Avoid short i386 register names on Solaris/x86 [PR25981] gdb-buildbot
2020-06-13  0:20 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-06-13  0:59 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-06-13  0:59 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-06-13  1:33 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-06-13  1:44 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-06-13  2:18 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-06-13  3:02 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-06-13  3:03 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-w64-mingw32, branch master *** BREAKAGE *** gdb-buildbot
2020-06-13  3:35 ` Failures on Fedora-x86_64-native-gdbserver-m64, branch master gdb-buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).