+2018-05-10 Joel Brobecker <brobecker@adacore.com>
+
+ PR server/23158:
+ * regformats/regdat.sh: Adjust script, following the addition
+ of the new expedite_regs parameter to init_target_desc.
+
2018-05-10 Omair Javaid <omair.javaid@linaro.org>
PR gdb/23127
+2018-05-10 Joel Brobecker <brobecker@adacore.com>
+
+ PR server/23158:
+ * tdesc.h (init_target_desc) <expedite_regs>: New parameter.
+ * tdesc.c (init_target_desc) <expedite_regs>: New parameter.
+ Use it to set the expedite_regs field in the given tdesc.
+ * x86-tdesc.h: New file.
+ * linux-aarch64-tdesc.c (aarch64_linux_read_description):
+ Adjust following the addition of the new expedite_regs parameter
+ to init_target_desc.
+ * linux-tic6x-low.c (tic6x_read_description): Likewise.
+ * linux-x86-tdesc.c: #include "x86-tdesc.h".
+ (i386_linux_read_description, amd64_linux_read_description):
+ Adjust following the addition of the new expedite_regs parameter
+ to init_target_desc.
+ * lynx-i386-low.c: #include "x86-tdesc.h".
+ (lynx_i386_arch_setup): Adjust following the addition of the new
+ expedite_regs parameter to init_target_desc.
+ * nto-x86-low.c: #include "x86-tdesc.h".
+ (nto_x86_arch_setup): Adjust following the addition of the new
+ expedite_regs parameter to init_target_desc.
+ * win32-i386-low.c: #include "x86-tdesc.h".
+ (i386_arch_setup): Adjust following the addition of the new
+ expedite_regs parameter to init_target_desc.
+
2018-05-10 Joel Brobecker <brobecker@adacore.com>
PR server/23158:
{
*tdesc = aarch64_create_target_description ();
- init_target_desc (*tdesc);
-
-#ifndef IN_PROCESS_AGENT
static const char *expedite_regs_aarch64[] = { "x29", "sp", "pc", NULL };
- (*tdesc)->expedite_regs = expedite_regs_aarch64;
-#endif
+ init_target_desc (*tdesc, expedite_regs_aarch64);
}
return *tdesc;
if (*tdesc == NULL)
{
*tdesc = tic6x_create_target_description (feature);
- init_target_desc (*tdesc);
-
static const char *expedite_regs[] = { "A15", "PC", NULL };
- (*tdesc)->expedite_regs = expedite_regs;
+ init_target_desc (*tdesc, expedite_regs);
}
return *tdesc;
#ifdef __x86_64__
#include "arch/amd64.h"
#endif
+#include "x86-tdesc.h"
/* Return the right x86_linux_tdesc index for a given XCR0. Return
X86_TDESC_LAST if can't find a match. */
{
*tdesc = i386_create_target_description (xcr0, true);
- init_target_desc (*tdesc);
-
-#ifndef IN_PROCESS_AGENT
- static const char *expedite_regs_i386[] = { "ebp", "esp", "eip", NULL };
- (*tdesc)->expedite_regs = expedite_regs_i386;
-#endif
+ init_target_desc (*tdesc, i386_expedite_regs);
}
return *tdesc;;
{
*tdesc = amd64_create_target_description (xcr0, is_x32, true);
- init_target_desc (*tdesc);
-
-#ifndef IN_PROCESS_AGENT
- static const char *expedite_regs_amd64[] = { "rbp", "rsp", "rip", NULL };
- (*tdesc)->expedite_regs = expedite_regs_amd64;
-#endif
+ init_target_desc (*tdesc, amd64_expedite_regs);
}
return *tdesc;
}
#include <sys/ptrace.h>
#include "x86-xstate.h"
#include "arch/i386.h"
+#include "x86-tdesc.h"
/* The following two typedefs are defined in a .h file which is not
in the standard include path (/sys/include/family/x86/ucontext.h),
struct target_desc *tdesc
= i386_create_target_description (X86_XSTATE_SSE_MASK, false);
- init_target_desc (tdesc);
+ init_target_desc (tdesc, i386_expedite_regs);
lynx_tdesc = tdesc;
}
#include <x86/context.h>
#include "x86-xstate.h"
#include "arch/i386.h"
+#include "x86-tdesc.h"
const unsigned char x86_breakpoint[] = { 0xCC };
#define x86_breakpoint_len 1
struct target_desc *tdesc
= i386_create_target_description (X86_XSTATE_SSE_MASK, false);
- init_target_desc (tdesc);
+ init_target_desc (tdesc, i386_expedite_regs);
nto_tdesc = tdesc;
}
}
void
-init_target_desc (struct target_desc *tdesc)
+init_target_desc (struct target_desc *tdesc,
+ const char **expedite_regs)
{
int offset = 0;
/* Make sure PBUFSIZ is large enough to hold a full register
packet. */
gdb_assert (2 * tdesc->registers_size + 32 <= PBUFSIZ);
+
+#ifndef IN_PROCESS_AGENT
+ tdesc->expedite_regs = expedite_regs;
+#endif
}
struct target_desc *
void copy_target_description (struct target_desc *dest,
const struct target_desc *src);
-/* Initialize TDESC. */
+/* Initialize TDESC, and then set its expedite_regs field to
+ EXPEDITE_REGS. */
-void init_target_desc (struct target_desc *tdesc);
+void init_target_desc (struct target_desc *tdesc,
+ const char **expedite_regs);
/* Return the current inferior's target description. Never returns
NULL. */
#endif
#include "arch/i386.h"
#include "tdesc.h"
+#include "x86-tdesc.h"
#ifndef CONTEXT_EXTENDED_REGISTERS
#define CONTEXT_EXTENDED_REGISTERS 0
#ifdef __x86_64__
tdesc = amd64_create_target_description (X86_XSTATE_SSE_MASK, false,
false);
+ const char **expedite_regs = amd64_expedite_regs;
#else
tdesc = i386_create_target_description (X86_XSTATE_SSE_MASK, false);
+ const char **expedite_regs = i386_expedite_regs;
#endif
- init_target_desc (tdesc);
+ init_target_desc (tdesc, expedite_regs);
win32_tdesc = tdesc;
}
--- /dev/null
+/* Copyright (C) 2018 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef X86_TDESC_H
+
+/* The "expedite" registers for x86 targets. */
+static const char *i386_expedite_regs[] = {"ebp", "esp", "eip", NULL};
+
+/* The "expedite" registers for x86_64 targets. */
+static const char *amd64_expedite_regs[] = {"rbp", "rsp", "rip", NULL};
+
+#endif /* X86_TDESC_H */
cat <<EOF
#ifndef IN_PROCESS_AGENT
- result->expedite_regs = expedite_regs_${name};
result->xmltarget = xmltarget_${name};
#endif
- init_target_desc (result);
+ init_target_desc (result, expedite_regs_${name});
tdesc_${name} = result;
}