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.
This commit is contained in:
Daniel Jacobowitz
2002-02-14 06:21:24 +00:00
parent 4cc841d043
commit 0a30fbc4cf
19 changed files with 1060 additions and 1302 deletions

View File

@ -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

View File

@ -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 */