[binutils-gdb] [gdbserver] Fix s390x -m31 gdbserver build

Tom de Vries vries@sourceware.org
Thu Jun 20 09:31:00 GMT 2019


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7d10623d3b153d6c15406b203fb1cf111c53f1dd

commit 7d10623d3b153d6c15406b203fb1cf111c53f1dd
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Jun 20 11:31:36 2019 +0200

    [gdbserver] Fix s390x -m31 gdbserver build
    
    When building gdb on s390x with -m31, we run into this error:
    ...
    gdb/gdbserver/linux-s390-ipa.c: \
      In function 'const target_desc* get_ipa_tdesc(int)':
    gdb/gdbserver/linux-s390-ipa.c:371:18: error: 's390_te_ft_collect_regmap' \
      was not declared in this scope
           SET_REGMAP(s390_te_ft_collect_regmap, 0);
    
    The offending line is part of this code snippet:
    ...
        case S390_TDESC_GS:
          SET_REGMAP(s390_te_ft_collect_regmap, 0);
          return tdesc_s390_gs_linux64;
    ...
    introduced in commit ce29f8439f "S390: Make IPA recognize tdescs with guarded
    storage".
    
    The snippet is part of an #ifdef __s390x__ construct, in the false branch, and
    in the true branch we find a snippet introduced by the same commit:
    ...
        case S390_TDESC_GS:
          SET_REGMAP(s390x_te_ft_collect_regmap, 0);
          return tdesc_s390x_gs_linux64;
    ...
    which is paired with a comment update for s390x_te_ft_collect_regmap:
    ...
    -/* Used for s390x-te-linux64, s390x-tevx-linux64.  */
    +/* Used for s390x-te-linux64, s390x-tevx-linux64, and
    +   s390x-gs-linux64.  */
    
     static const int s390x_te_ft_collect_regmap[] = {
    ...
    
    A similar comment update is added in the same commit for
    s390_te_linux64_ft_collect_regmap:
    ...
    -/* Used for s390-te-linux64, s390-tevx-linux64.  */
    +/* Used for s390-te-linux64, s390-tevx-linux64, and s390-gs-linux64.  */
    
     static const int s390_te_linux64_ft_collect_regmap[] = {
    ...
    but not paired with any update.
    
    Fix the build breaker by making the offending SET_REGMAP use the regmap
    indicated by the comment.
    ...
    -      SET_REGMAP(s390_te_ft_collect_regmap, 0);
    +      SET_REGMAP(s390_te_linux64_ft_collect_regmap, 0);
    ...
    
    Build on s390x-linux with -m31.
    
    gdb/gdbserver/ChangeLog:
    
    2019-06-20  Tom de Vries  <tdevries@suse.de>
    
    	* linux-s390-ipa.c (get_ipa_tdesc)[!__s390x__]: Use
    	s390_te_linux64_ft_collect_regmap for S390_TDESC_GS.

Diff:
---
 gdb/gdbserver/ChangeLog        | 5 +++++
 gdb/gdbserver/linux-s390-ipa.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index fad8fa5..d7094ca 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2019-06-20  Tom de Vries  <tdevries@suse.de>
+
+	* linux-s390-ipa.c (get_ipa_tdesc)[!__s390x__]: Use
+	s390_te_linux64_ft_collect_regmap for S390_TDESC_GS.
+
 2019-06-19  Tom de Vries  <tdevries@suse.de>
 
 	* debug.h (debug_write): Change return type to ssize_t.
diff --git a/gdb/gdbserver/linux-s390-ipa.c b/gdb/gdbserver/linux-s390-ipa.c
index 7697cd9..d01f5c4 100644
--- a/gdb/gdbserver/linux-s390-ipa.c
+++ b/gdb/gdbserver/linux-s390-ipa.c
@@ -368,7 +368,7 @@ get_ipa_tdesc (int idx)
       SET_REGMAP(s390_te_linux64_ft_collect_regmap, 0);
       return tdesc_s390_tevx_linux64;
     case S390_TDESC_GS:
-      SET_REGMAP(s390_te_ft_collect_regmap, 0);
+      SET_REGMAP(s390_te_linux64_ft_collect_regmap, 0);
       return tdesc_s390_gs_linux64;
 #endif
     default:



More information about the Gdb-cvs mailing list