forked from Imagelibrary/binutils-gdb
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:
64
gdb/gdbserver/linux-m68k-low.c
Normal file
64
gdb/gdbserver/linux-m68k-low.c
Normal file
@@ -0,0 +1,64 @@
|
||||
/* GNU/Linux/m68k specific low level interface, for the remote server for GDB.
|
||||
Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "server.h"
|
||||
|
||||
#ifdef HAVE_SYS_REG_H
|
||||
#include <sys/reg.h>
|
||||
#endif
|
||||
|
||||
int num_regs = 31;
|
||||
|
||||
/* This table must line up with REGISTER_NAMES in tm-m68k.h */
|
||||
int regmap[] =
|
||||
{
|
||||
#ifdef PT_D0
|
||||
PT_D0 * 4, PT_D1 * 4, PT_D2 * 4, PT_D3 * 4,
|
||||
PT_D4 * 4, PT_D5 * 4, PT_D6 * 4, PT_D7 * 4,
|
||||
PT_A0 * 4, PT_A1 * 4, PT_A2 * 4, PT_A3 * 4,
|
||||
PT_A4 * 4, PT_A5 * 4, PT_A6 * 4, PT_USP * 4,
|
||||
PT_SR * 4, PT_PC * 4,
|
||||
#else
|
||||
14 * 4, 0 * 4, 1 * 4, 2 * 4, 3 * 4, 4 * 4, 5 * 4, 6 * 4,
|
||||
7 * 4, 8 * 4, 9 * 4, 10 * 4, 11 * 4, 12 * 4, 13 * 4, 15 * 4,
|
||||
17 * 4, 18 * 4,
|
||||
#endif
|
||||
#ifdef PT_FP0
|
||||
PT_FP0 * 4, PT_FP1 * 4, PT_FP2 * 4, PT_FP3 * 4,
|
||||
PT_FP4 * 4, PT_FP5 * 4, PT_FP6 * 4, PT_FP7 * 4,
|
||||
PT_FPCR * 4, PT_FPSR * 4, PT_FPIAR * 4
|
||||
#else
|
||||
21 * 4, 24 * 4, 27 * 4, 30 * 4, 33 * 4, 36 * 4,
|
||||
39 * 4, 42 * 4, 45 * 4, 46 * 4, 47 * 4
|
||||
#endif
|
||||
};
|
||||
|
||||
int
|
||||
cannot_store_register (int regno)
|
||||
{
|
||||
return (regno >= num_regs);
|
||||
}
|
||||
|
||||
int
|
||||
cannot_fetch_register (int regno)
|
||||
{
|
||||
return (regno >= num_regs);
|
||||
}
|
||||
Reference in New Issue
Block a user