These files were part of GDB 4.16, but not version 4.18 (that we

currently use).
This commit is contained in:
obrien 2000-05-17 19:32:59 +00:00
parent ea10302aad
commit 52d65dc564
9 changed files with 0 additions and 777 deletions

View File

@ -1,16 +0,0 @@
echo Setting up the environment for debugging gdb.\n
set complaints 1
b fatal
b info_command
commands
silent
return
end
dir ../mmalloc
dir ../libiberty
dir ../bfd
set prompt (top-gdb)

View File

@ -1,354 +0,0 @@
/* Host callback routines for GDB.
Copyright 1995 Free Software Foundation, Inc.
Contributed by Cygnus Support.
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. */
/* This file provides a standard way for targets to talk to the host OS
level.
This interface will probably need a bit more banging to make it
smooth. Currently the simulator uses this file to provide the
callbacks for itself when it's built standalone, which is rather
ugly. */
#ifndef INSIDE_SIMULATOR
#include "defs.h"
#endif
#include "ansidecl.h"
#include "callback.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <time.h>
/* Set the callback copy of errno from what we see now. */
static int
wrap (p, val)
host_callback *p;
int val;
{
p->last_errno = errno;
return val;
}
/* Make sure the FD provided is ok. If not, return non-zero
and set errno. */
static int
fdbad (p, fd)
host_callback *p;
int fd;
{
if (fd < 0 || fd > MAX_CALLBACK_FDS || !p->fdopen[fd])
{
p->last_errno = EINVAL;
return -1;
}
return 0;
}
static int
fdmap (p, fd)
host_callback *p;
int fd;
{
return p->fdmap[fd];
}
int
os_close (p, fd)
host_callback *p;
int fd;
{
int result;
result = fdbad (p, fd);
if (result)
return result;
result = wrap (p, close (fdmap (p, fd)));
return result;
}
int
os_get_errno (p)
host_callback *p;
{
/* !!! fixme, translate from host to taget errno value */
return p->last_errno;
}
int
os_isatty (p, fd)
host_callback *p;
int fd;
{
int result;
result = fdbad (p, fd);
if (result)
return result;
result = wrap (p, isatty (fdmap (fd)));
return result;
}
int
os_lseek (p, fd, off, way)
host_callback *p;
int fd;
long off;
int way;
{
int result;
result = fdbad (p, fd);
if (result)
return result;
result = lseek (fdmap (p, fd), off, way);
return result;
}
int
os_open (p, name, flags)
host_callback *p;
const char *name;
int flags;
{
int i;
for (i = 0; i < MAX_CALLBACK_FDS; i++)
{
if (!p->fdopen[i])
{
int f = open (name, flags);
if (f < 0)
{
p->last_errno = errno;
return f;
}
p->fdopen[i] = 1;
p->fdmap[i] = f;
return i;
}
}
p->last_errno = EMFILE;
return -1;
}
int
os_read (p, fd, buf, len)
host_callback *p;
int fd;
char *buf;
int len;
{
int result;
result = fdbad (p, fd);
if (result)
return result;
result = wrap (p, read (fdmap (p, fd), buf, len));
return result;
}
int
os_read_stdin (p, buf, len)
host_callback *p;
char *buf;
int len;
{
return wrap (p, read (0, buf, len));
}
int
os_write (p, fd, buf, len)
host_callback *p;
int fd;
const char *buf;
int len;
{
int result;
result = fdbad (p, fd);
if (result)
return result;
result = wrap (p, write (fdmap (p, fd), buf, len));
return result;
}
/* ignore the grossness of INSIDE_SIMULATOR, it will go away one day. */
int
os_write_stdout (p, buf, len)
host_callback *p;
const char *buf;
int len;
{
#ifdef INSIDE_SIMULATOR
return os_write (p, 1, buf, len);
#else
int i;
char b[2];
for (i = 0; i< len; i++)
{
b[0] = buf[i];
b[1] = 0;
if (target_output_hook)
target_output_hook (b);
else
fputs_filtered (b, gdb_stdout);
}
return len;
#endif
}
int
os_rename (p, f1, f2)
host_callback *p;
const char *f1;
const char *f2;
{
return wrap (p, rename (f1, f2));
}
int
os_system (p, s)
host_callback *p;
const char *s;
{
return wrap (p, system (s));
}
long
os_time (p, t)
host_callback *p;
long *t;
{
time_t now;
wrap (p, (int) time (&now));
if (t != NULL)
*t = (long) now;
return (long) now;
}
int
os_unlink (p, f1)
host_callback *p;
const char *f1;
{
return wrap (p, unlink (f1));
}
int
os_shutdown (p)
host_callback *p;
{
int i;
for (i = 0; i < MAX_CALLBACK_FDS; i++)
{
if (p->fdopen[i] && !p->alwaysopen[i]) {
close (p->fdmap[i]);
p->fdopen[i] = 0;
}
}
return 1;
}
int os_init(p)
host_callback *p;
{
int i;
os_shutdown (p);
for (i= 0; i < 3; i++)
{
p->fdmap[i] = i;
p->fdopen[i] = 1;
p->alwaysopen[i] = 1;
}
return 1;
}
/* !!fixme!!
This bit is ugly. When the interface has settled down I'll
move the whole file into sim/common and remove this bit. */
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
os_printf_filtered (host_callback *p, const char *format, ...)
#else
os_printf_filtered (p, va_alist)
host_callback *p;
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
char *format;
va_start (args);
format = va_arg (args, char *);
#endif
#ifdef INSIDE_SIMULATOR
vprintf (format, args);
#else
vfprintf_filtered (stdout, format, args);
#endif
va_end (args);
}
host_callback default_callback =
{
os_close,
os_get_errno,
os_isatty,
os_lseek,
os_open,
os_read,
os_read_stdin,
os_rename,
os_system,
os_time,
os_unlink,
os_write,
os_write_stdout,
os_shutdown,
os_init,
os_printf_filtered,
0, /* last errno */
};

