| OLD | NEW |
| 1 #!/bin/sh -u | 1 #!/bin/sh -u |
| 2 | 2 |
| 3 # Register protocol definitions for GDB, the GNU debugger. | 3 # Register protocol definitions for GDB, the GNU debugger. |
| 4 # Copyright 2001-2002, 2007-2012 Free Software Foundation, Inc. | 4 # Copyright (C) 2001-2013 Free Software Foundation, Inc. |
| 5 # | 5 # |
| 6 # This file is part of GDB. | 6 # This file is part of GDB. |
| 7 # | 7 # |
| 8 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 10 # the Free Software Foundation; either version 3 of the License, or |
| 11 # (at your option) any later version. | 11 # (at your option) any later version. |
| 12 # | 12 # |
| 13 # This program is distributed in the hope that it will be useful, | 13 # This program is distributed in the hope that it will be useful, |
| 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 echo "$0: Could not open $1." 1>&2 | 87 echo "$0: Could not open $1." 1>&2 |
| 88 exit 1 | 88 exit 1 |
| 89 fi | 89 fi |
| 90 | 90 |
| 91 copyright () | 91 copyright () |
| 92 { | 92 { |
| 93 cat <<EOF | 93 cat <<EOF |
| 94 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ | 94 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
| 95 | 95 |
| 96 /* A register protocol for GDB, the GNU debugger. | 96 /* A register protocol for GDB, the GNU debugger. |
| 97 Copyright 2001, 2002 Free Software Foundation, Inc. | 97 Copyright (C) 2001-2013 Free Software Foundation, Inc. |
| 98 | 98 |
| 99 This file is part of GDB. | 99 This file is part of GDB. |
| 100 | 100 |
| 101 This program is free software; you can redistribute it and/or modify | 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 | 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 | 103 the Free Software Foundation; either version 3 of the License, or |
| 104 (at your option) any later version. | 104 (at your option) any later version. |
| 105 | 105 |
| 106 This program is distributed in the hope that it will be useful, | 106 This program is distributed in the hope that it will be useful, |
| 107 but WITHOUT ANY WARRANTY; without even the implied warranty of | 107 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 108 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 108 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 109 GNU General Public License for more details. | 109 GNU General Public License for more details. |
| 110 | 110 |
| 111 You should have received a copy of the GNU General Public License | 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/>. */ | 112 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 113 | 113 |
| 114 /* This file was created with the aid of \`\`regdat.sh'' and \`\`$1''. */ | 114 /* This file was created with the aid of \`\`regdat.sh'' and \`\`$1''. */ |
| 115 | 115 |
| 116 EOF | 116 EOF |
| 117 } | 117 } |
| 118 | 118 |
| 119 | 119 |
| 120 exec > new-$2 | 120 exec > new-$2 |
| 121 copyright $1 | 121 copyright $1 |
| 122 echo '#include "server.h"' | 122 echo '#include "server.h"' |
| 123 echo '#include "regdef.h"' | 123 echo '#include "regdef.h"' |
| 124 echo '#include "tdesc.h"' |
| 124 echo | 125 echo |
| 125 offset=0 | 126 offset=0 |
| 126 i=0 | 127 i=0 |
| 127 name=x | 128 name=x |
| 128 xmltarget=x | 129 xmltarget=x |
| 129 xmlarch=x | 130 xmlarch=x |
| 130 xmlosabi=x | 131 xmlosabi=x |
| 131 expedite=x | 132 expedite=x |
| 132 exec < $1 | 133 exec < $1 |
| 133 while do_read | 134 while do_read |
| 134 do | 135 do |
| 135 if test "${type}" = "name"; then | 136 if test "${type}" = "name"; then |
| 136 name="${entry}" | 137 name="${entry}" |
| 137 echo "struct reg regs_${name}[] = {" | 138 echo "static struct reg regs_${name}[] = {" |
| 138 continue | 139 continue |
| 139 elif test "${type}" = "xmltarget"; then | 140 elif test "${type}" = "xmltarget"; then |
| 140 xmltarget="${entry}" | 141 xmltarget="${entry}" |
| 141 continue | 142 continue |
| 142 elif test "${type}" = "xmlarch"; then | 143 elif test "${type}" = "xmlarch"; then |
| 143 xmlarch="${entry}" | 144 xmlarch="${entry}" |
| 144 continue | 145 continue |
| 145 elif test "${type}" = "osabi"; then | 146 elif test "${type}" = "osabi"; then |
| 146 xmlosabi="${entry}" | 147 xmlosabi="${entry}" |
| 147 continue | 148 continue |
| 148 elif test "${type}" = "expedite"; then | 149 elif test "${type}" = "expedite"; then |
| 149 expedite="${entry}" | 150 expedite="${entry}" |
| 150 continue | 151 continue |
| 151 elif test "${name}" = x; then | 152 elif test "${name}" = x; then |
| 152 echo "$0: $1 does not specify \`\`name''." 1>&2 | 153 echo "$0: $1 does not specify \`\`name''." 1>&2 |
| 153 exit 1 | 154 exit 1 |
| 154 else | 155 else |
| 155 echo " { \"${entry}\", ${offset}, ${type} }," | 156 echo " { \"${entry}\", ${offset}, ${type} }," |
| 156 offset=`expr ${offset} + ${type}` | 157 offset=`expr ${offset} + ${type}` |
| 157 i=`expr $i + 1` | 158 i=`expr $i + 1` |
| 158 fi | 159 fi |
| 159 done | 160 done |
| 160 | 161 |
| 161 echo "};" | 162 echo "};" |
| 162 echo | 163 echo |
| 163 echo "const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/",
"/g'`\", 0 };" | 164 echo "static const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed '
s/,/", "/g'`\", 0 };" |
| 164 if test "${xmltarget}" = x; then | 165 if test "${xmltarget}" = x; then |
| 165 if test "${xmlarch}" = x && test "${xmlosabi}" = x; then | 166 if test "${xmlarch}" = x && test "${xmlosabi}" = x; then |
| 166 echo "const char *xmltarget_${name} = 0;" | 167 echo "static const char *xmltarget_${name} = 0;" |
| 167 else | 168 else |
| 168 echo "const char *xmltarget_${name} = \"@<target>\\" | 169 echo "static const char *xmltarget_${name} = \"@<target>\\" |
| 169 if test "${xmlarch}" != x; then | 170 if test "${xmlarch}" != x; then |
| 170 echo "<architecture>${xmlarch}</architecture>\\" | 171 echo "<architecture>${xmlarch}</architecture>\\" |
| 171 fi | 172 fi |
| 172 if test "${xmlosabi}" != x; then | 173 if test "${xmlosabi}" != x; then |
| 173 echo "<osabi>${xmlosabi}</osabi>\\" | 174 echo "<osabi>${xmlosabi}</osabi>\\" |
| 174 fi | 175 fi |
| 175 echo "</target>\";" | 176 echo "</target>\";" |
| 176 fi | 177 fi |
| 177 else | 178 else |
| 178 echo "const char *xmltarget_${name} = \"${xmltarget}\";" | 179 echo "static const char *xmltarget_${name} = \"${xmltarget}\";" |
| 179 fi | 180 fi |
| 180 echo | 181 echo |
| 181 | 182 |
| 182 cat <<EOF | 183 cat <<EOF |
| 184 const struct target_desc *tdesc_${name}; |
| 185 |
| 183 void | 186 void |
| 184 init_registers_${name} () | 187 init_registers_${name} (void) |
| 185 { | 188 { |
| 186 set_register_cache (regs_${name}, | 189 static struct target_desc tdesc_${name}_s; |
| 187 » » » sizeof (regs_${name}) / sizeof (regs_${name}[0])); | 190 struct target_desc *result = &tdesc_${name}_s; |
| 188 gdbserver_expedite_regs = expedite_regs_${name}; | 191 |
| 189 gdbserver_xmltarget = xmltarget_${name}; | 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}; |
| 196 |
| 197 init_target_desc (result); |
| 198 |
| 199 tdesc_${name} = result; |
| 190 } | 200 } |
| 191 EOF | 201 EOF |
| 192 | 202 |
| 193 # close things off | 203 # close things off |
| 194 exec 1>&2 | 204 exec 1>&2 |
| 195 move_if_change $2 | 205 move_if_change $2 |
| OLD | NEW |