X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fregformats%2Fregdat.sh;h=06f1ffc4305b8975f5ed3030308134516bf62985;hb=3b20124b3d6df31b5bde0f6bcd718cc40de8d49b;hp=afc9e697e82b7c729f15e5fbfc7923c4dd174fc6;hpb=dcf7800bb53ac8fb8bece9760f4584713d258b03;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh index afc9e697e8..06f1ffc430 100755 --- a/gdb/regformats/regdat.sh +++ b/gdb/regformats/regdat.sh @@ -1,7 +1,7 @@ #!/bin/sh -u # Register protocol definitions for GDB, the GNU debugger. -# Copyright 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is part of GDB. # @@ -18,18 +18,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -move_if_change () -{ - file=$1 - if test -r ${file} && cmp -s "${file}" new-"${file}" - then - echo "${file} unchanged." 1>&2 - else - mv new-"${file}" "${file}" - echo "${file} updated." 1>&2 - fi -} - # Format of the input files read="type entry" @@ -94,7 +82,7 @@ cat < new-$2 copyright $1 +echo '#include "server.h"' echo '#include "regdef.h"' -echo '#include "regcache.h"' +echo '#include "tdesc.h"' echo offset=0 i=0 @@ -129,12 +118,21 @@ xmltarget=x xmlarch=x xmlosabi=x expedite=x +feature=x exec < $1 while do_read do if test "${type}" = "name"; then name="${entry}" - echo "struct reg regs_${name}[] = {" + + echo "const struct target_desc *tdesc_${name};" + echo "" + echo "void" + echo "init_registers_${name} (void)" + echo "{" + echo " static struct target_desc tdesc_${name}_s;" + echo " struct target_desc *result = &tdesc_${name}_s;" + echo " struct tdesc_feature *feature = tdesc_create_feature (result, \"${name}\");" continue elif test "${type}" = "xmltarget"; then xmltarget="${entry}" @@ -148,24 +146,32 @@ do elif test "${type}" = "expedite"; then expedite="${entry}" continue + elif test "${type}" = "feature"; then + feature="${entry}" + continue elif test "${name}" = x; then echo "$0: $1 does not specify \`\`name''." 1>&2 exit 1 else - echo " { \"${entry}\", ${offset}, ${type} }," + echo " tdesc_create_reg (feature, \"${entry}\"," + echo " 0, 0, NULL, ${type}, NULL);" + offset=`expr ${offset} + ${type}` i=`expr $i + 1` fi done -echo "};" echo -echo "const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/", "/g'`\", 0 };" -if test "${xmltarget}" = x; then +echo "static const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/", "/g'`\", 0 };" + +echo "#ifndef IN_PROCESS_AGENT" +if test "${feature}" != x; then + echo "static const char *xmltarget_${name} = 0;" +elif test "${xmltarget}" = x; then if test "${xmlarch}" = x && test "${xmlosabi}" = x; then - echo "const char *xmltarget_${name} = 0;" + echo "static const char *xmltarget_${name} = 0;" else - echo "const char *xmltarget_${name} = \"@\\" + echo "static const char *xmltarget_${name} = \"@\\" if test "${xmlarch}" != x; then echo "${xmlarch}\\" fi @@ -175,21 +181,20 @@ if test "${xmltarget}" = x; then echo "\";" fi else - echo "const char *xmltarget_${name} = \"${xmltarget}\";" + echo "static const char *xmltarget_${name} = \"${xmltarget}\";" fi echo cat <xmltarget = xmltarget_${name}; +#endif + + init_target_desc (result, expedite_regs_${name}); + + tdesc_${name} = result; } EOF # close things off exec 1>&2 -move_if_change $2 +mv -- "new-$2" "$2"