View File

@ -1,41 +0,0 @@
#ifndef CALLBACK_H
#define CALLBACK_H
typedef struct host_callback_struct host_callback;
#define MAX_CALLBACK_FDS 10
struct host_callback_struct
{
int (*close) PARAMS ((host_callback *,int));
int (*get_errno) PARAMS ((host_callback *));
int (*isatty) PARAMS ((host_callback *, int));
int (*lseek) PARAMS ((host_callback *, int, long , int));
int (*open) PARAMS ((host_callback *, const char*, int mode));
int (*read) PARAMS ((host_callback *,int, char *, int));
int (*read_stdin) PARAMS (( host_callback *, char *, int));
int (*rename) PARAMS ((host_callback *, const char *, const char *));
int (*system) PARAMS ((host_callback *, const char *));
long (*time) PARAMS ((host_callback *, long *));
int (*unlink) PARAMS ((host_callback *, const char *));
int (*write) PARAMS ((host_callback *,int, const char *, int));
int (*write_stdout) PARAMS ((host_callback *, const char *, int));
/* Used when the target has gone away, so we can close open
handles and free memory etc etc. */
int (*shutdown) PARAMS ((host_callback *));
int (*init) PARAMS ((host_callback *));
/* Talk to the user on a console. */
void (*printf_filtered) PARAMS ((host_callback *, const char *, ...));
int last_errno; /* host format */
int fdmap[MAX_CALLBACK_FDS];
char fdopen[MAX_CALLBACK_FDS];
char alwaysopen[MAX_CALLBACK_FDS];
};
#endif
extern host_callback default_callback;

View File

@ -1,6 +0,0 @@
MH_CFLAGS=
XM_FILE=xm-cygwin32.h
TERMCAP=
NATDEPFILES=win32-nat.o
XM_CLIBS=-lkernel32

View File

@ -1,6 +0,0 @@
# Target: Intel 386 run win32
TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-cygwin32.h

View File

