From adc764e7d217d3e56af988ce20cedc98d8c4cc73 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Thu, 29 Jun 2017 12:41:50 +0100 Subject: [PATCH] Use target_desc fields expedite_regs and xmltarget ifndef IN_PROCESS_AGENT struct target_desc is used by both GDBserver and IPA, but fields expedite_regs and xmltarget are only used in GDBserver, so this patch wraps these two fields by ifndef IN_PROCESS_AGENT. This patch also changes regformats/regdat.sh to generate .c files in this way too. gdb/gdbserver: 2017-06-29 Yao Qi * tdesc.h (struct target_desc) [IN_PROCESS_AGENT] : Remove. [IN_PROCESS_AGENT] : Likewise. gdb: 2017-06-29 Yao Qi * regformats/regdat.sh: Generate code with "ifndef IN_PROCESS_AGENT". --- gdb/ChangeLog | 5 +++++ gdb/gdbserver/ChangeLog | 6 ++++++ gdb/gdbserver/tdesc.h | 2 ++ gdb/regformats/regdat.sh | 3 +++ 4 files changed, 16 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a82026f95e6..9be08dda1fe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-06-29 Yao Qi + + * regformats/regdat.sh: Generate code with + "ifndef IN_PROCESS_AGENT". + 2017-06-28 Pedro Alves * command.h: Include "common/scoped_restore.h". diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 63b54f6f77b..4ae5b33b591 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2017-06-29 Yao Qi + + * tdesc.h (struct target_desc) [IN_PROCESS_AGENT] : + Remove. + [IN_PROCESS_AGENT] : Likewise. + 2017-06-20 Simon Marchi * Makefile.in (IPA_OBJS): Sort and format one item per line. diff --git a/gdb/gdbserver/tdesc.h b/gdb/gdbserver/tdesc.h index ada879dfa91..034127864be 100644 --- a/gdb/gdbserver/tdesc.h +++ b/gdb/gdbserver/tdesc.h @@ -36,6 +36,7 @@ struct target_desc /* The register cache size, in bytes. */ int registers_size; +#ifndef IN_PROCESS_AGENT /* An array of register names. These are the "expedite" registers: registers whose values are sent along with stop replies. */ const char **expedite_regs; @@ -45,6 +46,7 @@ struct target_desc verbatim XML code (prefixed with a '@') or else the name of the actual XML file to be used in place of "target.xml". */ const char *xmltarget; +#endif }; /* Copy target description SRC to DEST. */ diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh index 4c733521086..651f70392ca 100755 --- a/gdb/regformats/regdat.sh +++ b/gdb/regformats/regdat.sh @@ -179,8 +179,11 @@ init_registers_${name} (void) result->reg_defs = regs_${name}; result->num_registers = sizeof (regs_${name}) / sizeof (regs_${name}[0]); + +#ifndef IN_PROCESS_AGENT result->expedite_regs = expedite_regs_${name}; result->xmltarget = xmltarget_${name}; +#endif init_target_desc (result); -- 2.30.2