3 # Register protocol definitions for GDB, the GNU debugger.
4 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
6 # This file is part of GDB.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 if test -r ${file} && cmp -s "${file}" new-"${file}"
26 echo "${file} unchanged.
" 1>&2
28 mv new-"${file}" "${file}"
29 echo "${file} updated.
" 1>&2
33 # Format of the input files
42 if test "${line}" = ""
45 elif test "${line}" = "#" -a "${comment}" = ""
48 elif expr "${line}" : "#" > /dev
/null
54 # The semantics of IFS varies between different SH's. Some
55 # treat ``::' as three fields while some treat it as just too.
56 # Work around this by eliminating ``::'' ....
57 line
="`echo "${line}" | sed -e 's/::/: :/g' -e 's/::/: :/g'`"
59 OFS
="${IFS}" ; IFS
="[:]"
60 eval read ${read} <<EOF
65 # .... and then going back through each field and strip out those
66 # that ended up with just that space character.
69 if eval test \"\
${${r}}\" = \"\
\"
87 echo "$0: Could not open $1." 1>&2
94 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
96 /* A register protocol for GDB, the GNU debugger.
97 Copyright (C) 2001-2013 Free Software Foundation, Inc.
99 This file is part of GDB.
101 This program is free software; you can redistribute it and/or modify
102 it under the terms of the GNU General Public License as published by
103 the Free Software Foundation; either version 3 of the License, or
104 (at your option) any later version.
106 This program is distributed in the hope that it will be useful,
107 but WITHOUT ANY WARRANTY; without even the implied warranty of
108 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
109 GNU General Public License for more details.
111 You should have received a copy of the GNU General Public License
112 along with this program. If not, see <http://www.gnu.org/licenses/>. */
114 /* This file was created with the aid of \`\`regdat.sh'' and \`\`$1''. */
122 echo '#include "server.h"'
123 echo '#include "regdef.h"'
124 echo '#include "tdesc.h"'
136 if test "${type}" = "name"; then
138 echo "static struct reg regs_${name}[] = {"
140 elif test "${type}" = "xmltarget"; then
143 elif test "${type}" = "xmlarch"; then
146 elif test "${type}" = "osabi"; then
149 elif test "${type}" = "expedite"; then
152 elif test "${name}" = x
; then
153 echo "$0: $1 does not specify \`\`name''." 1>&2
156 echo " { \"${entry}\", ${offset}, ${type} },"
157 offset
=`expr ${offset} + ${type}`
164 echo "static const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/", "/g'`\", 0 };"
165 if test "${xmltarget}" = x
; then
166 if test "${xmlarch}" = x
&& test "${xmlosabi}" = x
; then
167 echo "static const char *xmltarget_${name} = 0;"
169 echo "static const char *xmltarget_${name} = \"@<target>\\"
170 if test "${xmlarch}" != x
; then
171 echo "<architecture>${xmlarch}</architecture>\\"
173 if test "${xmlosabi}" != x
; then
174 echo "<osabi>${xmlosabi}</osabi>\\"
179 echo "static const char *xmltarget_${name} = \"${xmltarget}\";"
184 const struct target_desc *tdesc_${name};
187 init_registers_${name} (void)
189 static struct target_desc tdesc_${name}_s;
190 struct target_desc *result = &tdesc_${name}_s;
192 result->reg_defs = regs_${name};
193 result->num_registers = sizeof (regs_${name}) / sizeof (regs_${name}[0]);
194 result->expedite_regs = expedite_regs_${name};
195 result->xmltarget = xmltarget_${name};
197 init_target_desc (result);
199 tdesc_${name} = result;
This page took 0.068231 seconds and 4 git commands to generate.