@ -1,125 +0,0 @@
/* Macro definitions for i386 running under the win32 API Unix.
Copyright 1995, 1996 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 "i386/tm-i386v.h"
#undef MAX_REGISTER_RAW_SIZE
#undef MAX_REGISTER_VIRTUAL_SIZE
#undef NUM_REGS
#undef REGISTER_BYTE
#undef REGISTER_BYTES
#undef REGISTER_CONVERTIBLE
#undef REGISTER_CONVERT_TO_RAW
#undef REGISTER_CONVERT_TO_VIRTUAL
#undef REGISTER_NAMES
#undef REGISTER_RAW_SIZE
#undef REGISTER_VIRTUAL_SIZE
#undef REGISTER_VIRTUAL_TYPE
/* Number of machine registers */
#define NUM_REGS 24
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
/* the order of the first 8 registers must match the compiler's
* numbering scheme (which is the same as the 386 scheme)
* also, this table must match regmap in i386-pinsn.c.
*/
#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
"esp", "ebp", "esi", "edi", \
"eip", "ps", "cs", "ss", \
"ds", "es", "fs", "gs", \
"st", "st(1)","st(2)","st(3)",\
"st(4)","st(5)","st(6)","st(7)",}
#define FP0_REGNUM 16
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
#define REGISTER_BYTES (16 * 4 + 8 * 10)
/* Index within `registers' of the first byte of the space for
register N. */
#define REGISTER_BYTE(N) (((N) < 16) ? (N) * 4 : (((N) - 16) * 10) + (16 * 4))
/* Number of bytes of storage in the actual machine representation
for register N. */
#define REGISTER_RAW_SIZE(N) (((N) < 16) ? 4 : 10)
/* Number of bytes of storage in the program's representation
for register N. */
#define REGISTER_VIRTUAL_SIZE(N) (((N) < 16) ? 4 : 10)
/* Largest value REGISTER_RAW_SIZE can have. */
#define MAX_REGISTER_RAW_SIZE 10
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
#define MAX_REGISTER_VIRTUAL_SIZE 10
/* Nonzero if register N requires conversion
from raw format to virtual format. */
#define REGISTER_CONVERTIBLE(N) \
((N < FP0_REGNUM) ? 0 : 1)
/* Convert data from raw format for register REGNUM in buffer FROM
to virtual format with type TYPE in buffer TO. */
extern void
i387_to_double PARAMS ((char *, char *));
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
{ \
double val; \
i387_to_double ((FROM), (char *)&val); \
store_floating ((TO), TYPE_LENGTH (TYPE), val); \
}
extern void
double_to_i387 PARAMS ((char *, char *));
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
{ \
double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
double_to_i387((char *)&val, (TO)); \
}
/* Return the GDB type object for the "standard" data type
of data in register N. */
#define REGISTER_VIRTUAL_TYPE(N) \
((N < FP0_REGNUM) ? builtin_type_int : \
builtin_type_double)
#define NAMES_HAVE_UNDERSCORE
#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name)
#define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, 0)
extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR pc, char *name));

View File

@ -1,41 +0,0 @@
/* Definitions for hosting on WIN32, for GDB.
Copyright 1995, 1996 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. */
#define HOST_BYTE_ORDER LITTLE_ENDIAN
#include "fopen-bin.h"
#define GDBINIT_FILENAME "gdb.ini"
#define SLASH_P(X) ((X)=='\\' || (X) == '/')
#define ROOTED_P(X) ((SLASH_P((X)[0]))|| ((X)[1] ==':'))
#define SLASH_CHAR '/'
#define SLASH_STRING "/"
/* If we longjmp out of the signal handler we never get another one.
So disable immediate_quit inside request_quit */
#define REQUEST_QUIT

View File

