summaryrefslogtreecommitdiff
path: root/gdb/regformats
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2002-02-14 06:21:24 +0000
committerDaniel Jacobowitz <dan@debian.org>2002-02-14 06:21:24 +0000
commit791108862c4c03ec38984a5486cc5a91f4c69f88 (patch)
treefff41cca2428abfc862c11a9f0f8dbb221a44fa6 /gdb/regformats
parentf30a45ac9b56c4b3beffc0e235424c9494864e4f (diff)
downloadgdb-791108862c4c03ec38984a5486cc5a91f4c69f88.tar.gz
2002-02-14 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS, and remove unused $(INCLUDE_DIR). Add regcache.c to OBS. Add generated register protocol files to clean target. Update dependencies for new objects, obsolete old target code. * gdbserver/linux-low.c: Remove all platform-specific code to new files. Remove various dead code. Update to use regcache functionality. * gdbserver/remote-utils.c (fromhex): Add return statement to quiet warning. (putpkt): Dynamically allocate buf2 because PBUFSIZ is no longer constant. (input_interrupt): Add integer parameter to match prototype of a signal handler. (outreg): Use register_data (). (prepare_resume_reply): Use gdbserver_expedite_regs. * gdbserver/server.c (main): Dynamically allocate own_buf because PBUFSIZ is no longer constant. Use registers_to_string () and registers_from_string (). * gdbserver/server.h: No longer include "defs.h". Add prototypes for error (), fatal (), and warning (). Update definition of PBUFSIZ to use regcache functionality. Add include guard. * gdbserver/utils.c (fatal): Add missing ``const''. (warning): New function. * regformats/regdat.sh: Include "regcache.h" in generated files. Provide init_registers () function. * regformats/regdef.h: Add prototype for set_register_cache (). Add include guard. * gdbserver/linux-arm-low.c: New file. * gdbserver/linux-i386-low.c: New file. * gdbserver/linux-ia64-low.c: New file. * gdbserver/linux-m68k-low.c: New file. * gdbserver/linux-mips-low.c: New file. * gdbserver/linux-ppc-low.c: New file. * gdbserver/linux-sh-low.c: New file. * gdbserver/regcache.c: New file. * gdbserver/regcache.h: New file. * gdbserver/low-linux.c: Removed obsolete file.
Diffstat (limited to 'gdb/regformats')
-rwxr-xr-xgdb/regformats/regdat.sh12
-rw-r--r--gdb/regformats/regdef.h10
2 files changed, 22 insertions, 0 deletions
diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh
index eb0475e4ddb..9035b3dc90d 100755
--- a/gdb/regformats/regdat.sh
+++ b/gdb/regformats/regdat.sh
@@ -123,6 +123,7 @@ EOF
exec > new-$2
copyright $1
echo '#include "regdef.h"'
+echo '#include "regcache.h"'
echo
offset=0
i=0
@@ -151,6 +152,17 @@ done
echo "};"
echo
echo "const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/", "/g'`\", 0 };"
+echo
+
+cat <<EOF
+void
+init_registers ()
+{
+ set_register_cache (regs_${name},
+ sizeof (regs_${name}) / sizeof (regs_${name}[0]));
+ gdbserver_expedite_regs = expedite_regs_${name};
+}
+EOF
# close things off
exec 1>&2
diff --git a/gdb/regformats/regdef.h b/gdb/regformats/regdef.h
index 17174ee3c67..c1f862cc356 100644
--- a/gdb/regformats/regdef.h
+++ b/gdb/regformats/regdef.h
@@ -18,6 +18,9 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef REGDEF_H
+#define REGDEF_H
+
struct reg
{
/* The name of this register - NULL for pad entries. */
@@ -34,3 +37,10 @@ struct reg
/* The size (in bits) of the value of this register, as transmitted. */
int size;
};
+
+/* Set the current remote protocol and register cache according to the array
+ ``regs'', with ``n'' elements. */
+
+void set_register_cache (struct reg *regs, int n);
+
+#endif /* REGDEF_H */