This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Add missing parameter to 'amd64_create_target_description' (and unbreak build)


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

commit c0867626d277101afcead91e94f20cbe89a3aced
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Fri Jun 29 21:36:42 2018 -0400

    Add missing parameter to 'amd64_create_target_description' (and unbreak build)
    
    While building gdbserver on GNU/Linux, the build failed with:
    
      ../../../binutils-gdb/gdb/gdbserver/linux-x86-tdesc.c: In function â??const target_desc* amd64_linux_read_description(uint64_t, bool)â??:
      ../../../binutils-gdb/gdb/gdbserver/linux-x86-tdesc.c:121:67: error: too few arguments to function â??target_desc* amd64_create_target_description(uint64_t, bool, bool, bool)â??
             *tdesc = amd64_create_target_description (xcr0, is_x32, true);
                                                                         ^
      In file included from ../../../binutils-gdb/gdb/gdbserver/linux-x86-tdesc.c:26:0:
      ../../../binutils-gdb/gdb/gdbserver/../arch/amd64.h:21:14: note: declared here
       target_desc *amd64_create_target_description (uint64_t xcr0, bool is_x32,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    According to Joel Brobecker:
    
    > I think the parameter should be set to "true". Otherwise, it will
    > not include the fs_base and gs_base register in the list of registers.
    > Although the name of the source file says x86, the code itself is
    > protected by...
    >
    >     #ifdef __x86_64__
    >
    > ... and is inside a function called amd64_linux_read_description.
    > I also verified that this file gets compiled on amd64-linux platforms.
    > See gdb/gdbserver/configure.srv:
    >
    >   x86_64-*-linux*)      srv_regobj="$srv_amd64_linux_regobj $srv_i386_linux_regobj"
    >
    > The last piece of confirmation is that setting the parameter to "true"
    > provides the behavior before the parameter was added; and the reason
    > for adding the parameter was to remove the {fs,gs}_base registers
    > from the list for Windows only.
    
    Therefore I'm pushing the patch to unbreak the build.
    
    gdb/gdbserver/ChangeLog:
    2018-06-29  Joel Brobecker  <brobecker@adacore.com>
    
    	* linux-x86-tdesc.c (amd64_linux_read_description): Add missing
    	parameter in call to 'amd64_create_target_description'.

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

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 2fd2d90..c90de7c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-29  Joel Brobecker  <brobecker@adacore.com>
+
+	* linux-x86-tdesc.c (amd64_linux_read_description): Add missing
+	parameter in call to 'amd64_create_target_description'.
+
 2018-06-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* x86-tdesc.h: Remove executable permission flag.
diff --git a/gdb/gdbserver/linux-x86-tdesc.c b/gdb/gdbserver/linux-x86-tdesc.c
index 358659b..c3aa20c 100644
--- a/gdb/gdbserver/linux-x86-tdesc.c
+++ b/gdb/gdbserver/linux-x86-tdesc.c
@@ -118,7 +118,7 @@ amd64_linux_read_description (uint64_t xcr0, bool is_x32)
 
   if (*tdesc == NULL)
     {
-      *tdesc = amd64_create_target_description (xcr0, is_x32, true);
+      *tdesc = amd64_create_target_description (xcr0, is_x32, true, true);
 
       init_target_desc (*tdesc, amd64_expedite_regs);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]