@ -1,142 +0,0 @@
/* This file defines the interface between the simulator and gdb.
Copyright (C) 1993, 1994 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. */
#if !defined (REMOTE_SIM_H)
#define REMOTE_SIM_H 1
#include "callback.h"
/* This file is used when building stand-alone simulators, so isolate this
file from gdb. */
/* Pick up CORE_ADDR_TYPE if defined (from gdb), otherwise use same value as
gdb does (unsigned int - from defs.h). */
#ifndef CORE_ADDR_TYPE
typedef unsigned int SIM_ADDR;
#else
typedef CORE_ADDR_TYPE SIM_ADDR;
#endif
/* Callbacks.
The simulator may use the following callbacks (gdb routines) which the
standalone program must provide.
void printf_filtered (char *msg, ...);
void error /-* noreturn *-/ (char *msg, ...);
void *xmalloc (long size);
int sim_callback_write_stdout (char *, int len);
The new way of doing I/O is to use the pointer provided by GDB
via the sim_set_callbacks call, look in callbacks.c to see what
can be done.
*/
/* Main simulator entry points ...
All functions that can get an error must call the gdb routine `error',
they can only return upon success. */
/* Initialize the simulator. This function is called when the simulator
is selected from the command line. ARGS is passed from the command line
and can be used to select whatever run time options the simulator provides.
ARGS is the raw character string and must be parsed by the simulator,
which is trivial to do with the buildargv function in libiberty.
It is ok to do nothing. */
void sim_open PARAMS ((char *args));
/* Terminate usage of the simulator. This may involve freeing target memory
and closing any open files and mmap'd areas. You cannot assume sim_kill
has already been called.
QUITTING is non-zero if we cannot hang on errors. */
void sim_close PARAMS ((int quitting));
/* Load program PROG into the simulator.
Return non-zero if you wish the caller to handle it
(it is done this way because most simulators can use gr_load_image,
but defining it as a callback seems awkward). */
int sim_load PARAMS ((char *prog, int from_tty));
/* Prepare to run the simulated program.
START_ADDRESS is, yes, you guessed it, the start address of the program.
ARGV and ENV are NULL terminated lists of pointers.
Gdb will set the start address via sim_store_register as well, but
standalone versions of existing simulators are not set up to cleanly call
sim_store_register, so the START_ADDRESS argument is there as a
workaround. */
void sim_create_inferior PARAMS ((SIM_ADDR start_address,
char **argv, char **env));
/* Kill the running program.
This may involve closing any open files and deleting any mmap'd areas. */
void sim_kill PARAMS ((void));
/* Read LENGTH bytes of the simulated program's memory and store in BUF.
Result is number of bytes read, or zero if error. */
int sim_read PARAMS ((SIM_ADDR mem, unsigned char *buf, int length));
/* Store LENGTH bytes from BUF in the simulated program's memory.
Result is number of bytes write, or zero if error. */
int sim_write PARAMS ((SIM_ADDR mem, unsigned char *buf, int length));
/* Fetch register REGNO and store the raw value in BUF. */
void sim_fetch_register PARAMS ((int regno, unsigned char *buf));
/* Store register REGNO from BUF (in raw format). */
void sim_store_register PARAMS ((int regno, unsigned char *buf));
/* Print some interesting information about the simulator.
VERBOSE is non-zero for the wordy version. */
void sim_info PARAMS ((int verbose));
/* Fetch why the program stopped.
SIGRC will contain either the argument to exit() or the signal number. */
enum sim_stop { sim_exited, sim_stopped, sim_signalled };
void sim_stop_reason PARAMS ((enum sim_stop *reason, int *sigrc));
/* Run (or resume) the program. */
void sim_resume PARAMS ((int step, int siggnal));
/* Passthru for other commands that the simulator might support. */
void sim_do_command PARAMS ((char *cmd));
/* Callbacks for the simulator to use. */
int sim_callback_write_stdout PARAMS ((char *, int));
/* Provide simulator with a standard host_callback_struct. */
void sim_set_callbacks PARAMS ((struct host_callback_struct *));
#endif /* !defined (REMOTE_SIM_H) */

View File

@ -1,46 +0,0 @@
/* Multi-process/thread control defs for GDB, the GNU debugger.
Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993
Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA.
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. */
#ifndef THREAD_H
#define THREAD_H
extern void init_thread_list PARAMS ((void));
extern void add_thread PARAMS ((int pid));
extern int in_thread_list PARAMS ((int pid));
extern int pid_to_thread_id PARAMS ((int pid));
extern int valid_thread_id PARAMS ((int thread));
extern void load_infrun_state PARAMS ((int, CORE_ADDR *, CORE_ADDR *, char **,
int *, struct breakpoint **,
struct breakpoint **, CORE_ADDR *,
CORE_ADDR *, CORE_ADDR *, int *, int *));
extern void save_infrun_state PARAMS ((int, CORE_ADDR, CORE_ADDR, char *,
int, struct breakpoint *,
struct breakpoint *, CORE_ADDR,
CORE_ADDR, CORE_ADDR, int, int));
#endif /* THREAD_H */