This commit was generated by cvs2svn to compensate for changes in r130805,

which included commits to RCS files with non-trunk default branches.
This commit is contained in:
Marcel Moolenaar 2004-06-20 19:05:30 +00:00
parent e8077c0e5b
commit 281ad6bf75
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130806
252 changed files with 0 additions and 154185 deletions

File diff suppressed because it is too large Load Diff

1320
contrib/gdb/config.guess vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,93 +0,0 @@
#! /dev/null
# Don't call it directly. This shell script fragment is called to
# determine:
#
# 1. libstcxx_interface: the interface name for libstdc++.
# 2. cxx_interface: the interface name for c++.
# 3. libc_interface: the interface name for libc.
#
# Get the top level src dir.
if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ]
then
echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2
exit 1
fi
if [ -n "${topsrcdir}" ]
then
if_topsrcdir=${topsrcdir}
else
if_topsrcdir=${top_srcdir}
fi
if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
else
libstdcxx_srcdir=${if_topsrcdir}/libstdc++
fi
if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then
# We check libstdc++ for libstdcxx_interface.
libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
else
libstdcxx_interface=
fi
if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then
# We check gcc/cp for cxx_interface.
cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
else
cxx_interface=
fi
# The trickiest part is libc_interface.
if [ -z "${libc_interface}" ]
then
case ${target_os} in
*linux*libc1*|*linux*libc5*)
case ${target_alias} in
*alpha*|*powerpc*)
libc_interface=-libc5.9-
;;
*)
libc_interface=-libc5-
;;
esac
;;
*linux*gnu*)
# We have to work harder to figure it out.
if [ ${target_alias} = ${build_alias} ]
then
dummy=if$$
cat >$dummy.c <<EOF
#include <features.h>
main(argc, argv)
int argc;
char *argv[];
{
printf("%d\n", __GLIBC_MINOR__);
return 0;
}
EOF
${CC-cc} $dummy.c -o $dummy 2>/dev/null
if [ "$?" = 0 ]
then
libc_interface=-libc6.`./$dummy`-
rm -f $dummy.c $dummy
else
# It should never happen.
echo "Cannot find the GNU C library minor version number." >&2
rm -f $dummy.c $dummy
exit 1
fi
else
# Cross compiling. Assume glibc 2.2.
libc_interface=-libc6.2-
fi
;;
*)
libc_interface=-
;;
esac
fi

1443
contrib/gdb/config.sub vendored

File diff suppressed because it is too large Load Diff

1625
contrib/gdb/configure vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,729 +0,0 @@
/* ARC target-dependent stuff.
Copyright 1995, 1996, 1999, 2000, 2001 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 "defs.h"
#include "frame.h"
#include "inferior.h"
#include "gdbcore.h"
#include "target.h"
#include "floatformat.h"
#include "symtab.h"
#include "gdbcmd.h"
#include "regcache.h"
/* Local functions */
static int arc_set_cpu_type (char *str);
/* Current CPU, set with the "set cpu" command. */
static int arc_bfd_mach_type;
char *arc_cpu_type;
char *tmp_arc_cpu_type;
/* Table of cpu names. */
struct
{
char *name;
int value;
}
arc_cpu_type_table[] =
{
{ "arc5", bfd_mach_arc_5 },
{ "arc6", bfd_mach_arc_6 },
{ "arc7", bfd_mach_arc_7 },
{ "arc8", bfd_mach_arc_8 },
{ NULL, 0 }
};
/* Used by simulator. */
int display_pipeline_p;
int cpu_timer;
/* This one must have the same type as used in the emulator.
It's currently an enum so this should be ok for now. */
int debug_pipeline_p;
#define ARC_CALL_SAVED_REG(r) ((r) >= 16 && (r) < 24)
#define OPMASK 0xf8000000
/* Instruction field accessor macros.
See the Programmer's Reference Manual. */
#define X_OP(i) (((i) >> 27) & 0x1f)
#define X_A(i) (((i) >> 21) & 0x3f)
#define X_B(i) (((i) >> 15) & 0x3f)
#define X_C(i) (((i) >> 9) & 0x3f)
#define X_D(i) ((((i) & 0x1ff) ^ 0x100) - 0x100)
#define X_L(i) (((((i) >> 5) & 0x3ffffc) ^ 0x200000) - 0x200000)
#define X_N(i) (((i) >> 5) & 3)
#define X_Q(i) ((i) & 0x1f)
/* Return non-zero if X is a short immediate data indicator. */
#define SHIMM_P(x) ((x) == 61 || (x) == 63)
/* Return non-zero if X is a "long" (32 bit) immediate data indicator. */
#define LIMM_P(x) ((x) == 62)
/* Build a simple instruction. */
#define BUILD_INSN(op, a, b, c, d) \
((((op) & 31) << 27) \
| (((a) & 63) << 21) \
| (((b) & 63) << 15) \
| (((c) & 63) << 9) \
| ((d) & 511))
/* Codestream stuff. */
static void codestream_read (unsigned int *, int);
static void codestream_seek (CORE_ADDR);
static unsigned int codestream_fill (int);
#define CODESTREAM_BUFSIZ 16
static CORE_ADDR codestream_next_addr;
static CORE_ADDR codestream_addr;
/* FIXME assumes sizeof (int) == 32? */
static unsigned int codestream_buf[CODESTREAM_BUFSIZ];
static int codestream_off;
static int codestream_cnt;
#define codestream_tell() \
(codestream_addr + codestream_off * sizeof (codestream_buf[0]))
#define codestream_peek() \
(codestream_cnt == 0 \
? codestream_fill (1) \
: codestream_buf[codestream_off])
#define codestream_get() \
(codestream_cnt-- == 0 \
? codestream_fill (0) \
: codestream_buf[codestream_off++])
static unsigned int
codestream_fill (int peek_flag)
{
codestream_addr = codestream_next_addr;
codestream_next_addr += CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]);
codestream_off = 0;
codestream_cnt = CODESTREAM_BUFSIZ;
read_memory (codestream_addr, (char *) codestream_buf,
CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]));
/* FIXME: check return code? */
/* Handle byte order differences -> convert to host byte ordering. */
{
int i;
for (i = 0; i < CODESTREAM_BUFSIZ; i++)
codestream_buf[i] =
extract_unsigned_integer (&codestream_buf[i],
sizeof (codestream_buf[i]));
}
if (peek_flag)
return codestream_peek ();
else
return codestream_get ();
}
static void
codestream_seek (CORE_ADDR place)
{
codestream_next_addr = place / CODESTREAM_BUFSIZ;
codestream_next_addr *= CODESTREAM_BUFSIZ;
codestream_cnt = 0;
codestream_fill (1);
while (codestream_tell () != place)
codestream_get ();
}
/* This function is currently unused but leave in for now. */
static void
codestream_read (unsigned int *buf, int count)
{
unsigned int *p;
int i;
p = buf;
for (i = 0; i < count; i++)
*p++ = codestream_get ();
}
/* Set up prologue scanning and return the first insn. */
static unsigned int
setup_prologue_scan (CORE_ADDR pc)
{
unsigned int insn;
codestream_seek (pc);
insn = codestream_get ();
return insn;
}
/*
* Find & return amount a local space allocated, and advance codestream to
* first register push (if any).
* If entry sequence doesn't make sense, return -1, and leave
* codestream pointer random.
*/
static long
arc_get_frame_setup (CORE_ADDR pc)
{
unsigned int insn;
/* Size of frame or -1 if unrecognizable prologue. */
int frame_size = -1;
/* An initial "sub sp,sp,N" may or may not be for a stdarg fn. */
int maybe_stdarg_decr = -1;
insn = setup_prologue_scan (pc);
/* The authority for what appears here is the home-grown ABI.
The most recent version is 1.2. */
/* First insn may be "sub sp,sp,N" if stdarg fn. */
if ((insn & BUILD_INSN (-1, -1, -1, -1, 0))
== BUILD_INSN (10, SP_REGNUM, SP_REGNUM, SHIMM_REGNUM, 0))
{
maybe_stdarg_decr = X_D (insn);
insn = codestream_get ();
}
if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st blink,[sp,4] */
== BUILD_INSN (2, 0, SP_REGNUM, BLINK_REGNUM, 4))
{
insn = codestream_get ();
/* Frame may not be necessary, even though blink is saved.
At least this is something we recognize. */
frame_size = 0;
}
if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st fp,[sp] */
== BUILD_INSN (2, 0, SP_REGNUM, FP_REGNUM, 0))
{
insn = codestream_get ();
if ((insn & BUILD_INSN (-1, -1, -1, -1, 0))
!= BUILD_INSN (12, FP_REGNUM, SP_REGNUM, SP_REGNUM, 0))
return -1;
/* Check for stack adjustment sub sp,sp,N. */
insn = codestream_peek ();
if ((insn & BUILD_INSN (-1, -1, -1, 0, 0))
== BUILD_INSN (10, SP_REGNUM, SP_REGNUM, 0, 0))
{
if (LIMM_P (X_C (insn)))
frame_size = codestream_get ();
else if (SHIMM_P (X_C (insn)))
frame_size = X_D (insn);
else
return -1;
if (frame_size < 0)
return -1;
codestream_get ();
/* This sequence is used to get the address of the return
buffer for a function that returns a structure. */
insn = codestream_peek ();
if ((insn & OPMASK) == 0x60000000)
codestream_get ();
}
/* Frameless fn. */
else
{
frame_size = 0;
}
}
/* If we found a "sub sp,sp,N" and nothing else, it may or may not be a
stdarg fn. The stdarg decrement is not treated as part of the frame size,
so we have a dilemma: what do we return? For now, if we get a
"sub sp,sp,N" and nothing else assume this isn't a stdarg fn. One way
to fix this completely would be to add a bit to the function descriptor
that says the function is a stdarg function. */
if (frame_size < 0 && maybe_stdarg_decr > 0)
return maybe_stdarg_decr;
return frame_size;
}
/* Given a pc value, skip it forward past the function prologue by
disassembling instructions that appear to be a prologue.
If FRAMELESS_P is set, we are only testing to see if the function
is frameless. If it is a frameless function, return PC unchanged.
This allows a quicker answer. */
CORE_ADDR
arc_skip_prologue (CORE_ADDR pc, int frameless_p)
{
unsigned int insn;
int i, frame_size;
if ((frame_size = arc_get_frame_setup (pc)) < 0)
return (pc);
if (frameless_p)
return frame_size == 0 ? pc : codestream_tell ();
/* Skip over register saves. */
for (i = 0; i < 8; i++)
{
insn = codestream_peek ();
if ((insn & BUILD_INSN (-1, 0, -1, 0, 0))
!= BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
break; /* not st insn */
if (!ARC_CALL_SAVED_REG (X_C (insn)))
break;
codestream_get ();
}
return codestream_tell ();
}
/* Return the return address for a frame.
This is used to implement FRAME_SAVED_PC.
This is taken from frameless_look_for_prologue. */
CORE_ADDR
arc_frame_saved_pc (struct frame_info *frame)
{
CORE_ADDR func_start;
unsigned int insn;
func_start = get_pc_function_start (frame->pc) + FUNCTION_START_OFFSET;
if (func_start == 0)
{
/* Best guess. */
return ARC_PC_TO_REAL_ADDRESS (read_memory_integer (FRAME_FP (frame) + 4, 4));
}
/* The authority for what appears here is the home-grown ABI.
The most recent version is 1.2. */
insn = setup_prologue_scan (func_start);
/* First insn may be "sub sp,sp,N" if stdarg fn. */
if ((insn & BUILD_INSN (-1, -1, -1, -1, 0))
== BUILD_INSN (10, SP_REGNUM, SP_REGNUM, SHIMM_REGNUM, 0))
insn = codestream_get ();
/* If the next insn is "st blink,[sp,4]" we can get blink from there.
Otherwise this is a leaf function and we can use blink. Note that
this still allows for the case where a leaf function saves/clobbers/
restores blink. */
if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st blink,[sp,4] */
!= BUILD_INSN (2, 0, SP_REGNUM, BLINK_REGNUM, 4))
return ARC_PC_TO_REAL_ADDRESS (read_register (BLINK_REGNUM));
else
return ARC_PC_TO_REAL_ADDRESS (read_memory_integer (FRAME_FP (frame) + 4, 4));
}
/*
* Parse the first few instructions of the function to see
* what registers were stored.
*
* The startup sequence can be at the start of the function.
* 'st blink,[sp+4], st fp,[sp], mov fp,sp'
*
* Local space is allocated just below by sub sp,sp,nnn.
* Next, the registers used by this function are stored (as offsets from sp).
*/
void
frame_find_saved_regs (struct frame_info *fip, struct frame_saved_regs *fsrp)
{
long locals;
unsigned int insn;
CORE_ADDR dummy_bottom;
CORE_ADDR adr;
int i, regnum, offset;
memset (fsrp, 0, sizeof *fsrp);
/* If frame is the end of a dummy, compute where the beginning would be. */
dummy_bottom = fip->frame - 4 - REGISTER_BYTES - CALL_DUMMY_LENGTH;
/* Check if the PC is in the stack, in a dummy frame. */
if (dummy_bottom <= fip->pc && fip->pc <= fip->frame)
{
/* all regs were saved by push_call_dummy () */
adr = fip->frame;
for (i = 0; i < NUM_REGS; i++)
{
adr -= REGISTER_RAW_SIZE (i);
fsrp->regs[i] = adr;
}
return;
}
locals = arc_get_frame_setup (get_pc_function_start (fip->pc));
if (locals >= 0)
{
/* Set `adr' to the value of `sp'. */
adr = fip->frame - locals;
for (i = 0; i < 8; i++)
{
insn = codestream_get ();
if ((insn & BUILD_INSN (-1, 0, -1, 0, 0))
!= BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
break;
regnum = X_C (insn);
offset = X_D (insn);
fsrp->regs[regnum] = adr + offset;
}
}
fsrp->regs[PC_REGNUM] = fip->frame + 4;
fsrp->regs[FP_REGNUM] = fip->frame;
}
void
arc_push_dummy_frame (void)
{
CORE_ADDR sp = read_register (SP_REGNUM);
int regnum;
char regbuf[MAX_REGISTER_RAW_SIZE];
read_register_gen (PC_REGNUM, regbuf);
write_memory (sp + 4, regbuf, REGISTER_SIZE);
read_register_gen (FP_REGNUM, regbuf);
write_memory (sp, regbuf, REGISTER_SIZE);
write_register (FP_REGNUM, sp);
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
read_register_gen (regnum, regbuf);
sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum));
}
sp += (2 * REGISTER_SIZE);
write_register (SP_REGNUM, sp);
}
void
arc_pop_frame (void)
{
struct frame_info *frame = get_current_frame ();
CORE_ADDR fp;
int regnum;
struct frame_saved_regs fsr;
char regbuf[MAX_REGISTER_RAW_SIZE];
fp = FRAME_FP (frame);
get_frame_saved_regs (frame, &fsr);
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
CORE_ADDR adr;
adr = fsr.regs[regnum];
if (adr)
{
read_memory (adr, regbuf, REGISTER_RAW_SIZE (regnum));
write_register_bytes (REGISTER_BYTE (regnum), regbuf,
REGISTER_RAW_SIZE (regnum));
}
}
write_register (FP_REGNUM, read_memory_integer (fp, 4));
write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
write_register (SP_REGNUM, fp + 8);
flush_cached_frames ();
}
/* Simulate single-step. */
typedef enum
{
NORMAL4, /* a normal 4 byte insn */
NORMAL8, /* a normal 8 byte insn */
BRANCH4, /* a 4 byte branch insn, including ones without delay slots */
BRANCH8, /* an 8 byte branch insn, including ones with delay slots */
}
insn_type;
/* Return the type of INSN and store in TARGET the destination address of a
branch if this is one. */
/* ??? Need to verify all cases are properly handled. */
static insn_type
get_insn_type (unsigned long insn, CORE_ADDR pc, CORE_ADDR *target)
{
unsigned long limm;
switch (insn >> 27)
{
case 0:
case 1:
case 2: /* load/store insns */
if (LIMM_P (X_A (insn))
|| LIMM_P (X_B (insn))
|| LIMM_P (X_C (insn)))
return NORMAL8;
return NORMAL4;
case 4:
case 5:
case 6: /* branch insns */
*target = pc + 4 + X_L (insn);
/* ??? It isn't clear that this is always the right answer.
The problem occurs when the next insn is an 8 byte insn. If the
branch is conditional there's no worry as there shouldn't be an 8
byte insn following. The programmer may be cheating if s/he knows
the branch will never be taken, but we don't deal with that.
Note that the programmer is also allowed to play games by putting
an insn with long immediate data in the delay slot and then duplicate
the long immediate data at the branch target. Ugh! */
if (X_N (insn) == 0)
return BRANCH4;
return BRANCH8;
case 7: /* jump insns */
if (LIMM_P (X_B (insn)))
{
limm = read_memory_integer (pc + 4, 4);
*target = ARC_PC_TO_REAL_ADDRESS (limm);
return BRANCH8;
}
if (SHIMM_P (X_B (insn)))
*target = ARC_PC_TO_REAL_ADDRESS (X_D (insn));
else
*target = ARC_PC_TO_REAL_ADDRESS (read_register (X_B (insn)));
if (X_Q (insn) == 0 && X_N (insn) == 0)
return BRANCH4;
return BRANCH8;
default: /* arithmetic insns, etc. */
if (LIMM_P (X_A (insn))
|| LIMM_P (X_B (insn))
|| LIMM_P (X_C (insn)))
return NORMAL8;
return NORMAL4;
}
}
/* single_step() is called just before we want to resume the inferior, if we
want to single-step it but there is no hardware or kernel single-step
support. We find all the possible targets of the coming instruction and
breakpoint them.
single_step is also called just after the inferior stops. If we had
set up a simulated single-step, we undo our damage. */
void
arc_software_single_step (enum target_signal ignore, /* sig but we don't need it */
int insert_breakpoints_p)
{
static CORE_ADDR next_pc, target;
static int brktrg_p;
typedef char binsn_quantum[BREAKPOINT_MAX];
static binsn_quantum break_mem[2];
if (insert_breakpoints_p)
{
insn_type type;
CORE_ADDR pc;
unsigned long insn;
pc = read_register (PC_REGNUM);
insn = read_memory_integer (pc, 4);
type = get_insn_type (insn, pc, &target);
/* Always set a breakpoint for the insn after the branch. */
next_pc = pc + ((type == NORMAL8 || type == BRANCH8) ? 8 : 4);
target_insert_breakpoint (next_pc, break_mem[0]);
brktrg_p = 0;
if ((type == BRANCH4 || type == BRANCH8)
/* Watch out for branches to the following location.
We just stored a breakpoint there and another call to
target_insert_breakpoint will think the real insn is the
breakpoint we just stored there. */
&& target != next_pc)
{
brktrg_p = 1;
target_insert_breakpoint (target, break_mem[1]);
}
}
else
{
/* Remove breakpoints. */
target_remove_breakpoint (next_pc, break_mem[0]);
if (brktrg_p)
target_remove_breakpoint (target, break_mem[1]);
/* Fix the pc. */
stop_pc -= DECR_PC_AFTER_BREAK;
write_pc (stop_pc);
}
}
/* Because of Multi-arch, GET_LONGJMP_TARGET is always defined. So test
for a definition of JB_PC. */
#ifdef JB_PC
/* Figure out where the longjmp will land. Slurp the args out of the stack.
We expect the first arg to be a pointer to the jmp_buf structure from which
we extract the pc (JB_PC) that we will land at. The pc is copied into PC.
This routine returns true on success. */
int
get_longjmp_target (CORE_ADDR *pc)
{
char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
CORE_ADDR sp, jb_addr;
sp = read_register (SP_REGNUM);
if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
buf,
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
*pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
#endif /* GET_LONGJMP_TARGET */
/* Disassemble one instruction. */
static int
arc_print_insn (bfd_vma vma, disassemble_info *info)
{
static int current_mach;
static int current_endian;
static disassembler_ftype current_disasm;
if (current_disasm == NULL
|| arc_bfd_mach_type != current_mach
|| TARGET_BYTE_ORDER != current_endian)
{
current_mach = arc_bfd_mach_type;
current_endian = TARGET_BYTE_ORDER;
current_disasm = arc_get_disassembler (NULL);
}
return (*current_disasm) (vma, info);
}
/* Command to set cpu type. */
void
arc_set_cpu_type_command (char *args, int from_tty)
{
int i;
if (tmp_arc_cpu_type == NULL || *tmp_arc_cpu_type == '\0')
{
printf_unfiltered ("The known ARC cpu types are as follows:\n");
for (i = 0; arc_cpu_type_table[i].name != NULL; ++i)
printf_unfiltered ("%s\n", arc_cpu_type_table[i].name);
/* Restore the value. */
tmp_arc_cpu_type = xstrdup (arc_cpu_type);
return;
}
if (!arc_set_cpu_type (tmp_arc_cpu_type))
{
error ("Unknown cpu type `%s'.", tmp_arc_cpu_type);
/* Restore its value. */
tmp_arc_cpu_type = xstrdup (arc_cpu_type);
}
}
static void
arc_show_cpu_type_command (char *args, int from_tty)
{
}
/* Modify the actual cpu type.
Result is a boolean indicating success. */
static int
arc_set_cpu_type (char *str)
{
int i, j;
if (str == NULL)
return 0;
for (i = 0; arc_cpu_type_table[i].name != NULL; ++i)
{
if (strcasecmp (str, arc_cpu_type_table[i].name) == 0)
{
arc_cpu_type = str;
arc_bfd_mach_type = arc_cpu_type_table[i].value;
return 1;
}
}
return 0;
}
void
_initialize_arc_tdep (void)
{
struct cmd_list_element *c;
c = add_set_cmd ("cpu", class_support, var_string_noescape,
(char *) &tmp_arc_cpu_type,
"Set the type of ARC cpu in use.\n\
This command has two purposes. In a multi-cpu system it lets one\n\
change the cpu being debugged. It also gives one access to\n\
cpu-type-specific registers and recognize cpu-type-specific instructions.\
",
&setlist);
set_cmd_cfunc (c, arc_set_cpu_type_command);
c = add_show_from_set (c, &showlist);
set_cmd_cfunc (c, arc_show_cpu_type_command);
/* We have to use xstrdup() here because the `set' command frees it
before setting a new value. */
tmp_arc_cpu_type = xstrdup (DEFAULT_ARC_CPU_TYPE);
arc_set_cpu_type (tmp_arc_cpu_type);
c = add_set_cmd ("displaypipeline", class_support, var_zinteger,
(char *) &display_pipeline_p,
"Set pipeline display (simulator only).\n\
When enabled, the state of the pipeline after each cycle is displayed.",
&setlist);
c = add_show_from_set (c, &showlist);
c = add_set_cmd ("debugpipeline", class_support, var_zinteger,
(char *) &debug_pipeline_p,
"Set pipeline debug display (simulator only).\n\
When enabled, debugging information about the pipeline is displayed.",
&setlist);
c = add_show_from_set (c, &showlist);
c = add_set_cmd ("cputimer", class_support, var_zinteger,
(char *) &cpu_timer,
"Set maximum cycle count (simulator only).\n\
Control will return to gdb if the timer expires.\n\
A negative value disables the timer.",
&setlist);
c = add_show_from_set (c, &showlist);
tm_print_insn = arc_print_insn;
}

View File

@ -1,698 +0,0 @@
/* GNU/Linux on ARM native support.
Copyright 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 "defs.h"
#include "inferior.h"
#include "gdbcore.h"
#include "gdb_string.h"
#include "regcache.h"
#include "arm-tdep.h"
#include <sys/user.h>
#include <sys/ptrace.h>
#include <sys/utsname.h>
#include <sys/procfs.h>
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
extern int arm_apcs_32;
#define typeNone 0x00
#define typeSingle 0x01
#define typeDouble 0x02
#define typeExtended 0x03
#define FPWORDS 28
#define ARM_CPSR_REGNUM 16
typedef union tagFPREG
{
unsigned int fSingle;
unsigned int fDouble[2];
unsigned int fExtended[3];
}
FPREG;
typedef struct tagFPA11
{
FPREG fpreg[8]; /* 8 floating point registers */
unsigned int fpsr; /* floating point status register */
unsigned int fpcr; /* floating point control register */
unsigned char fType[8]; /* type of floating point value held in
floating point registers. */
int initflag; /* NWFPE initialization flag. */
}
FPA11;
/* The following variables are used to determine the version of the
underlying GNU/Linux operating system. Examples:
GNU/Linux 2.0.35 GNU/Linux 2.2.12
os_version = 0x00020023 os_version = 0x0002020c
os_major = 2 os_major = 2
os_minor = 0 os_minor = 2
os_release = 35 os_release = 12
Note: os_version = (os_major << 16) | (os_minor << 8) | os_release
These are initialized using get_linux_version() from
_initialize_arm_linux_nat(). */
static unsigned int os_version, os_major, os_minor, os_release;
/* On GNU/Linux, threads are implemented as pseudo-processes, in which
case we may be tracing more than one process at a time. In that
case, inferior_ptid will contain the main process ID and the
individual thread (process) ID. get_thread_id () is used to get
the thread id if it's available, and the process id otherwise. */
int
get_thread_id (ptid_t ptid)
{
int tid = TIDGET (ptid);
if (0 == tid)
tid = PIDGET (ptid);
return tid;
}
#define GET_THREAD_ID(PTID) get_thread_id ((PTID));
static void
fetch_nwfpe_single (unsigned int fn, FPA11 * fpa11)
{
unsigned int mem[3];
mem[0] = fpa11->fpreg[fn].fSingle;
mem[1] = 0;
mem[2] = 0;
supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
}
static void
fetch_nwfpe_double (unsigned int fn, FPA11 * fpa11)
{
unsigned int mem[3];
mem[0] = fpa11->fpreg[fn].fDouble[1];
mem[1] = fpa11->fpreg[fn].fDouble[0];
mem[2] = 0;
supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
}
static void
fetch_nwfpe_none (unsigned int fn)
{
unsigned int mem[3] =
{0, 0, 0};
supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
}
static void
fetch_nwfpe_extended (unsigned int fn, FPA11 * fpa11)
{
unsigned int mem[3];
mem[0] = fpa11->fpreg[fn].fExtended[0]; /* sign & exponent */
mem[1] = fpa11->fpreg[fn].fExtended[2]; /* ls bits */
mem[2] = fpa11->fpreg[fn].fExtended[1]; /* ms bits */
supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
}
static void
fetch_nwfpe_register (int regno, FPA11 * fpa11)
{
int fn = regno - ARM_F0_REGNUM;
switch (fpa11->fType[fn])
{
case typeSingle:
fetch_nwfpe_single (fn, fpa11);
break;
case typeDouble:
fetch_nwfpe_double (fn, fpa11);
break;
case typeExtended:
fetch_nwfpe_extended (fn, fpa11);
break;
default:
fetch_nwfpe_none (fn);
}
}
static void
store_nwfpe_single (unsigned int fn, FPA11 *fpa11)
{
unsigned int mem[3];
regcache_collect (ARM_F0_REGNUM + fn, (char *) &mem[0]);
fpa11->fpreg[fn].fSingle = mem[0];
fpa11->fType[fn] = typeSingle;
}
static void
store_nwfpe_double (unsigned int fn, FPA11 *fpa11)
{
unsigned int mem[3];
regcache_collect (ARM_F0_REGNUM + fn, (char *) &mem[0]);
fpa11->fpreg[fn].fDouble[1] = mem[0];
fpa11->fpreg[fn].fDouble[0] = mem[1];
fpa11->fType[fn] = typeDouble;
}
void
store_nwfpe_extended (unsigned int fn, FPA11 *fpa11)
{
unsigned int mem[3];
regcache_collect (ARM_F0_REGNUM + fn, (char *) &mem[0]);
fpa11->fpreg[fn].fExtended[0] = mem[0]; /* sign & exponent */
fpa11->fpreg[fn].fExtended[2] = mem[1]; /* ls bits */
fpa11->fpreg[fn].fExtended[1] = mem[2]; /* ms bits */
fpa11->fType[fn] = typeDouble;
}
void
store_nwfpe_register (int regno, FPA11 * fpa11)
{
if (register_cached (regno))
{
unsigned int fn = regno - ARM_F0_REGNUM;
switch (fpa11->fType[fn])
{
case typeSingle:
store_nwfpe_single (fn, fpa11);
break;
case typeDouble:
store_nwfpe_double (fn, fpa11);
break;
case typeExtended:
store_nwfpe_extended (fn, fpa11);
break;
}
}
}
/* Get the value of a particular register from the floating point
state of the process and store it into regcache. */
static void
fetch_fpregister (int regno)
{
int ret, tid;
FPA11 fp;
/* Get the thread id for the ptrace call. */
tid = GET_THREAD_ID (inferior_ptid);
/* Read the floating point state. */
ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
if (ret < 0)
{
warning ("Unable to fetch floating point register.");
return;
}
/* Fetch fpsr. */
if (ARM_FPS_REGNUM == regno)
supply_register (ARM_FPS_REGNUM, (char *) &fp.fpsr);
/* Fetch the floating point register. */
if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
{
int fn = regno - ARM_F0_REGNUM;
switch (fp.fType[fn])
{
case typeSingle:
fetch_nwfpe_single (fn, &fp);
break;
case typeDouble:
fetch_nwfpe_double (fn, &fp);
break;
case typeExtended:
fetch_nwfpe_extended (fn, &fp);
break;
default:
fetch_nwfpe_none (fn);
}
}
}
/* Get the whole floating point state of the process and store it
into regcache. */
static void
fetch_fpregs (void)
{
int ret, regno, tid;
FPA11 fp;
/* Get the thread id for the ptrace call. */
tid = GET_THREAD_ID (inferior_ptid);
/* Read the floating point state. */
ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
if (ret < 0)
{
warning ("Unable to fetch the floating point registers.");
return;
}
/* Fetch fpsr. */
supply_register (ARM_FPS_REGNUM, (char *) &fp.fpsr);
/* Fetch the floating point registers. */
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
{
int fn = regno - ARM_F0_REGNUM;
switch (fp.fType[fn])
{
case typeSingle:
fetch_nwfpe_single (fn, &fp);
break;
case typeDouble:
fetch_nwfpe_double (fn, &fp);
break;
case typeExtended:
fetch_nwfpe_extended (fn, &fp);
break;
default:
fetch_nwfpe_none (fn);
}
}
}
/* Save a particular register into the floating point state of the
process using the contents from regcache. */
static void
store_fpregister (int regno)
{
int ret, tid;
FPA11 fp;
/* Get the thread id for the ptrace call. */
tid = GET_THREAD_ID (inferior_ptid);
/* Read the floating point state. */
ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
if (ret < 0)
{
warning ("Unable to fetch the floating point registers.");
return;
}
/* Store fpsr. */
if (ARM_FPS_REGNUM == regno && register_cached (ARM_FPS_REGNUM))
regcache_collect (ARM_FPS_REGNUM, (char *) &fp.fpsr);
/* Store the floating point register. */
if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
{
store_nwfpe_register (regno, &fp);
}
ret = ptrace (PTRACE_SETFPREGS, tid, 0, &fp);
if (ret < 0)
{
warning ("Unable to store floating point register.");
return;
}
}
/* Save the whole floating point state of the process using
the contents from regcache. */
static void
store_fpregs (void)
{
int ret, regno, tid;
FPA11 fp;
/* Get the thread id for the ptrace call. */
tid = GET_THREAD_ID (inferior_ptid);
/* Read the floating point state. */
ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
if (ret < 0)
{
warning ("Unable to fetch the floating point registers.");
return;
}
/* Store fpsr. */
if (register_cached (ARM_FPS_REGNUM))
regcache_collect (ARM_FPS_REGNUM, (char *) &fp.fpsr);
/* Store the floating point registers. */
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
{
fetch_nwfpe_register (regno, &fp);
}
ret = ptrace (PTRACE_SETFPREGS, tid, 0, &fp);
if (ret < 0)
{
warning ("Unable to store floating point registers.");
return;
}
}
/* Fetch a general register of the process and store into
regcache. */
static void
fetch_register (int regno)
{
int ret, tid;
elf_gregset_t regs;
/* Get the thread id for the ptrace call. */
tid = GET_THREAD_ID (inferior_ptid);
ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
if (ret < 0)
{
warning ("Unable to fetch general register.");
return;
}
if (regno >= ARM_A1_REGNUM && regno < ARM_PC_REGNUM)
supply_register (regno, (char *) &regs[regno]);
if (ARM_PS_REGNUM == regno)
{
if (arm_apcs_32)
supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_CPSR_REGNUM]);
else
supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
}
if (ARM_PC_REGNUM == regno)
{
regs[ARM_PC_REGNUM] = ADDR_BITS_REMOVE (regs[ARM_PC_REGNUM]);
supply_register (ARM_PC_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
}
}
/* Fetch all general registers of the process and store into
regcache. */
static void
fetch_regs (void)
{
int ret, regno, tid;
elf_gregset_t regs;
/* Get the thread id for the ptrace call. */
tid = GET_THREAD_ID (inferior_ptid);
ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
if (ret < 0)
{
warning ("Unable to fetch general registers.");
return;
}
for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
supply_register (regno, (char *) &regs[regno]);
if (arm_apcs_32)
supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_CPSR_REGNUM]);
else
supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
regs[ARM_PC_REGNUM] = ADDR_BITS_REMOVE (regs[ARM_PC_REGNUM]);
supply_register (ARM_PC_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
}
/* Store all general registers of the process from the values in
regcache. */
static void
store_register (int regno)
{
int ret, tid;
elf_gregset_t regs;
if (!register_cached (regno))
return;
/* Get the thread id for the ptrace call. */
tid = GET_THREAD_ID (inferior_ptid);
/* Get the general registers from the process. */
ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
if (ret < 0)
{
warning ("Unable to fetch general registers.");
return;
}
if (regno >= ARM_A1_REGNUM && regno <= ARM_PC_REGNUM)
regcache_collect (regno, (char *) &regs[regno]);
ret = ptrace (PTRACE_SETREGS, tid, 0, &regs);
if (ret < 0)
{
warning ("Unable to store general register.");
return;
}
}
static void
store_regs (void)
{
int ret, regno, tid;
elf_gregset_t regs;
/* Get the thread id for the ptrace call. */
tid = GET_THREAD_ID (inferior_ptid);
/* Fetch the general registers. */
ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
if (ret < 0)
{
warning ("Unable to fetch general registers.");
return;
}
for (regno = ARM_A1_REGNUM; regno <= ARM_PC_REGNUM; regno++)
{
if (register_cached (regno))
regcache_collect (regno, (char *) &regs[regno]);
}
ret = ptrace (PTRACE_SETREGS, tid, 0, &regs);
if (ret < 0)
{
warning ("Unable to store general registers.");
return;
}
}
/* Fetch registers from the child process. Fetch all registers if
regno == -1, otherwise fetch all general registers or all floating
point registers depending upon the value of regno. */
void
fetch_inferior_registers (int regno)
{
if (-1 == regno)
{
fetch_regs ();
fetch_fpregs ();
}
else
{
if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
fetch_register (regno);
if (regno >= ARM_F0_REGNUM && regno <= ARM_FPS_REGNUM)
fetch_fpregister (regno);
}
}
/* Store registers back into the inferior. Store all registers if
regno == -1, otherwise store all general registers or all floating
point registers depending upon the value of regno. */
void
store_inferior_registers (int regno)
{
if (-1 == regno)
{
store_regs ();
store_fpregs ();
}
else
{
if ((regno < ARM_F0_REGNUM) || (regno > ARM_FPS_REGNUM))
store_register (regno);
if ((regno >= ARM_F0_REGNUM) && (regno <= ARM_FPS_REGNUM))
store_fpregister (regno);
}
}
/* Fill register regno (if it is a general-purpose register) in
*gregsetp with the appropriate value from GDB's register array.
If regno is -1, do this for all registers. */
void
fill_gregset (gdb_gregset_t *gregsetp, int regno)
{
if (-1 == regno)
{
int regnum;
for (regnum = ARM_A1_REGNUM; regnum <= ARM_PC_REGNUM; regnum++)
regcache_collect (regnum, (char *) &(*gregsetp)[regnum]);
}
else if (regno >= ARM_A1_REGNUM && regno <= ARM_PC_REGNUM)
regcache_collect (regno, (char *) &(*gregsetp)[regno]);
if (ARM_PS_REGNUM == regno || -1 == regno)
{
if (arm_apcs_32)
regcache_collect (ARM_PS_REGNUM,
(char *) &(*gregsetp)[ARM_CPSR_REGNUM]);
else
regcache_collect (ARM_PC_REGNUM,
(char *) &(*gregsetp)[ARM_PC_REGNUM]);
}
}
/* Fill GDB's register array with the general-purpose register values
in *gregsetp. */
void
supply_gregset (gdb_gregset_t *gregsetp)
{
int regno, reg_pc;
for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
supply_register (regno, (char *) &(*gregsetp)[regno]);
if (arm_apcs_32)
supply_register (ARM_PS_REGNUM, (char *) &(*gregsetp)[ARM_CPSR_REGNUM]);
else
supply_register (ARM_PS_REGNUM, (char *) &(*gregsetp)[ARM_PC_REGNUM]);
reg_pc = ADDR_BITS_REMOVE ((CORE_ADDR)(*gregsetp)[ARM_PC_REGNUM]);
supply_register (ARM_PC_REGNUM, (char *) &reg_pc);
}
/* Fill register regno (if it is a floating-point register) in
*fpregsetp with the appropriate value from GDB's register array.
If regno is -1, do this for all registers. */
void
fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
{
FPA11 *fp = (FPA11 *) fpregsetp;
if (-1 == regno)
{
int regnum;
for (regnum = ARM_F0_REGNUM; regnum <= ARM_F7_REGNUM; regnum++)
store_nwfpe_register (regnum, fp);
}
else if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
{
store_nwfpe_register (regno, fp);
return;
}
/* Store fpsr. */
if (ARM_FPS_REGNUM == regno || -1 == regno)
regcache_collect (ARM_FPS_REGNUM, (char *) &fp->fpsr);
}
/* Fill GDB's register array with the floating-point register values
in *fpregsetp. */
void
supply_fpregset (gdb_fpregset_t *fpregsetp)
{
int regno;
FPA11 *fp = (FPA11 *) fpregsetp;
/* Fetch fpsr. */
supply_register (ARM_FPS_REGNUM, (char *) &fp->fpsr);
/* Fetch the floating point registers. */
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
{
fetch_nwfpe_register (regno, fp);
}
}
int
arm_linux_kernel_u_size (void)
{
return (sizeof (struct user));
}
static unsigned int
get_linux_version (unsigned int *vmajor,
unsigned int *vminor,
unsigned int *vrelease)
{
struct utsname info;
char *pmajor, *pminor, *prelease, *tail;
if (-1 == uname (&info))
{
warning ("Unable to determine GNU/Linux version.");
return -1;
}
pmajor = strtok (info.release, ".");
pminor = strtok (NULL, ".");
prelease = strtok (NULL, ".");
*vmajor = (unsigned int) strtoul (pmajor, &tail, 0);
*vminor = (unsigned int) strtoul (pminor, &tail, 0);
*vrelease = (unsigned int) strtoul (prelease, &tail, 0);
return ((*vmajor << 16) | (*vminor << 8) | *vrelease);
}
void
_initialize_arm_linux_nat (void)
{
os_version = get_linux_version (&os_major, &os_minor, &os_release);
}

View File

@ -1,547 +0,0 @@
/* GNU/Linux on ARM target support.
Copyright 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 "defs.h"
#include "target.h"
#include "value.h"
#include "gdbtypes.h"
#include "floatformat.h"
#include "gdbcore.h"
#include "frame.h"
#include "regcache.h"
#include "doublest.h"
#include "arm-tdep.h"
/* For shared library handling. */
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
/* Under ARM GNU/Linux the traditional way of performing a breakpoint
is to execute a particular software interrupt, rather than use a
particular undefined instruction to provoke a trap. Upon exection
of the software interrupt the kernel stops the inferior with a
SIGTRAP, and wakes the debugger. Since ARM GNU/Linux is little
endian, and doesn't support Thumb at the moment we only override
the ARM little-endian breakpoint. */
static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
/* CALL_DUMMY_WORDS:
This sequence of words is the instructions
mov lr, pc
mov pc, r4
swi bkpt_swi
Note this is 12 bytes. */
LONGEST arm_linux_call_dummy_words[] =
{
0xe1a0e00f, 0xe1a0f004, 0xef9f001
};
/* Description of the longjmp buffer. */
#define JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE
#define JB_PC 21
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
/* FIXME rearnsha/2002-02-23: This function shouldn't be necessary.
The ARM generic one should be able to handle the model used by
linux and the low-level formatting of the registers should be
hidden behind the regcache abstraction. */
static void
arm_linux_extract_return_value (struct type *type,
char regbuf[REGISTER_BYTES],
char *valbuf)
{
/* ScottB: This needs to be looked at to handle the different
floating point emulators on ARM GNU/Linux. Right now the code
assumes that fetch inferior registers does the right thing for
GDB. I suspect this won't handle NWFPE registers correctly, nor
will the default ARM version (arm_extract_return_value()). */
int regnum = ((TYPE_CODE_FLT == TYPE_CODE (type))
? ARM_F0_REGNUM : ARM_A1_REGNUM);
memcpy (valbuf, &regbuf[REGISTER_BYTE (regnum)], TYPE_LENGTH (type));
}
/* Note: ScottB
This function does not support passing parameters using the FPA
variant of the APCS. It passes any floating point arguments in the
general registers and/or on the stack.
FIXME: This and arm_push_arguments should be merged. However this
function breaks on a little endian host, big endian target
using the COFF file format. ELF is ok.
ScottB. */
/* Addresses for calling Thumb functions have the bit 0 set.
Here are some macros to test, set, or clear bit 0 of addresses. */
#define IS_THUMB_ADDR(addr) ((addr) & 1)
#define MAKE_THUMB_ADDR(addr) ((addr) | 1)
#define UNMAKE_THUMB_ADDR(addr) ((addr) & ~1)
static CORE_ADDR
arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
char *fp;
int argnum, argreg, nstack_size;
/* Walk through the list of args and determine how large a temporary
stack is required. Need to take care here as structs may be
passed on the stack, and we have to to push them. */
nstack_size = -4 * REGISTER_SIZE; /* Some arguments go into A1-A4. */
if (struct_return) /* The struct address goes in A1. */
nstack_size += REGISTER_SIZE;
/* Walk through the arguments and add their size to nstack_size. */
for (argnum = 0; argnum < nargs; argnum++)
{
int len;
struct type *arg_type;
arg_type = check_typedef (VALUE_TYPE (args[argnum]));
len = TYPE_LENGTH (arg_type);
/* ANSI C code passes float arguments as integers, K&R code
passes float arguments as doubles. Correct for this here. */
if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && REGISTER_SIZE == len)
nstack_size += FP_REGISTER_VIRTUAL_SIZE;
else
nstack_size += len;
}
/* Allocate room on the stack, and initialize our stack frame
pointer. */
fp = NULL;
if (nstack_size > 0)
{
sp -= nstack_size;
fp = (char *) sp;
}
/* Initialize the integer argument register pointer. */
argreg = ARM_A1_REGNUM;
/* The struct_return pointer occupies the first parameter passing
register. */
if (struct_return)
write_register (argreg++, struct_addr);
/* Process arguments from left to right. Store as many as allowed
in the parameter passing registers (A1-A4), and save the rest on
the temporary stack. */
for (argnum = 0; argnum < nargs; argnum++)
{
int len;
char *val;
CORE_ADDR regval;
enum type_code typecode;
struct type *arg_type, *target_type;
arg_type = check_typedef (VALUE_TYPE (args[argnum]));
target_type = TYPE_TARGET_TYPE (arg_type);
len = TYPE_LENGTH (arg_type);
typecode = TYPE_CODE (arg_type);
val = (char *) VALUE_CONTENTS (args[argnum]);
/* ANSI C code passes float arguments as integers, K&R code
passes float arguments as doubles. The .stabs record for
for ANSI prototype floating point arguments records the
type as FP_INTEGER, while a K&R style (no prototype)
.stabs records the type as FP_FLOAT. In this latter case
the compiler converts the float arguments to double before
calling the function. */
if (TYPE_CODE_FLT == typecode && REGISTER_SIZE == len)
{
DOUBLEST dblval;
dblval = extract_floating (val, len);
len = TARGET_DOUBLE_BIT / TARGET_CHAR_BIT;
val = alloca (len);
store_floating (val, len, dblval);
}
/* If the argument is a pointer to a function, and it is a Thumb
function, set the low bit of the pointer. */
if (TYPE_CODE_PTR == typecode
&& NULL != target_type
&& TYPE_CODE_FUNC == TYPE_CODE (target_type))
{
CORE_ADDR regval = extract_address (val, len);
if (arm_pc_is_thumb (regval))
store_address (val, len, MAKE_THUMB_ADDR (regval));
}
/* Copy the argument to general registers or the stack in
register-sized pieces. Large arguments are split between
registers and stack. */
while (len > 0)
{
int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
if (argreg <= ARM_LAST_ARG_REGNUM)
{
/* It's an argument being passed in a general register. */
regval = extract_address (val, partial_len);
write_register (argreg++, regval);
}
else
{
/* Push the arguments onto the stack. */
write_memory ((CORE_ADDR) fp, val, REGISTER_SIZE);
fp += REGISTER_SIZE;
}
len -= partial_len;
val += partial_len;
}
}
/* Return adjusted stack pointer. */
return sp;
}
/*
Dynamic Linking on ARM GNU/Linux
--------------------------------
Note: PLT = procedure linkage table
GOT = global offset table
As much as possible, ELF dynamic linking defers the resolution of
jump/call addresses until the last minute. The technique used is
inspired by the i386 ELF design, and is based on the following
constraints.
1) The calling technique should not force a change in the assembly
code produced for apps; it MAY cause changes in the way assembly
code is produced for position independent code (i.e. shared
libraries).
2) The technique must be such that all executable areas must not be
modified; and any modified areas must not be executed.
To do this, there are three steps involved in a typical jump:
1) in the code
2) through the PLT
3) using a pointer from the GOT
When the executable or library is first loaded, each GOT entry is
initialized to point to the code which implements dynamic name
resolution and code finding. This is normally a function in the
program interpreter (on ARM GNU/Linux this is usually
ld-linux.so.2, but it does not have to be). On the first
invocation, the function is located and the GOT entry is replaced
with the real function address. Subsequent calls go through steps
1, 2 and 3 and end up calling the real code.
1) In the code:
b function_call
bl function_call
This is typical ARM code using the 26 bit relative branch or branch
and link instructions. The target of the instruction
(function_call is usually the address of the function to be called.
In position independent code, the target of the instruction is
actually an entry in the PLT when calling functions in a shared
library. Note that this call is identical to a normal function
call, only the target differs.
2) In the PLT:
The PLT is a synthetic area, created by the linker. It exists in
both executables and libraries. It is an array of stubs, one per
imported function call. It looks like this:
PLT[0]:
str lr, [sp, #-4]! @push the return address (lr)
ldr lr, [pc, #16] @load from 6 words ahead
add lr, pc, lr @form an address for GOT[0]
ldr pc, [lr, #8]! @jump to the contents of that addr
The return address (lr) is pushed on the stack and used for
calculations. The load on the second line loads the lr with
&GOT[3] - . - 20. The addition on the third leaves:
lr = (&GOT[3] - . - 20) + (. + 8)
lr = (&GOT[3] - 12)
lr = &GOT[0]
On the fourth line, the pc and lr are both updated, so that:
pc = GOT[2]
lr = &GOT[0] + 8
= &GOT[2]
NOTE: PLT[0] borrows an offset .word from PLT[1]. This is a little
"tight", but allows us to keep all the PLT entries the same size.
PLT[n+1]:
ldr ip, [pc, #4] @load offset from gotoff
add ip, pc, ip @add the offset to the pc
ldr pc, [ip] @jump to that address
gotoff: .word GOT[n+3] - .
The load on the first line, gets an offset from the fourth word of
the PLT entry. The add on the second line makes ip = &GOT[n+3],
which contains either a pointer to PLT[0] (the fixup trampoline) or
a pointer to the actual code.
3) In the GOT:
The GOT contains helper pointers for both code (PLT) fixups and
data fixups. The first 3 entries of the GOT are special. The next
M entries (where M is the number of entries in the PLT) belong to
the PLT fixups. The next D (all remaining) entries belong to
various data fixups. The actual size of the GOT is 3 + M + D.
The GOT is also a synthetic area, created by the linker. It exists
in both executables and libraries. When the GOT is first
initialized , all the GOT entries relating to PLT fixups are
pointing to code back at PLT[0].
The special entries in the GOT are:
GOT[0] = linked list pointer used by the dynamic loader
GOT[1] = pointer to the reloc table for this module
GOT[2] = pointer to the fixup/resolver code
The first invocation of function call comes through and uses the
fixup/resolver code. On the entry to the fixup/resolver code:
ip = &GOT[n+3]
lr = &GOT[2]
stack[0] = return address (lr) of the function call
[r0, r1, r2, r3] are still the arguments to the function call
This is enough information for the fixup/resolver code to work
with. Before the fixup/resolver code returns, it actually calls
the requested function and repairs &GOT[n+3]. */
/* Find the minimal symbol named NAME, and return both the minsym
struct and its objfile. This probably ought to be in minsym.c, but
everything there is trying to deal with things like C++ and
SOFUN_ADDRESS_MAYBE_TURQUOISE, ... Since this is so simple, it may
be considered too special-purpose for general consumption. */
static struct minimal_symbol *
find_minsym_and_objfile (char *name, struct objfile **objfile_p)
{
struct objfile *objfile;
ALL_OBJFILES (objfile)
{
struct minimal_symbol *msym;
ALL_OBJFILE_MSYMBOLS (objfile, msym)
{
if (SYMBOL_NAME (msym)
&& strcmp (SYMBOL_NAME (msym), name) == 0)
{
*objfile_p = objfile;
return msym;
}
}
}
return 0;
}
static CORE_ADDR
skip_hurd_resolver (CORE_ADDR pc)
{
/* The HURD dynamic linker is part of the GNU C library, so many
GNU/Linux distributions use it. (All ELF versions, as far as I
know.) An unresolved PLT entry points to "_dl_runtime_resolve",
which calls "fixup" to patch the PLT, and then passes control to
the function.
We look for the symbol `_dl_runtime_resolve', and find `fixup' in
the same objfile. If we are at the entry point of `fixup', then
we set a breakpoint at the return address (at the top of the
stack), and continue.
It's kind of gross to do all these checks every time we're
called, since they don't change once the executable has gotten
started. But this is only a temporary hack --- upcoming versions
of GNU/Linux will provide a portable, efficient interface for
debugging programs that use shared libraries. */
struct objfile *objfile;
struct minimal_symbol *resolver
= find_minsym_and_objfile ("_dl_runtime_resolve", &objfile);
if (resolver)
{
struct minimal_symbol *fixup
= lookup_minimal_symbol ("fixup", NULL, objfile);
if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc)
return (SAVED_PC_AFTER_CALL (get_current_frame ()));
}
return 0;
}
/* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c.
This function:
1) decides whether a PLT has sent us into the linker to resolve
a function reference, and
2) if so, tells us where to set a temporary breakpoint that will
trigger when the dynamic linker is done. */
CORE_ADDR
arm_linux_skip_solib_resolver (CORE_ADDR pc)
{
CORE_ADDR result;
/* Plug in functions for other kinds of resolvers here. */
result = skip_hurd_resolver (pc);
if (result)
return result;
return 0;
}
/* The constants below were determined by examining the following files
in the linux kernel sources:
arch/arm/kernel/signal.c
- see SWI_SYS_SIGRETURN and SWI_SYS_RT_SIGRETURN
include/asm-arm/unistd.h
- see __NR_sigreturn, __NR_rt_sigreturn, and __NR_SYSCALL_BASE */
#define ARM_LINUX_SIGRETURN_INSTR 0xef900077
#define ARM_LINUX_RT_SIGRETURN_INSTR 0xef9000ad
/* arm_linux_in_sigtramp determines if PC points at one of the
instructions which cause control to return to the Linux kernel upon
return from a signal handler. FUNC_NAME is unused. */
int
arm_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
{
unsigned long inst;
inst = read_memory_integer (pc, 4);
return (inst == ARM_LINUX_SIGRETURN_INSTR
|| inst == ARM_LINUX_RT_SIGRETURN_INSTR);
}
/* arm_linux_sigcontext_register_address returns the address in the
sigcontext of register REGNO given a stack pointer value SP and
program counter value PC. The value 0 is returned if PC is not
pointing at one of the signal return instructions or if REGNO is
not saved in the sigcontext struct. */
CORE_ADDR
arm_linux_sigcontext_register_address (CORE_ADDR sp, CORE_ADDR pc, int regno)
{
unsigned long inst;
CORE_ADDR reg_addr = 0;
inst = read_memory_integer (pc, 4);
if (inst == ARM_LINUX_SIGRETURN_INSTR
|| inst == ARM_LINUX_RT_SIGRETURN_INSTR)
{
CORE_ADDR sigcontext_addr;
/* The sigcontext structure is at different places for the two
signal return instructions. For ARM_LINUX_SIGRETURN_INSTR,
it starts at the SP value. For ARM_LINUX_RT_SIGRETURN_INSTR,
it is at SP+8. For the latter instruction, it may also be
the case that the address of this structure may be determined
by reading the 4 bytes at SP, but I'm not convinced this is
reliable.
In any event, these magic constants (0 and 8) may be
determined by examining struct sigframe and struct
rt_sigframe in arch/arm/kernel/signal.c in the Linux kernel
sources. */
if (inst == ARM_LINUX_RT_SIGRETURN_INSTR)
sigcontext_addr = sp + 8;
else /* inst == ARM_LINUX_SIGRETURN_INSTR */
sigcontext_addr = sp + 0;
/* The layout of the sigcontext structure for ARM GNU/Linux is
in include/asm-arm/sigcontext.h in the Linux kernel sources.
There are three 4-byte fields which precede the saved r0
field. (This accounts for the 12 in the code below.) The
sixteen registers (4 bytes per field) follow in order. The
PSR value follows the sixteen registers which accounts for
the constant 19 below. */
if (0 <= regno && regno <= ARM_PC_REGNUM)
reg_addr = sigcontext_addr + 12 + (4 * regno);
else if (regno == ARM_PS_REGNUM)
reg_addr = sigcontext_addr + 19 * 4;
}
return reg_addr;
}
static void
arm_linux_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
tdep->lowest_pc = 0x8000;
tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
tdep->arm_breakpoint_size = sizeof (arm_linux_arm_le_breakpoint);
tdep->jb_pc = JB_PC;
tdep->jb_elt_size = JB_ELEMENT_SIZE;
set_gdbarch_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
set_gdbarch_sizeof_call_dummy_words (gdbarch,
sizeof (arm_linux_call_dummy_words));
/* The following two overrides shouldn't be needed. */
set_gdbarch_extract_return_value (gdbarch, arm_linux_extract_return_value);
set_gdbarch_push_arguments (gdbarch, arm_linux_push_arguments);
/* Shared library handling. */
set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
}
void
_initialize_arm_linux_tdep (void)
{
arm_gdbarch_register_os_abi (ARM_ABI_LINUX, arm_linux_init_abi);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,663 +0,0 @@
/* Chill language support routines for GDB, the GNU debugger.
Copyright 1992, 1993, 1994, 1995, 1996, 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 "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "expression.h"
#include "parser-defs.h"
#include "language.h"
#include "ch-lang.h"
#include "valprint.h"
extern void _initialize_chill_language (void);
static struct value *evaluate_subexp_chill (struct type *, struct expression *,
int *, enum noside);
static struct value *value_chill_max_min (enum exp_opcode, struct value *);
static struct value *value_chill_card (struct value *);
static struct value *value_chill_length (struct value *);
static struct type *chill_create_fundamental_type (struct objfile *, int);
static void chill_printstr (struct ui_file * stream, char *string,
unsigned int length, int width,
int force_ellipses);
static void chill_printchar (int, struct ui_file *);
/* For now, Chill uses a simple mangling algorithm whereby you simply
discard everything after the occurance of two successive CPLUS_MARKER
characters to derive the demangled form. */
char *
chill_demangle (const char *mangled)
{
const char *joiner = NULL;
char *demangled;
const char *cp = mangled;
while (*cp)
{
if (is_cplus_marker (*cp))
{
joiner = cp;
break;
}
cp++;
}
if (joiner != NULL && *(joiner + 1) == *joiner)
{
demangled = savestring (mangled, joiner - mangled);
}
else
{
demangled = NULL;
}
return (demangled);
}
static void
chill_printchar (register int c, struct ui_file *stream)
{
c &= 0xFF; /* Avoid sign bit follies */
if (PRINT_LITERAL_FORM (c))
{
if (c == '\'' || c == '^')
fprintf_filtered (stream, "'%c%c'", c, c);
else
fprintf_filtered (stream, "'%c'", c);
}
else
{
fprintf_filtered (stream, "'^(%u)'", (unsigned int) c);
}
}
/* Print the character string STRING, printing at most LENGTH characters.
Printing stops early if the number hits print_max; repeat counts
are printed as appropriate. Print ellipses at the end if we
had to stop before printing LENGTH characters, or if FORCE_ELLIPSES.
Note that gdb maintains the length of strings without counting the
terminating null byte, while chill strings are typically written with
an explicit null byte. So we always assume an implied null byte
until gdb is able to maintain non-null terminated strings as well
as null terminated strings (FIXME).
*/
static void
chill_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
register unsigned int i;
unsigned int things_printed = 0;
int in_literal_form = 0;
int in_control_form = 0;
int need_slashslash = 0;
unsigned int c;
if (length == 0)
{
fputs_filtered ("\"\"", stream);
return;
}
for (i = 0; i < length && things_printed < print_max; ++i)
{
/* Position of the character we are examining
to see whether it is repeated. */
unsigned int rep1;
/* Number of repetitions we have detected so far. */
unsigned int reps;
QUIT;
if (need_slashslash)
{
fputs_filtered ("//", stream);
need_slashslash = 0;
}
rep1 = i + 1;
reps = 1;
while (rep1 < length && string[rep1] == string[i])
{
++rep1;
++reps;
}
c = string[i];
if (reps > repeat_count_threshold)
{
if (in_control_form || in_literal_form)
{
if (in_control_form)
fputs_filtered (")", stream);
fputs_filtered ("\"//", stream);
in_control_form = in_literal_form = 0;
}
chill_printchar (c, stream);
fprintf_filtered (stream, "<repeats %u times>", reps);
i = rep1 - 1;
things_printed += repeat_count_threshold;
need_slashslash = 1;
}
else
{
if (!in_literal_form && !in_control_form)
fputs_filtered ("\"", stream);
if (PRINT_LITERAL_FORM (c))
{
if (!in_literal_form)
{
if (in_control_form)
{
fputs_filtered (")", stream);
in_control_form = 0;
}
in_literal_form = 1;
}
fprintf_filtered (stream, "%c", c);
if (c == '"' || c == '^')
/* duplicate this one as must be done at input */
fprintf_filtered (stream, "%c", c);
}
else
{
if (!in_control_form)
{
if (in_literal_form)
{
in_literal_form = 0;
}
fputs_filtered ("^(", stream);
in_control_form = 1;
}
else
fprintf_filtered (stream, ",");
c = c & 0xff;
fprintf_filtered (stream, "%u", (unsigned int) c);
}
++things_printed;
}
}
/* Terminate the quotes if necessary. */
if (in_control_form)
{
fputs_filtered (")", stream);
}
if (in_literal_form || in_control_form)
{
fputs_filtered ("\"", stream);
}
if (force_ellipses || (i < length))
{
fputs_filtered ("...", stream);
}
}
static struct type *
chill_create_fundamental_type (struct objfile *objfile, int typeid)
{
register struct type *type = NULL;
switch (typeid)
{
default:
/* FIXME: For now, if we are asked to produce a type not in this
language, create the equivalent of a C integer type with the
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT, 2, 0, "<?type?>", objfile);
warning ("internal error: no chill fundamental type %d", typeid);
break;
case FT_VOID:
/* FIXME: Currently the GNU Chill compiler emits some DWARF entries for
typedefs, unrelated to anything directly in the code being compiled,
that have some FT_VOID types. Just fake it for now. */
type = init_type (TYPE_CODE_VOID, 0, 0, "<?VOID?>", objfile);
break;
case FT_BOOLEAN:
type = init_type (TYPE_CODE_BOOL, 1, TYPE_FLAG_UNSIGNED, "BOOL", objfile);
break;
case FT_CHAR:
type = init_type (TYPE_CODE_CHAR, 1, TYPE_FLAG_UNSIGNED, "CHAR", objfile);
break;
case FT_SIGNED_CHAR:
type = init_type (TYPE_CODE_INT, 1, 0, "BYTE", objfile);
break;
case FT_UNSIGNED_CHAR:
type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, "UBYTE", objfile);
break;
case FT_SHORT: /* Chill ints are 2 bytes */
type = init_type (TYPE_CODE_INT, 2, 0, "INT", objfile);
break;
case FT_UNSIGNED_SHORT: /* Chill ints are 2 bytes */
type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, "UINT", objfile);
break;
case FT_INTEGER: /* FIXME? */
case FT_SIGNED_INTEGER: /* FIXME? */
case FT_LONG: /* Chill longs are 4 bytes */
case FT_SIGNED_LONG: /* Chill longs are 4 bytes */
type = init_type (TYPE_CODE_INT, 4, 0, "LONG", objfile);
break;
case FT_UNSIGNED_INTEGER: /* FIXME? */
case FT_UNSIGNED_LONG: /* Chill longs are 4 bytes */
type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED, "ULONG", objfile);
break;
case FT_FLOAT:
type = init_type (TYPE_CODE_FLT, 4, 0, "REAL", objfile);
break;
case FT_DBL_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT, 8, 0, "LONG_REAL", objfile);
break;
}
return (type);
}
/* Table of operators and their precedences for printing expressions. */
static const struct op_print chill_op_print_tab[] =
{
{"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
{"OR", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
{"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
{"MOD", BINOP_MOD, PREC_MUL, 0},
{"REM", BINOP_REM, PREC_MUL, 0},
{"SIZE", UNOP_SIZEOF, PREC_BUILTIN_FUNCTION, 0},
{"LOWER", UNOP_LOWER, PREC_BUILTIN_FUNCTION, 0},
{"UPPER", UNOP_UPPER, PREC_BUILTIN_FUNCTION, 0},
{"CARD", UNOP_CARD, PREC_BUILTIN_FUNCTION, 0},
{"MAX", UNOP_CHMAX, PREC_BUILTIN_FUNCTION, 0},
{"MIN", UNOP_CHMIN, PREC_BUILTIN_FUNCTION, 0},
{":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
{"=", BINOP_EQUAL, PREC_EQUAL, 0},
{"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
{"<=", BINOP_LEQ, PREC_ORDER, 0},
{">=", BINOP_GEQ, PREC_ORDER, 0},
{">", BINOP_GTR, PREC_ORDER, 0},
{"<", BINOP_LESS, PREC_ORDER, 0},
{"+", BINOP_ADD, PREC_ADD, 0},
{"-", BINOP_SUB, PREC_ADD, 0},
{"*", BINOP_MUL, PREC_MUL, 0},
{"/", BINOP_DIV, PREC_MUL, 0},
{"//", BINOP_CONCAT, PREC_PREFIX, 0}, /* FIXME: precedence? */
{"-", UNOP_NEG, PREC_PREFIX, 0},
{"->", UNOP_IND, PREC_SUFFIX, 1},
{"->", UNOP_ADDR, PREC_PREFIX, 0},
{":", BINOP_RANGE, PREC_ASSIGN, 0},
{NULL, 0, 0, 0}
};
/* The built-in types of Chill. */
struct type *builtin_type_chill_bool;
struct type *builtin_type_chill_char;
struct type *builtin_type_chill_long;
struct type *builtin_type_chill_ulong;
struct type *builtin_type_chill_real;
struct type **const (chill_builtin_types[]) =
{
&builtin_type_chill_bool,
&builtin_type_chill_char,
&builtin_type_chill_long,
&builtin_type_chill_ulong,
&builtin_type_chill_real,
0
};
/* Calculate LOWER or UPPER of TYPE.
Returns the result as an integer.
*RESULT_TYPE is the appropriate type for the result. */
LONGEST
type_lower_upper (enum exp_opcode op, /* Either UNOP_LOWER or UNOP_UPPER */
struct type *type, struct type **result_type)
{
LONGEST low, high;
*result_type = type;
CHECK_TYPEDEF (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_STRUCT:
*result_type = builtin_type_int;
if (chill_varying_type (type))
return type_lower_upper (op, TYPE_FIELD_TYPE (type, 1), result_type);
break;
case TYPE_CODE_ARRAY:
case TYPE_CODE_BITSTRING:
case TYPE_CODE_STRING:
type = TYPE_FIELD_TYPE (type, 0); /* Get index type */
/* ... fall through ... */
case TYPE_CODE_RANGE:
*result_type = TYPE_TARGET_TYPE (type);
return op == UNOP_LOWER ? TYPE_LOW_BOUND (type) : TYPE_HIGH_BOUND (type);
case TYPE_CODE_ENUM:
case TYPE_CODE_BOOL:
case TYPE_CODE_INT:
case TYPE_CODE_CHAR:
if (get_discrete_bounds (type, &low, &high) >= 0)
{
*result_type = type;
return op == UNOP_LOWER ? low : high;
}
break;
case TYPE_CODE_UNDEF:
case TYPE_CODE_PTR:
case TYPE_CODE_UNION:
case TYPE_CODE_FUNC:
case TYPE_CODE_FLT:
case TYPE_CODE_VOID:
case TYPE_CODE_SET:
case TYPE_CODE_ERROR:
case TYPE_CODE_MEMBER:
case TYPE_CODE_METHOD:
case TYPE_CODE_REF:
case TYPE_CODE_COMPLEX:
default:
break;
}
error ("unknown mode for LOWER/UPPER builtin");
}
static struct value *
value_chill_length (struct value *val)
{
LONGEST tmp;
struct type *type = VALUE_TYPE (val);
struct type *ttype;
CHECK_TYPEDEF (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
case TYPE_CODE_BITSTRING:
case TYPE_CODE_STRING:
tmp = type_lower_upper (UNOP_UPPER, type, &ttype)
- type_lower_upper (UNOP_LOWER, type, &ttype) + 1;
break;
case TYPE_CODE_STRUCT:
if (chill_varying_type (type))
{
tmp = unpack_long (TYPE_FIELD_TYPE (type, 0), VALUE_CONTENTS (val));
break;
}
/* ... else fall through ... */
default:
error ("bad argument to LENGTH builtin");
}
return value_from_longest (builtin_type_int, tmp);
}
static struct value *
value_chill_card (struct value *val)
{
LONGEST tmp = 0;
struct type *type = VALUE_TYPE (val);
CHECK_TYPEDEF (type);
if (TYPE_CODE (type) == TYPE_CODE_SET)
{
struct type *range_type = TYPE_INDEX_TYPE (type);
LONGEST lower_bound, upper_bound;
int i;
get_discrete_bounds (range_type, &lower_bound, &upper_bound);
for (i = lower_bound; i <= upper_bound; i++)
if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0)
tmp++;
}
else
error ("bad argument to CARD builtin");
return value_from_longest (builtin_type_int, tmp);
}
static struct value *
value_chill_max_min (enum exp_opcode op, struct value *val)
{
LONGEST tmp = 0;
struct type *type = VALUE_TYPE (val);
struct type *elttype;
CHECK_TYPEDEF (type);
if (TYPE_CODE (type) == TYPE_CODE_SET)
{
LONGEST lower_bound, upper_bound;
int i, empty = 1;
elttype = TYPE_INDEX_TYPE (type);
CHECK_TYPEDEF (elttype);
get_discrete_bounds (elttype, &lower_bound, &upper_bound);
if (op == UNOP_CHMAX)
{
for (i = upper_bound; i >= lower_bound; i--)
{
if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0)
{
tmp = i;
empty = 0;
break;
}
}
}
else
{
for (i = lower_bound; i <= upper_bound; i++)
{
if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0)
{
tmp = i;
empty = 0;
break;
}
}
}
if (empty)
error ("%s for empty powerset", op == UNOP_CHMAX ? "MAX" : "MIN");
}
else
error ("bad argument to %s builtin", op == UNOP_CHMAX ? "MAX" : "MIN");
return value_from_longest (TYPE_CODE (elttype) == TYPE_CODE_RANGE
? TYPE_TARGET_TYPE (elttype)
: elttype,
tmp);
}
static struct value *
evaluate_subexp_chill (struct type *expect_type,
register struct expression *exp, register int *pos,
enum noside noside)
{
int pc = *pos;
struct type *type;
int tem, nargs;
struct value *arg1;
struct value **argvec;
enum exp_opcode op = exp->elts[*pos].opcode;
switch (op)
{
case MULTI_SUBSCRIPT:
if (noside == EVAL_SKIP)
break;
(*pos) += 3;
nargs = longest_to_int (exp->elts[pc + 1].longconst);
arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
type = check_typedef (VALUE_TYPE (arg1));
if (nargs == 1 && TYPE_CODE (type) == TYPE_CODE_INT)
{
/* Looks like string repetition. */
struct value *string = evaluate_subexp_with_coercion (exp, pos,
noside);
return value_concat (arg1, string);
}
switch (TYPE_CODE (type))
{
case TYPE_CODE_PTR:
type = check_typedef (TYPE_TARGET_TYPE (type));
if (!type || TYPE_CODE (type) != TYPE_CODE_FUNC)
error ("reference value used as function");
/* ... fall through ... */
case TYPE_CODE_FUNC:
/* It's a function call. */
if (noside == EVAL_AVOID_SIDE_EFFECTS)
break;
/* Allocate arg vector, including space for the function to be
called in argvec[0] and a terminating NULL */
argvec = (struct value **) alloca (sizeof (struct value *)
* (nargs + 2));
argvec[0] = arg1;
tem = 1;
for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
{
argvec[tem]
= evaluate_subexp_chill (TYPE_FIELD_TYPE (type, tem - 1),
exp, pos, noside);
}
for (; tem <= nargs; tem++)
argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
argvec[tem] = 0; /* signal end of arglist */
return call_function_by_hand (argvec[0], nargs, argvec + 1);
default:
break;
}
while (nargs-- > 0)
{
struct value *index = evaluate_subexp_with_coercion (exp, pos,
noside);
arg1 = value_subscript (arg1, index);
}
return (arg1);
case UNOP_LOWER:
case UNOP_UPPER:
(*pos)++;
if (noside == EVAL_SKIP)
{
(*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, EVAL_SKIP);
goto nosideret;
}
arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos,
EVAL_AVOID_SIDE_EFFECTS);
tem = type_lower_upper (op, VALUE_TYPE (arg1), &type);
return value_from_longest (type, tem);
case UNOP_LENGTH:
(*pos)++;
arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside);
return value_chill_length (arg1);
case UNOP_CARD:
(*pos)++;
arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside);
return value_chill_card (arg1);
case UNOP_CHMAX:
case UNOP_CHMIN:
(*pos)++;
arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside);
return value_chill_max_min (op, arg1);
case BINOP_COMMA:
error ("',' operator used in invalid context");
default:
break;
}
return evaluate_subexp_standard (expect_type, exp, pos, noside);
nosideret:
return value_from_longest (builtin_type_long, (LONGEST) 1);
}
const struct language_defn chill_language_defn =
{
"chill",
language_chill,
chill_builtin_types,
range_check_on,
type_check_on,
case_sensitive_on,
chill_parse, /* parser */
chill_error, /* parser error function */
evaluate_subexp_chill,
chill_printchar, /* print a character constant */
chill_printstr, /* function to print a string constant */
NULL, /* Function to print a single char */
chill_create_fundamental_type, /* Create fundamental type in this language */
chill_print_type, /* Print a type using appropriate syntax */
chill_val_print, /* Print a value using appropriate syntax */
chill_value_print, /* Print a top-levl value */
{"", "B'", "", ""}, /* Binary format info */
{"O'%lo", "O'", "o", ""}, /* Octal format info */
{"D'%ld", "D'", "d", ""}, /* Decimal format info */
{"H'%lx", "H'", "x", ""}, /* Hex format info */
chill_op_print_tab, /* expression operators for printing */
0, /* arrays are first-class (not c-style) */
0, /* String lower bound */
&builtin_type_chill_char, /* Type of string elements */
LANG_MAGIC
};
/* Initialization for Chill */
void
_initialize_chill_language (void)
{
builtin_type_chill_bool =
init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED,
"BOOL", (struct objfile *) NULL);
builtin_type_chill_char =
init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED,
"CHAR", (struct objfile *) NULL);
builtin_type_chill_long =
init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
0,
"LONG", (struct objfile *) NULL);
builtin_type_chill_ulong =
init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED,
"ULONG", (struct objfile *) NULL);
builtin_type_chill_real =
init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
0,
"LONG_REAL", (struct objfile *) NULL);
add_language (&chill_language_defn);
}

View File

@ -1,41 +0,0 @@
/* Chill language support definitions for GDB, the GNU debugger.
Copyright 1992, 1994, 1996, 1998, 1999, 2000
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. */
/* Forward decls for prototypes */
struct value;
extern int chill_parse (void); /* Defined in ch-exp.y */
extern void chill_error (char *); /* Defined in ch-exp.y */
/* Defined in ch-typeprint.c */
extern void chill_print_type (struct type *, char *, struct ui_file *, int,
int);
extern int chill_val_print (struct type *, char *, int, CORE_ADDR,
struct ui_file *, int, int, int,
enum val_prettyprint);
extern int chill_value_print (struct value *, struct ui_file *,
int, enum val_prettyprint);
extern LONGEST
type_lower_upper (enum exp_opcode, struct type *, struct type **);

View File

@ -1,340 +0,0 @@
/* Support for printing Chill types for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 2000
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 "defs.h"
#include "obstack.h"
#include "bfd.h" /* Binary File Description */
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "value.h"
#include "gdbcore.h"
#include "target.h"
#include "language.h"
#include "ch-lang.h"
#include "typeprint.h"
#include "gdb_string.h"
#include <errno.h>
static void chill_type_print_base (struct type *, struct ui_file *, int, int);
void
chill_print_type (struct type *type, char *varstring, struct ui_file *stream,
int show, int level)
{
if (varstring != NULL && *varstring != '\0')
{
fputs_filtered (varstring, stream);
fputs_filtered (" ", stream);
}
chill_type_print_base (type, stream, show, level);
}
/* Print the name of the type (or the ultimate pointer target,
function value or array element).
SHOW nonzero means don't print this type as just its name;
show its real definition even if it has a name.
SHOW zero means print just typename or tag if there is one
SHOW negative means abbreviate structure elements.
SHOW is decremented for printing of structure elements.
LEVEL is the depth to indent by.
We increase it for some recursive calls. */
static void
chill_type_print_base (struct type *type, struct ui_file *stream, int show,
int level)
{
register int len;
register int i;
struct type *index_type;
struct type *range_type;
LONGEST low_bound;
LONGEST high_bound;
QUIT;
wrap_here (" ");
if (type == NULL)
{
fputs_filtered ("<type unknown>", stream);
return;
}
/* When SHOW is zero or less, and there is a valid type name, then always
just print the type name directly from the type. */
if ((show <= 0) && (TYPE_NAME (type) != NULL))
{
fputs_filtered (TYPE_NAME (type), stream);
return;
}
if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF)
CHECK_TYPEDEF (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_TYPEDEF:
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_PTR:
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)
{
fprintf_filtered (stream,
TYPE_NAME (type) ? TYPE_NAME (type) : "PTR");
break;
}
fprintf_filtered (stream, "REF ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_BOOL:
/* FIXME: we should probably just print the TYPE_NAME, in case
anyone ever fixes the compiler to give us the real names
in the presence of the chill equivalent of typedef (assuming
there is one). */
fprintf_filtered (stream,
TYPE_NAME (type) ? TYPE_NAME (type) : "BOOL");
break;
case TYPE_CODE_ARRAY:
fputs_filtered ("ARRAY (", stream);
range_type = TYPE_FIELD_TYPE (type, 0);
if (TYPE_CODE (range_type) != TYPE_CODE_RANGE)
chill_print_type (range_type, "", stream, 0, level);
else
{
index_type = TYPE_TARGET_TYPE (range_type);
low_bound = TYPE_FIELD_BITPOS (range_type, 0);
high_bound = TYPE_FIELD_BITPOS (range_type, 1);
print_type_scalar (index_type, low_bound, stream);
fputs_filtered (":", stream);
print_type_scalar (index_type, high_bound, stream);
}
fputs_filtered (") ", stream);
chill_print_type (TYPE_TARGET_TYPE (type), "", stream, 0, level);
break;
case TYPE_CODE_BITSTRING:
fprintf_filtered (stream, "BOOLS (%d)",
TYPE_FIELD_BITPOS (TYPE_FIELD_TYPE (type, 0), 1) + 1);
break;
case TYPE_CODE_SET:
fputs_filtered ("POWERSET ", stream);
chill_print_type (TYPE_INDEX_TYPE (type), "", stream,
show - 1, level);
break;
case TYPE_CODE_STRING:
range_type = TYPE_FIELD_TYPE (type, 0);
index_type = TYPE_TARGET_TYPE (range_type);
high_bound = TYPE_FIELD_BITPOS (range_type, 1);
fputs_filtered ("CHARS (", stream);
print_type_scalar (index_type, high_bound + 1, stream);
fputs_filtered (")", stream);
break;
case TYPE_CODE_MEMBER:
fprintf_filtered (stream, "MEMBER ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_REF:
fprintf_filtered (stream, "/*LOC*/ ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
break;
case TYPE_CODE_FUNC:
fprintf_filtered (stream, "PROC (");
len = TYPE_NFIELDS (type);
for (i = 0; i < len; i++)
{
struct type *param_type = TYPE_FIELD_TYPE (type, i);
if (i > 0)
{
fputs_filtered (", ", stream);
wrap_here (" ");
}
if (TYPE_CODE (param_type) == TYPE_CODE_REF)
{
chill_type_print_base (TYPE_TARGET_TYPE (param_type),
stream, 0, level);
fputs_filtered (" LOC", stream);
}
else
chill_type_print_base (param_type, stream, show, level);
}
fprintf_filtered (stream, ")");
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
{
fputs_filtered (" RETURNS (", stream);
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
fputs_filtered (")", stream);
}
break;
case TYPE_CODE_STRUCT:
if (chill_varying_type (type))
{
chill_type_print_base (TYPE_FIELD_TYPE (type, 1),
stream, 0, level);
fputs_filtered (" VARYING", stream);
}
else
{
fprintf_filtered (stream, "STRUCT ");
fprintf_filtered (stream, "(\n");
if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
{
if (TYPE_STUB (type))
{
fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
}
else
{
fprintfi_filtered (level + 4, stream, "<no data fields>\n");
}
}
else
{
len = TYPE_NFIELDS (type);
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
{
struct type *field_type = TYPE_FIELD_TYPE (type, i);
QUIT;
print_spaces_filtered (level + 4, stream);
if (TYPE_CODE (field_type) == TYPE_CODE_UNION)
{
int j; /* variant number */
fputs_filtered ("CASE OF\n", stream);
for (j = 0; j < TYPE_NFIELDS (field_type); j++)
{
int k; /* variant field index */
struct type *variant_type
= TYPE_FIELD_TYPE (field_type, j);
int var_len = TYPE_NFIELDS (variant_type);
print_spaces_filtered (level + 4, stream);
if (strcmp (TYPE_FIELD_NAME (field_type, j),
"else") == 0)
fputs_filtered ("ELSE\n", stream);
else
fputs_filtered (":\n", stream);
if (TYPE_CODE (variant_type) != TYPE_CODE_STRUCT)
error ("variant record confusion");
for (k = 0; k < var_len; k++)
{
print_spaces_filtered (level + 8, stream);
chill_print_type (TYPE_FIELD_TYPE (variant_type, k),
TYPE_FIELD_NAME (variant_type, k),
stream, show - 1, level + 8);
if (k < (var_len - 1))
fputs_filtered (",", stream);
fputs_filtered ("\n", stream);
}
}
print_spaces_filtered (level + 4, stream);
fputs_filtered ("ESAC", stream);
}
else
chill_print_type (field_type,
TYPE_FIELD_NAME (type, i),
stream, show - 1, level + 4);
if (i < (len - 1))
{
fputs_filtered (",", stream);
}
fputs_filtered ("\n", stream);
}
}
fprintfi_filtered (level, stream, ")");
}
break;
case TYPE_CODE_RANGE:
{
struct type *target = TYPE_TARGET_TYPE (type);
if (target && TYPE_NAME (target))
fputs_filtered (TYPE_NAME (target), stream);
else
fputs_filtered ("RANGE", stream);
if (target == NULL)
target = builtin_type_long;
fputs_filtered (" (", stream);
print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
fputs_filtered (":", stream);
print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
fputs_filtered (")", stream);
}
break;
case TYPE_CODE_ENUM:
{
register int lastval = 0;
fprintf_filtered (stream, "SET (");
len = TYPE_NFIELDS (type);
for (i = 0; i < len; i++)
{
QUIT;
if (i)
fprintf_filtered (stream, ", ");
wrap_here (" ");
fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
{
fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i));
lastval = TYPE_FIELD_BITPOS (type, i);
}
lastval++;
}
fprintf_filtered (stream, ")");
}
break;
case TYPE_CODE_VOID:
case TYPE_CODE_UNDEF:
case TYPE_CODE_ERROR:
case TYPE_CODE_UNION:
case TYPE_CODE_METHOD:
error ("missing language support in chill_type_print_base");
break;
default:
/* Handle types not explicitly handled by the other cases,
such as fundamental types. For these, just print whatever
the type name is, as recorded in the type itself. If there
is no type name, then complain. */
if (TYPE_NAME (type) != NULL)
{
fputs_filtered (TYPE_NAME (type), stream);
}
else
{
error ("Unrecognized type code (%d) in symbol table.",
TYPE_CODE (type));
}
break;
}
}

View File

@ -1,605 +0,0 @@
/* Support for printing Chill values for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 2000, 2001
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 "defs.h"
#include "obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "valprint.h"
#include "expression.h"
#include "value.h"
#include "language.h"
#include "demangle.h"
#include "c-lang.h" /* For c_val_print */
#include "typeprint.h"
#include "ch-lang.h"
#include "annotate.h"
static void chill_print_value_fields (struct type *, char *,
struct ui_file *, int, int,
enum val_prettyprint, struct type **);
static void chill_print_type_scalar (struct type *, LONGEST,
struct ui_file *);
static void chill_val_print_array_elements (struct type *, char *,
CORE_ADDR, struct ui_file *,
int, int, int,
enum val_prettyprint);
/* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
Used to print data from type structures in a specified type. For example,
array bounds may be characters or booleans in some languages, and this
allows the ranges to be printed in their "natural" form rather than as
decimal integer values. */
static void
chill_print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
{
switch (TYPE_CODE (type))
{
case TYPE_CODE_RANGE:
if (TYPE_TARGET_TYPE (type))
{
chill_print_type_scalar (TYPE_TARGET_TYPE (type), val, stream);
return;
}
break;
case TYPE_CODE_UNDEF:
case TYPE_CODE_PTR:
case TYPE_CODE_ARRAY:
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
case TYPE_CODE_ENUM:
case TYPE_CODE_FUNC:
case TYPE_CODE_INT:
case TYPE_CODE_FLT:
case TYPE_CODE_VOID:
case TYPE_CODE_SET:
case TYPE_CODE_STRING:
case TYPE_CODE_BITSTRING:
case TYPE_CODE_ERROR:
case TYPE_CODE_MEMBER:
case TYPE_CODE_METHOD:
case TYPE_CODE_REF:
case TYPE_CODE_CHAR:
case TYPE_CODE_BOOL:
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF:
default:
break;
}
print_type_scalar (type, val, stream);
}
/* Print the elements of an array.
Similar to val_print_array_elements, but prints
element indexes (in Chill syntax). */
static void
chill_val_print_array_elements (struct type *type, char *valaddr,
CORE_ADDR address, struct ui_file *stream,
int format, int deref_ref, int recurse,
enum val_prettyprint pretty)
{
unsigned int i = 0;
unsigned int things_printed = 0;
unsigned len;
struct type *elttype;
struct type *range_type = TYPE_FIELD_TYPE (type, 0);
struct type *index_type = TYPE_TARGET_TYPE (range_type);
unsigned eltlen;
/* Position of the array element we are examining to see
whether it is repeated. */
unsigned int rep1;
/* Number of repetitions we have detected so far. */
unsigned int reps;
LONGEST low_bound = TYPE_FIELD_BITPOS (range_type, 0);
elttype = check_typedef (TYPE_TARGET_TYPE (type));
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
annotate_array_section_begin (i, elttype);
for (; i < len && things_printed < print_max; i++)
{
if (i != 0)
{
if (prettyprint_arrays)
{
fprintf_filtered (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
else
{
fprintf_filtered (stream, ", ");
}
}
wrap_here (n_spaces (2 + 2 * recurse));
rep1 = i + 1;
reps = 1;
while ((rep1 < len) &&
!memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
{
++reps;
++rep1;
}
fputs_filtered ("(", stream);
chill_print_type_scalar (index_type, low_bound + i, stream);
if (reps > 1)
{
fputs_filtered (":", stream);
chill_print_type_scalar (index_type, low_bound + i + reps - 1,
stream);
fputs_filtered ("): ", stream);
val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format,
deref_ref, recurse + 1, pretty);
i = rep1 - 1;
things_printed += 1;
}
else
{
fputs_filtered ("): ", stream);
val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format,
deref_ref, recurse + 1, pretty);
annotate_elt ();
things_printed++;
}
}
annotate_array_section_end ();
if (i < len)
{
fprintf_filtered (stream, "...");
}
}
/* Print data of type TYPE located at VALADDR (within GDB), which came from
the inferior at address ADDRESS, onto stdio stream STREAM according to
FORMAT (a letter or 0 for natural format). The data at VALADDR is in
target byte order.
If the data are a string pointer, returns the number of string characters
printed.
If DEREF_REF is nonzero, then dereference references, otherwise just print
them like pointers.
The PRETTY parameter controls prettyprinting. */
int
chill_val_print (struct type *type, char *valaddr, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int format,
int deref_ref, int recurse, enum val_prettyprint pretty)
{
LONGEST val;
unsigned int i = 0; /* Number of characters printed. */
struct type *elttype;
CORE_ADDR addr;
CHECK_TYPEDEF (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
{
if (prettyprint_arrays)
{
print_spaces_filtered (2 + 2 * recurse, stream);
}
fprintf_filtered (stream, "[");
chill_val_print_array_elements (type, valaddr, address, stream,
format, deref_ref, recurse, pretty);
fprintf_filtered (stream, "]");
}
else
{
error ("unimplemented in chill_val_print; unspecified array length");
}
break;
case TYPE_CODE_INT:
format = format ? format : output_format;
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
}
else
{
val_print_type_code_int (type, valaddr, stream);
}
break;
case TYPE_CODE_CHAR:
format = format ? format : output_format;
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
}
else
{
LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr),
stream);
}
break;
case TYPE_CODE_FLT:
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
}
else
{
print_floating (valaddr, type, stream);
}
break;
case TYPE_CODE_BOOL:
format = format ? format : output_format;
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
}
else
{
/* FIXME: Why is this using builtin_type_chill_bool not type? */
val = unpack_long (builtin_type_chill_bool, valaddr);
fprintf_filtered (stream, val ? "TRUE" : "FALSE");
}
break;
case TYPE_CODE_UNDEF:
/* This happens (without TYPE_FLAG_STUB set) on systems which don't use
dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
and no complete type for struct foo in that file. */
fprintf_filtered (stream, "<incomplete type>");
break;
case TYPE_CODE_PTR:
if (format && format != 's')
{
print_scalar_formatted (valaddr, type, format, 0, stream);
break;
}
addr = unpack_pointer (type, valaddr);
elttype = check_typedef (TYPE_TARGET_TYPE (type));
/* We assume a NULL pointer is all zeros ... */
if (addr == 0)
{
fputs_filtered ("NULL", stream);
return 0;
}
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
print_address_demangle (addr, stream, demangle);
/* Return value is irrelevant except for string pointers. */
return (0);
}
if (addressprint && format != 's')
{
print_address_numeric (addr, 1, stream);
}
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
if (TYPE_LENGTH (elttype) == 1
&& TYPE_CODE (elttype) == TYPE_CODE_CHAR
&& (format == 0 || format == 's')
&& addr != 0
&& /* If print_max is UINT_MAX, the alloca below will fail.
In that case don't try to print the string. */
print_max < UINT_MAX)
i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
/* Return number of characters printed, plus one for the
terminating null if we have "reached the end". */
return (i + (print_max && i != print_max));
break;
case TYPE_CODE_STRING:
i = TYPE_LENGTH (type);
LA_PRINT_STRING (stream, valaddr, i, 1, 0);
/* Return number of characters printed, plus one for the terminating
null if we have "reached the end". */
return (i + (print_max && i != print_max));
break;
case TYPE_CODE_BITSTRING:
case TYPE_CODE_SET:
elttype = TYPE_INDEX_TYPE (type);
CHECK_TYPEDEF (elttype);
if (TYPE_STUB (elttype))
{
fprintf_filtered (stream, "<incomplete type>");
gdb_flush (stream);
break;
}
{
struct type *range = elttype;
LONGEST low_bound, high_bound;
int i;
int is_bitstring = TYPE_CODE (type) == TYPE_CODE_BITSTRING;
int need_comma = 0;
if (is_bitstring)
fputs_filtered ("B'", stream);
else
fputs_filtered ("[", stream);
i = get_discrete_bounds (range, &low_bound, &high_bound);
maybe_bad_bstring:
if (i < 0)
{
fputs_filtered ("<error value>", stream);
goto done;
}
for (i = low_bound; i <= high_bound; i++)
{
int element = value_bit_index (type, valaddr, i);
if (element < 0)
{
i = element;
goto maybe_bad_bstring;
}
if (is_bitstring)
fprintf_filtered (stream, "%d", element);
else if (element)
{
if (need_comma)
fputs_filtered (", ", stream);
chill_print_type_scalar (range, (LONGEST) i, stream);
need_comma = 1;
/* Look for a continuous range of true elements. */
if (i + 1 <= high_bound && value_bit_index (type, valaddr, ++i))
{
int j = i; /* j is the upper bound so far of the range */
fputs_filtered (":", stream);
while (i + 1 <= high_bound
&& value_bit_index (type, valaddr, ++i))
j = i;
chill_print_type_scalar (range, (LONGEST) j, stream);
}
}
}
done:
if (is_bitstring)
fputs_filtered ("'", stream);
else
fputs_filtered ("]", stream);
}
break;
case TYPE_CODE_STRUCT:
if (chill_varying_type (type))
{
struct type *inner = check_typedef (TYPE_FIELD_TYPE (type, 1));
long length = unpack_long (TYPE_FIELD_TYPE (type, 0), valaddr);
char *data_addr = valaddr + TYPE_FIELD_BITPOS (type, 1) / 8;
switch (TYPE_CODE (inner))
{
case TYPE_CODE_STRING:
if (length > TYPE_LENGTH (type) - 2)
{
fprintf_filtered (stream,
"<dynamic length %ld > static length %d> *invalid*",
length, TYPE_LENGTH (type));
/* Don't print the string; doing so might produce a
segfault. */
return length;
}
LA_PRINT_STRING (stream, data_addr, length, 1, 0);
return length;
default:
break;
}
}
chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
0);
break;
case TYPE_CODE_REF:
if (addressprint)
{
fprintf_filtered (stream, "LOC(");
print_address_numeric
(extract_address (valaddr, TARGET_PTR_BIT / HOST_CHAR_BIT),
1,
stream);
fprintf_filtered (stream, ")");
if (deref_ref)
fputs_filtered (": ", stream);
}
/* De-reference the reference. */
if (deref_ref)
{
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_UNDEF)
{
struct value *deref_val =
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr),
NULL);
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val),
0,
VALUE_ADDRESS (deref_val), stream, format,
deref_ref, recurse + 1, pretty);
}
else
fputs_filtered ("???", stream);
}
break;
case TYPE_CODE_ENUM:
c_val_print (type, valaddr, 0, address, stream, format,
deref_ref, recurse, pretty);
break;
case TYPE_CODE_RANGE:
if (TYPE_TARGET_TYPE (type))
chill_val_print (TYPE_TARGET_TYPE (type), valaddr, 0, address, stream,
format, deref_ref, recurse, pretty);
break;
case TYPE_CODE_MEMBER:
case TYPE_CODE_UNION:
case TYPE_CODE_FUNC:
case TYPE_CODE_VOID:
case TYPE_CODE_ERROR:
default:
/* Let's defer printing to the C printer, rather than
print an error message. FIXME! */
c_val_print (type, valaddr, 0, address, stream, format,
deref_ref, recurse, pretty);
}
gdb_flush (stream);
return (0);
}
/* Mutually recursive subroutines of cplus_print_value and c_val_print to
print out a structure's fields: cp_print_value_fields and cplus_print_value.
TYPE, VALADDR, STREAM, RECURSE, and PRETTY have the
same meanings as in cplus_print_value and c_val_print.
DONT_PRINT is an array of baseclass types that we
should not print, or zero if called from top level. */
static void
chill_print_value_fields (struct type *type, char *valaddr,
struct ui_file *stream, int format, int recurse,
enum val_prettyprint pretty, struct type **dont_print)
{
int i, len;
int fields_seen = 0;
CHECK_TYPEDEF (type);
fprintf_filtered (stream, "[");
len = TYPE_NFIELDS (type);
if (len == 0)
{
fprintf_filtered (stream, "<No data fields>");
}
else
{
for (i = 0; i < len; i++)
{
if (fields_seen)
{
fprintf_filtered (stream, ", ");
}
fields_seen = 1;
if (pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
else
{
wrap_here (n_spaces (2 + 2 * recurse));
}
fputs_filtered (".", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
language_chill, DMGL_NO_OPTS);
fputs_filtered (": ", stream);
if (TYPE_FIELD_PACKED (type, i))
{
struct value *v;
/* Bitfields require special handling, especially due to byte
order problems. */
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
chill_val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0,
stream, format, 0, recurse + 1, pretty);
}
else
{
chill_val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0,
0, stream, format, 0, recurse + 1, pretty);
}
}
if (pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
}
}
fprintf_filtered (stream, "]");
}
int
chill_value_print (struct value *val, struct ui_file *stream, int format,
enum val_prettyprint pretty)
{
struct type *type = VALUE_TYPE (val);
struct type *real_type = check_typedef (type);
/* If it is a pointer, indicate what it points to.
Print type also if it is a reference. */
if (TYPE_CODE (real_type) == TYPE_CODE_PTR ||
TYPE_CODE (real_type) == TYPE_CODE_REF)
{
char *valaddr = VALUE_CONTENTS (val);
CORE_ADDR addr = unpack_pointer (type, valaddr);
if (TYPE_CODE (type) != TYPE_CODE_PTR || addr != 0)
{
int i;
char *name = TYPE_NAME (type);
if (name)
fputs_filtered (name, stream);
else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)
fputs_filtered ("PTR", stream);
else
{
fprintf_filtered (stream, "(");
type_print (type, "", stream, -1);
fprintf_filtered (stream, ")");
}
fprintf_filtered (stream, "(");
i = val_print (type, valaddr, 0, VALUE_ADDRESS (val),
stream, format, 1, 0, pretty);
fprintf_filtered (stream, ")");
return i;
}
}
return (val_print (type, VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
}

View File

@ -1,501 +0,0 @@
/* config.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
#undef _ALL_SOURCE
#endif
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if the `long double' type works. */
#undef HAVE_LONG_DOUBLE
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if you have <vfork.h>. */
#undef HAVE_VFORK_H
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define if the `setpgrp' function takes no argument. */
#undef SETPGRP_VOID
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define vfork as fork if vfork does not work. */
#undef vfork
/* Define if compiling on Solaris 7. */
#undef _MSE_INT_H
/* Define if your struct reg has r_fs. */
#undef HAVE_STRUCT_REG_R_FS
/* Define if your struct reg has r_gs. */
#undef HAVE_STRUCT_REG_R_GS
/* Define if <link.h> exists and defines struct link_map which has
members with an ``l_'' prefix. (For Solaris, SVR4, and
SVR4-like systems.) */
#undef HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS
/* Define if <link.h> exists and defines struct link_map which has
members with an ``lm_'' prefix. (For SunOS.) */
#undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS
/* Define if <link.h> exists and defines a struct so_map which has
members with an ``som_'' prefix. (Found on older *BSD systems.) */
#undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS
/* Define if <sys/link.h> has struct link_map32 */
#undef HAVE_STRUCT_LINK_MAP32
/* Define if the prfpregset_t type is broken. */
#undef PRFPREGSET_T_BROKEN
/* Define if you want to use new multi-fd /proc interface
(replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
#undef NEW_PROC_API
/* Define if ioctl argument PIOCSET is available. */
#undef HAVE_PROCFS_PIOCSET
/* Define if the `long long' type works. */
#undef CC_HAS_LONG_LONG
/* Define if the "ll" format works to print long long ints. */
#undef PRINTF_HAS_LONG_LONG
/* Define if the "%Lg" format works to print long doubles. */
#undef PRINTF_HAS_LONG_DOUBLE
/* Define if the "%Lg" format works to scan long doubles. */
#undef SCANF_HAS_LONG_DOUBLE
/* Define if using Solaris thread debugging. */
#undef HAVE_THREAD_DB_LIB
/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
#undef START_INFERIOR_TRAPS_EXPECTED
#undef sys_quotactl
/* Define if you have HPUX threads */
#undef HAVE_HPUX_THREAD_SUPPORT
/* Define if you want to use the memory mapped malloc package (mmalloc). */
#undef USE_MMALLOC
/* Define if the runtime uses a routine from mmalloc before gdb has a chance
to initialize mmalloc, and we want to force checking to be used anyway.
This may cause spurious memory corruption messages if the runtime tries
to explicitly deallocate that memory when gdb calls exit. */
#undef MMCHECK_FORCE
/* Define if <proc_service.h> on solaris uses int instead of
size_t, and assorted other type changes. */
#undef PROC_SERVICE_IS_OLD
/* If you want to specify a default CPU variant, define this to be its
name, as a C string. */
#undef TARGET_CPU_DEFAULT
/* Define if the simulator is being linked in. */
#undef WITH_SIM
/* Set to true if the save_state_t structure is present */
#undef HAVE_STRUCT_SAVE_STATE_T
/* Set to true if the save_state_t structure has the ss_wide member */
#undef HAVE_STRUCT_MEMBER_SS_WIDE
/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
#undef HAVE_PTRACE_GETREGS
/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
#undef HAVE_PTRACE_GETFPXREGS
/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
#undef HAVE_PT_GETDBREGS
/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
#undef HAVE_PT_GETXMMREGS
/* Define if gnu-regex.c included with GDB should be used. */
#undef USE_INCLUDED_REGEX
/* BFD's default architecture. */
#undef DEFAULT_BFD_ARCH
/* BFD's default target vector. */
#undef DEFAULT_BFD_VEC
/* Multi-arch enabled. */
#undef GDB_MULTI_ARCH
/* hostfile */
#undef GDB_XM_FILE
/* targetfile */
#undef GDB_TM_FILE
/* nativefile */
#undef GDB_NM_FILE
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
/* Define if you have the __argz_next function. */
#undef HAVE___ARGZ_NEXT
/* Define if you have the __argz_stringify function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define if you have the bcopy function. */
#undef HAVE_BCOPY
/* Define if you have the btowc function. */
#undef HAVE_BTOWC
/* Define if you have the bzero function. */
#undef HAVE_BZERO
/* Define if you have the canonicalize_file_name function. */
#undef HAVE_CANONICALIZE_FILE_NAME
/* Define if you have the dcgettext function. */
#undef HAVE_DCGETTEXT
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the isascii function. */
#undef HAVE_ISASCII
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
/* Define if you have the poll function. */
#undef HAVE_POLL
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
/* Define if you have the realpath function. */
#undef HAVE_REALPATH
/* Define if you have the sbrk function. */
#undef HAVE_SBRK
/* Define if you have the setenv function. */
#undef HAVE_SETENV
/* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE
/* Define if you have the setpgid function. */
#undef HAVE_SETPGID
/* Define if you have the setpgrp function. */
#undef HAVE_SETPGRP
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
/* Define if you have the sigprocmask function. */
#undef HAVE_SIGPROCMASK
/* Define if you have the sigsetmask function. */
#undef HAVE_SIGSETMASK
/* Define if you have the socketpair function. */
#undef HAVE_SOCKETPAIR
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define if you have the <asm/debugreg.h> header file. */
#undef HAVE_ASM_DEBUGREG_H
/* Define if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <link.h> header file. */
#undef HAVE_LINK_H
/* Define if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if you have the <ncurses.h> header file. */
#undef HAVE_NCURSES_H
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define if you have the <nlist.h> header file. */
#undef HAVE_NLIST_H
/* Define if you have the <objlist.h> header file. */
#undef HAVE_OBJLIST_H
/* Define if you have the <poll.h> header file. */
#undef HAVE_POLL_H
/* Define if you have the <proc_service.h> header file. */
#undef HAVE_PROC_SERVICE_H
/* Define if you have the <ptrace.h> header file. */
#undef HAVE_PTRACE_H
/* Define if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <sys/debugreg.h> header file. */
#undef HAVE_SYS_DEBUGREG_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/fault.h> header file. */
#undef HAVE_SYS_FAULT_H
/* Define if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
/* Define if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
/* Define if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H
/* Define if you have the <sys/ptrace.h> header file. */
#undef HAVE_SYS_PTRACE_H
/* Define if you have the <sys/reg.h> header file. */
#undef HAVE_SYS_REG_H
/* Define if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define if you have the <sys/syscall.h> header file. */
#undef HAVE_SYS_SYSCALL_H
/* Define if you have the <sys/user.h> header file. */
#undef HAVE_SYS_USER_H
/* Define if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
/* Define if you have the <term.h> header file. */
#undef HAVE_TERM_H
/* Define if you have the <termio.h> header file. */
#undef HAVE_TERMIO_H
/* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define if you have the <thread_db.h> header file. */
#undef HAVE_THREAD_DB_H
/* Define if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the <values.h> header file. */
#undef HAVE_VALUES_H
/* Define if you have the <wait.h> header file. */
#undef HAVE_WAIT_H
/* Define if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Define if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
/* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the w library (-lw). */
#undef HAVE_LIBW
/* Define if you have the stpcpy function */
#undef HAVE_STPCPY
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if NLS is requested */
#undef ENABLE_NLS
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define if sigsetjmp is available. */
#undef HAVE_SIGSETJMP
/* Define if malloc is not declared in system header files. */
#undef NEED_DECLARATION_MALLOC
/* Define if realloc is not declared in system header files. */
#undef NEED_DECLARATION_REALLOC
/* Define if free is not declared in system header files. */
#undef NEED_DECLARATION_FREE
/* Define if strerror is not declared in system header files. */
#undef NEED_DECLARATION_STRERROR
/* Define if strdup is not declared in system header files. */
#undef NEED_DECLARATION_STRDUP
/* Define if strstr is not declared in system header files. */
#undef NEED_DECLARATION_STRSTR
/* Define if <sys/procfs.h> has pstatus_t. */
#undef HAVE_PSTATUS_T
/* Define if <sys/procfs.h> has prrun_t. */
#undef HAVE_PRRUN_T
/* Define if <sys/procfs.h> has gregset_t. */
#undef HAVE_GREGSET_T
/* Define if <sys/procfs.h> has fpregset_t. */
#undef HAVE_FPREGSET_T
/* Define if <sys/procfs.h> has prgregset_t. */
#undef HAVE_PRGREGSET_T
/* Define if <sys/procfs.h> has prfpregset_t. */
#undef HAVE_PRFPREGSET_T
/* Define if <sys/procfs.h> has prgregset32_t. */
#undef HAVE_PRGREGSET32_T
/* Define if <sys/procfs.h> has prfpregset32_t. */
#undef HAVE_PRFPREGSET32_T
/* Define if <sys/procfs.h> has lwpid_t. */
#undef HAVE_LWPID_T
/* Define if <sys/procfs.h> has psaddr_t. */
#undef HAVE_PSADDR_T
/* Define if <sys/procfs.h> has prsysent_t. */
#undef HAVE_PRSYSENT_T
/* Define if <sys/procfs.h> has pr_sigset_t. */
#undef HAVE_PR_SIGSET_T
/* Define if <sys/procfs.h> has pr_sigaction64_t. */
#undef HAVE_PR_SIGACTION64_T
/* Define if <sys/procfs.h> has pr_siginfo64_t. */
#undef HAVE_PR_SIGINFO64_T

View File

@ -1,10 +0,0 @@
# Host: Little-endian Alpha running Linux
XM_FILE= xm-alphalinux.h
NAT_FILE= nm-linux.h
NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o linux-proc.o \
fork-child.o proc-service.o thread-db.o lin-lwp.o gcore.o
LOADLIBES = -ldl -rdynamic
MMALLOC =
MMALLOC_CFLAGS = -DNO_MMALLOC

View File

@ -1,3 +0,0 @@
# Target: Little-endian Alpha
TDEPFILES= alpha-tdep.o solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-alphalinux.h

View File

@ -1,5 +0,0 @@
# Host: Little-endian Alpha running OSF/1-1.x
XM_FILE= xm-alphaosf.h
NAT_FILE= nm-osf.h
NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \
solib-osf.o solib.o

View File

@ -1,3 +0,0 @@
# Target: Little-endian Alpha
TDEPFILES= alpha-tdep.o
TM_FILE= tm-alpha.h

View File

@ -1,61 +0,0 @@
/* Native definitions for alpha running GNU/Linux.
Copyright 1993, 1994, 1996, 1998, 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. */
#ifndef NM_LINUX_H
#define NM_LINUX_H
#include "nm-linux.h"
/* Figure out where the longjmp will land. We expect that we have just entered
longjmp and haven't yet setup the stack frame, so the args are still in the
argument regs. A0_REGNUM points at the jmp_buf structure from which we
extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
extern int get_longjmp_target (CORE_ADDR *);
/* ptrace register ``addresses'' are absolute. */
#define U_REGS_OFFSET 0
/* FIXME: This is probably true, or should be, on all GNU/Linux ports.
IA64? Sparc64? */
#define PTRACE_ARG3_TYPE long
/* ptrace transfers longs, the ptrace man page is lying. */
#define PTRACE_XFER_TYPE long
/* The alpha does not step over a breakpoint, the manpage is lying again. */
#define CANNOT_STEP_BREAKPOINT
/* GNU/Linux has shared libraries. */
#define GDB_TARGET_HAS_SHARED_LIBS
/* Given a pointer to either a gregset_t or fpregset_t, return a
pointer to the first register. */
#define ALPHA_REGSET_BASE(regsetp) ((long *) (regsetp))
#endif /* NM_LINUX_H */

View File

@ -1,83 +0,0 @@
/* Definitions to make GDB run on an Alpha box under GNU/Linux. The
definitions here are used when the _target_ system is running
GNU/Linux.
Copyright 1996, 1998, 1999, 2000, 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. */
#ifndef TM_LINUXALPHA_H
#define TM_LINUXALPHA_H
#include "alpha/tm-alpha.h"
/* Are we currently handling a signal ? */
extern long alpha_linux_sigtramp_offset (CORE_ADDR);
#undef IN_SIGTRAMP
#define IN_SIGTRAMP(pc, name) (alpha_linux_sigtramp_offset (pc) >= 0)
/* Get start and end address of sigtramp handler. */
#define SIGTRAMP_START(pc) (pc - alpha_linux_sigtramp_offset (pc))
#define SIGTRAMP_END(pc) (SIGTRAMP_START(pc) + 3*4)
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is 2
on GNU/Linux and most implementations. */
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
/* Return TRUE if procedure descriptor PROC is a procedure descriptor
that refers to a dynamically generated sigtramp function. */
#undef PROC_DESC_IS_DYN_SIGTRAMP
#define PROC_SIGTRAMP_MAGIC 0x0e0f0f0f
#define PROC_DESC_IS_DYN_SIGTRAMP(proc) ((proc)->pdr.isym \
== PROC_SIGTRAMP_MAGIC)
#undef SET_PROC_DESC_IS_DYN_SIGTRAMP
#define SET_PROC_DESC_IS_DYN_SIGTRAMP(proc) ((proc)->pdr.isym \
= PROC_SIGTRAMP_MAGIC)
/* If PC is inside a dynamically generated sigtramp function, return
how many bytes the program counter is beyond the start of that
function. Otherwise, return a negative value. */
#undef DYNAMIC_SIGTRAMP_OFFSET
#define DYNAMIC_SIGTRAMP_OFFSET(pc) (alpha_linux_sigtramp_offset (pc))
/* Translate a signal handler frame into the address of the sigcontext
structure. */
#undef SIGCONTEXT_ADDR
#define SIGCONTEXT_ADDR(frame) ((frame)->frame - 0x298)
/* If FRAME refers to a sigtramp frame, return the address of the next frame.
Under GNU/Linux, sigtramp handlers have dynamically generated
procedure descriptors that make this hack unnecessary. */
#undef FRAME_PAST_SIGTRAMP_FRAME
#define FRAME_PAST_SIGTRAMP_FRAME(frame, pc) (0)
#include "tm-linux.h"
#endif /* TM_LINUXALPHA_H */

View File

@ -1,26 +0,0 @@
/* Host definitions for GDB running on an Alpha under GNU/Linux.
Copyright 1996, 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. */
/* The alpha has no siginterrupt routine. */
#define NO_SIGINTERRUPT
#define HAVE_TERMIOS
#define USG

View File

@ -1,11 +0,0 @@
# Host: ARM based machine running GNU/Linux
XM_FILE= xm-linux.h
NAT_FILE= nm-linux.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
core-regset.o arm-linux-nat.o linux-proc.o gcore.o \
proc-service.o thread-db.o lin-lwp.o
LOADLIBES= -ldl -rdynamic

View File

@ -1,5 +0,0 @@
# Target: ARM based machine running GNU/Linux
TM_FILE= tm-linux.h
TDEPFILES= arm-tdep.o arm-linux-tdep.o solib.o solib-svr4.o solib-legacy.o
GDBSERVER_DEPFILES = linux-low.o linux-arm-low.o reg-arm.o

View File

@ -1,4 +0,0 @@
# Host ARM running NetBSD
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o armnbsd-nat.o
XM_FILE=xm-nbsd.h
NAT_FILE=nm-nbsd.h

View File

@ -1,42 +0,0 @@
/* Definitions to make GDB run on an ARM based machine under GNU/Linux.
Copyright 1999, 2000, 2001 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 NM_ARMLINUX_H
#define NM_ARMLINUX_H
#include "nm-linux.h"
/* ptrace register ``addresses'' are absolute. */
#define U_REGS_OFFSET 0
#ifdef GDBSERVER
#define REGISTER_U_ADDR(addr,blockend,regno) \
(addr) = arm_register_u_addr ((blockend),(regno))
#endif /* GDBSERVER */
/* Return sizeof user struct to callers in less machine dependent routines */
extern int kernel_u_size (void);
#define KERNEL_U_SIZE arm_linux_kernel_u_size()
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS
#endif /* NM_ARMLINUX_H */

View File

@ -1,94 +0,0 @@
/* Target definitions for GNU/Linux on ARM, for GDB.
Copyright 1999, 2000 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 TM_ARMLINUX_H
#define TM_ARMLINUX_H
#ifdef GDBSERVER
#define ARM_GNULINUX_TARGET
#endif
/* Include the common ARM target definitions. */
#include "arm/tm-arm.h"
#include "tm-linux.h"
/* Use target-specific function to define link map offsets. */
extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
#define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets ()
/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
#define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18)
/* We've multi-arched this. */
#undef IN_SOLIB_CALL_TRAMPOLINE
/* On ARM GNU/Linux, a call to a library routine does not have to go
through any trampoline code. */
#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) 0
/* We've multi-arched this. */
#undef SKIP_TRAMPOLINE_CODE
/* When we call a function in a shared library, and the PLT sends us
into the dynamic linker to find the function's real address, we
need to skip over the dynamic linker call. This function decides
when to skip, and where to skip to. See the comments for
SKIP_SOLIB_RESOLVER at the top of infrun.c. */
extern CORE_ADDR arm_linux_skip_solib_resolver (CORE_ADDR pc);
#define SKIP_SOLIB_RESOLVER arm_linux_skip_solib_resolver
/* When we call a function in a shared library, and the PLT sends us
into the dynamic linker to find the function's real address, we
need to skip over the dynamic linker call. This function decides
when to skip, and where to skip to. See the comments for
SKIP_SOLIB_RESOLVER at the top of infrun.c. */
#if 0
#undef IN_SOLIB_DYNSYM_RESOLVE_CODE
extern CORE_ADDR arm_in_solib_dynsym_resolve_code (CORE_ADDR pc, char *name);
#define IN_SOLIB_DYNSYM_RESOLVE_CODE arm_in_solib_dynsym_resolve_code
/* ScottB: Current definition is
extern CORE_ADDR in_svr4_dynsym_resolve_code (CORE_ADDR pc, char *name);
#define IN_SOLIB_DYNSYM_RESOLVE_CODE in_svr4_dynsym_resolve_code */
#endif
/* When the ARM Linux kernel invokes a signal handler, the return
address points at a special instruction which'll trap back into
the kernel. These definitions are used to identify this bit of
code as a signal trampoline in order to support backtracing
through calls to signal handlers. */
int arm_linux_in_sigtramp (CORE_ADDR pc, char *name);
#define IN_SIGTRAMP(pc, name) arm_linux_in_sigtramp (pc, name)
/* Each OS has different mechanisms for accessing the various
registers stored in the sigcontext structure. These definitions
provide a mechanism by which the generic code in arm-tdep.c can
find the addresses at which various registers are saved at in the
sigcontext structure. If SIGCONTEXT_REGISTER_ADDRESS is not
defined, arm-tdep.c will define it to be 0. (See ia64-tdep.c and
ia64-linux-tdep.c to see what a similar mechanism looks like when
multi-arched.) */
extern CORE_ADDR arm_linux_sigcontext_register_address (CORE_ADDR, CORE_ADDR,
int);
#define SIGCONTEXT_REGISTER_ADDRESS arm_linux_sigcontext_register_address
#endif /* TM_ARMLINUX_H */

View File

@ -1,28 +0,0 @@
/* Host definitions for ARM GNU/Linux, for GDB, the GNU debugger.
Copyright 1999, 2001 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 XM_ARMLINUX_H
#define XM_ARMLINUX_H
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
#endif /* XM_ARMLINUX_H */

View File

@ -1,5 +0,0 @@
MH_CFLAGS=
XM_FILE=xm-cygwin.h
NATDEPFILES= i386-nat.o win32-nat.o corelow.o
NAT_FILE=nm-cygwin.h
XM_CLIBS=

View File

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

View File

@ -1,3 +0,0 @@
# Target: GDBSERVE.NLM running on a i386
TDEPFILES= i386.o
CPU_FILE= i386

View File

@ -1,9 +0,0 @@
# Host: IBM PS/2 (i386) running AIX PS/2
XM_FILE= xm-i386aix.h
NAT_FILE= nm-i386aix.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o i386aix-nat.o
# Use gcc. Only coff output can be debugged
CC=gcc

View File

@ -1,7 +0,0 @@
# This port, for aix ps/2 (i386), will allow you to debug the coff
# output generated gcc-2.3.3 + gas. It will not understand IBM's
# proprietary debug info.
#
# Target: IBM PS/2 (i386) running AIX PS/2
TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-i386aix.h

View File

@ -1,6 +0,0 @@
# Host: Intel 386 running 386BSD
XM_FILE= xm-i386bsd.h
NAT_FILE= nm-i386bsd.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o core-aout.o i386b-nat.o

View File

@ -1,3 +0,0 @@
# Target: Intel 386 running BSD
TM_FILE= tm-i386bsd.h
TDEPFILES= i386-tdep.o

View File

@ -1,10 +0,0 @@
# Host: Intel 386 running DGUX, cloned from SVR4
XM_FILE= xm-i386v4.h
# for network communication
XM_CLIBS= -lsocket -lnsl
NAT_FILE= nm-i386v4.h
NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o \
solib.o solib-svr4.o solib-legacy.o \
procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o

View File

@ -1,6 +0,0 @@
# Host: Intel 386 running Mach3
NATDEPFILES= i386m3-nat.o m3-nat.o fork-child.o i387-tdep.o core-aout.o
NAT_CLIBS= -lmachid -lnetname -lmach
XM_FILE= xm-i386m3.h
NAT_FILE= nm-m3.h

View File

@ -1,3 +0,0 @@
# Target: Intel 386 with a.out under Mach 3
TDEPFILES= i386-tdep.o
TM_FILE= tm-i386m3.h

View File

@ -1,9 +0,0 @@
# Host: Intel 386 running Mach
# This is for mach2, maybe, or is obsolete (and seems to have only
# host and native, not target). Once we get the mach3 stuff working,
# I think it can go away.
XM_FILE= xm-i386mach.h
NAT_FILE= nm-i386mach.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o i386mach-nat.o

View File

@ -1,4 +0,0 @@
# Host: Intel 386 running Mach3 with OSF 1/MK
NATDEPFILES= os-mach3.o i386mach3-xdep.o i387-tdep.o
XM_FILE= xm-i386osf1mk.h

View File

@ -1,6 +0,0 @@
# Target: Intel 386 with a.out in osf 1/mk
TDEPFILES= i386-tdep.o
TM_FILE= tm-i386osf1mk.h
TM_CFLAGS= -I/usr/mach3/include
TM_CLIBS= /usr/mach3/ccs/lib/libmachid.a /usr/mach3/ccs/lib/libnetname.a /usr/mach3/ccs/lib/libmach.a

View File

@ -1,3 +0,0 @@
# Target: Intel 386 running OS9000
TDEPFILES= i386-tdep.o remote-os9k.o
TM_FILE= tm-i386os9k.h

View File

@ -1,3 +0,0 @@
# Target: Intel 386 running SCO Open Server 5
TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-i386sco5.h

View File

@ -1,8 +0,0 @@
# Host: Intel 386 running System V release 3.2
XM_FILE= xm-i386v32.h
XM_CLIBS= -lPW
NAT_FILE= nm-i386v.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o i386v-nat.o

View File

@ -1,3 +0,0 @@
# Target: Intel 386 running SVR4
TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-i386v4.h

View File

@ -1,3 +0,0 @@
# Target: Intel 386 running SVR4.2MP
TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-i386v42mp.h

View File

@ -1,12 +0,0 @@
# Host: Intel 386 running GNU/Linux.
XM_FILE= xm-i386.h
NAT_FILE= nm-linux.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \
core-aout.o i386-nat.o i386-linux-nat.o i387-nat.o \
proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
LOADLIBES = -ldl -rdynamic

View File

@ -1,6 +0,0 @@
# Target: Intel 386 running GNU/Linux
TDEPFILES= i386-tdep.o i386-linux-tdep.o i387-tdep.o \
solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-linux.h
GDBSERVER_DEPFILES = linux-low.o linux-i386-low.o reg-i386.o

View File

@ -1,12 +0,0 @@
# Host: Intel 386 running NetBSD
# NATDEPFILES must remain entirely on one line for *BSD. When
# building a cross debugger, configure will cause this line to be
# commented out in the Makefile. BSD make doesn't permit the use of a
# continuation character (backslash) to extend a commented line. As a
# consequence, BSD make considers subsequent tab-indented lines to be
# "unassociated shell commands".
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o i387-nat.o i386bsd-nat.o i386nbsd-nat.o solib.o solib-sunos.o
XM_FILE= xm-nbsd.h
NAT_FILE= nm-nbsd.h

View File

@ -1,5 +0,0 @@
# Target: Intel 386 running NetBSD
TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o
TM_FILE= tm-nbsdelf.h
## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o

View File

@ -1,38 +0,0 @@
/* Native definitions for Intel x86 running CYGWIN.
Copyright (C) 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. */
#define NO_PTRACE_H
#define I386_USE_GENERIC_WATCHPOINTS
#include "i386/nm-i386.h"
/* Support for hardware-assisted breakpoints and watchpoints. */
#define I386_DR_LOW_SET_CONTROL(VAL) cygwin_set_dr7 (VAL)
extern void cygwin_set_dr7 (unsigned);
#define I386_DR_LOW_SET_ADDR(N,ADDR) cygwin_set_dr (N,ADDR)
extern void cygwin_set_dr (int, CORE_ADDR);
#define I386_DR_LOW_RESET_ADDR(N)
#define I386_DR_LOW_GET_STATUS() cygwin_get_dr6 ()
extern unsigned cygwin_get_dr6 (void);

View File

@ -1,23 +0,0 @@
/* Native-dependent definitions for Intel 386 running the GNU Hurd
Copyright 1994, 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 the generic hurd definitions. */
#include "nm-gnu.h"

View File

@ -1,43 +0,0 @@
/* Native support for i386 aix ps/2.
Copyright 1986, 1987, 1989, 1992, 1993 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. */
/*
* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com)
* Revision: 5-May-93 00:11:35
*/
#ifndef NM_I386AIX_H
#define NM_I386AIX_H 1
/* code to execute to print interesting information about the
* floating point processor (if any)
* No need to define if there is nothing to do.
*/
#define FLOAT_INFO { i386_float_info (); }
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
#undef KERNEL_U_ADDR
#define KERNEL_U_ADDR 0xf03fd000
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS
#endif /* NM_I386AIX_H */

View File

@ -1,40 +0,0 @@
/* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
Copyright 1986, 1987, 1989, 1992, 1993, 2000
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 NM_I386BSD_H
#define NM_I386BSD_H
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
#include <machine/vmparam.h>
#define KERNEL_U_ADDR USRSTACK
#undef FLOAT_INFO /* No float info yet */
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = i386_register_u_addr ((blockend),(regno));
extern int i386_register_u_addr (int, int);
#define PTRACE_ARG3_TYPE char*
#endif /* NM_I386BSD_H */

View File

@ -1,30 +0,0 @@
/* Native definitions for Mach on an Intel 386
Copyright 1986, 1987, 1989, 1991, 1992, 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 "regcache.h"
/* Do implement the attach and detach commands. */
/* #define ATTACH_DETACH 1 */
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS
#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)

View File

@ -1,83 +0,0 @@
/* Native support for GNU/Linux x86.
Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
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. */
#ifndef NM_LINUX_H
#define NM_LINUX_H
/* GNU/Linux supports the i386 hardware debugging registers. */
#define I386_USE_GENERIC_WATCHPOINTS
#include "i386/nm-i386.h"
#include "nm-linux.h"
/* Support for the user area. */
/* Return the size of the user struct. */
extern int kernel_u_size (void);
#define KERNEL_U_SIZE kernel_u_size()
/* This is the amount to substract from u.u_ar0 to get the offset in
the core file of the register values. */
#define KERNEL_U_ADDR 0
/* Offset of the registers within the user area. */
#define U_REGS_OFFSET 0
extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum);
#define REGISTER_U_ADDR(addr, blockend, regnum) \
(addr) = register_u_addr (blockend, regnum)
/* Provide access to the i386 hardware debugging registers. */
extern void i386_linux_dr_set_control (unsigned long control);
#define I386_DR_LOW_SET_CONTROL(control) \
i386_linux_dr_set_control (control)
extern void i386_linux_dr_set_addr (int regnum, CORE_ADDR addr);
#define I386_DR_LOW_SET_ADDR(regnum, addr) \
i386_linux_dr_set_addr (regnum, addr)
extern void i386_linux_dr_reset_addr (int regnum);
#define I386_DR_LOW_RESET_ADDR(regnum) \
i386_linux_dr_reset_addr (regnum)
extern unsigned long i386_linux_dr_get_status (void);
#define I386_DR_LOW_GET_STATUS() \
i386_linux_dr_get_status ()
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
#define FETCH_INFERIOR_REGISTERS
/* Nevertheless, define CANNOT_{FETCH,STORE}_REGISTER, because we
might fall back on the code `infptrace.c' (well a copy of that code
in `i386-linux-nat.c' for now) and we can access only the
general-purpose registers in that way. */
extern int cannot_fetch_register (int regno);
extern int cannot_store_register (int regno);
#define CANNOT_FETCH_REGISTER(regno) cannot_fetch_register (regno)
#define CANNOT_STORE_REGISTER(regno) cannot_store_register (regno)
/* Override child_resume in `infptrace.c'. */
#define CHILD_RESUME
#endif /* nm-linux.h */

View File

@ -1,23 +0,0 @@
/* Native-dependent definitions for Intel 386 running Mach 3.
Copyright 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. */
/* Include the generic Mach 3 definitions. */
#include "nm-m3.h"

View File

@ -1,28 +0,0 @@
/* Native-dependent definitions for Intel 386 running NetBSD, for GDB.
Copyright 1986, 1987, 1989, 1992, 1994, 2000
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 NM_NBSDELF_H
#define NM_NBSDELF_H
#define SVR4_SHARED_LIBS
#include "i386/nm-nbsd.h"
#endif /* NM_NBSDELF_H */

View File

@ -1,66 +0,0 @@
/* Definitions to make GDB run on a Sequent Symmetry under ptx
with Weitek 1167 and i387 support.
Copyright 1986, 1987, 1989, 1992, 1994, 1996, 2000
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 "regcache.h"
#include "nm-sysv4.h"
#undef USE_PROC_FS
#include "nm-symmetry.h"
#define PTRACE_READ_REGS(pid,regaddr) mptrace (XPT_RREGS, (pid), (regaddr), 0)
#define PTRACE_WRITE_REGS(pid,regaddr) \
mptrace (XPT_WREGS, (pid), (regaddr), 0)
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS
/* We must fetch all the regs before storing, since we store all at once. */
#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
#define CHILD_WAIT
struct target_waitstatus;
extern ptid_t child_wait (ptid_t, struct target_waitstatus *);
/*
* ptx does attach as of ptx version 2.1. Prior to that, the interface
* exists but does not work.
*
* FIXME: Using attach/detach requires using the ptx MPDEBUGGER
* interface. There are still problems with that, so for now don't
* enable attach/detach. If you turn it on anyway, it will mostly
* work, but has a number of bugs. -fubar, 2/94.
*/
/*#define ATTACH_DETACH 1 */
#undef ATTACH_DETACH
#define PTRACE_ATTACH XPT_DEBUG
#define PTRACE_DETACH XPT_UNDEBUG
/*
* The following drivel is needed because there are two ptrace-ish
* calls on ptx: ptrace() and mptrace(), each of which does about half
* of the ptrace functions.
*/
#define PTRACE_ATTACH_CALL(pid) ptx_do_attach(pid)
#define PTRACE_DETACH_CALL(pid, signo) ptx_do_detach(pid, signo)

View File

@ -1,50 +0,0 @@
/* Definitions to make GDB run on a Sequent Symmetry under dynix 3.0,
with Weitek 1167 and i387 support.
Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1998, 2000
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 "regcache.h"
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS
/* We must fetch all the regs before storing, since we store all at once. */
#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
#ifdef _SEQUENT_
#define CHILD_WAIT
extern ptid_t child_wait (ptid_t, struct target_waitstatus *);
#endif
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
#ifdef _SEQUENT_
#include <sys/param.h>
#include <sys/user.h>
#include <sys/mc_vmparam.h>
/* VA_UAREA is defined in <sys/mc_vmparam.h>, and is dependant upon
sizeof(struct user) */
#define KERNEL_U_ADDR (VA_UAREA) /* ptx */
#else
#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) /* dynix */
#endif

View File

@ -1,90 +0,0 @@
/* Native support for GNU/Linux x86-64.
Copyright 2001, 2002 Free Software Foundation, Inc. Contributed by
Jiri Smid, SuSE Labs.
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 NM_X86_64_H
#define NM_X86_64_H
#include "nm-linux.h"
#define I386_USE_GENERIC_WATCHPOINTS
#include "i386/nm-i386.h"
/* Support for 8-byte wide hw watchpoints. */
#define TARGET_HAS_DR_LEN_8 1
/* Provide access to the i386 hardware debugging registers. */
extern void x86_64_linux_dr_set_control (unsigned long control);
#define I386_DR_LOW_SET_CONTROL(control) \
x86_64_linux_dr_set_control (control)
extern void x86_64_linux_dr_set_addr (int regnum, CORE_ADDR addr);
#define I386_DR_LOW_SET_ADDR(regnum, addr) \
x86_64_linux_dr_set_addr (regnum, addr)
extern void x86_64_linux_dr_reset_addr (int regnum);
#define I386_DR_LOW_RESET_ADDR(regnum) \
x86_64_linux_dr_reset_addr (regnum)
extern unsigned long x86_64_linux_dr_get_status (void);
#define I386_DR_LOW_GET_STATUS() \
x86_64_linux_dr_get_status ()
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = x86_64_register_u_addr ((blockend),(regno));
CORE_ADDR x86_64_register_u_addr (CORE_ADDR, int);
/* Return the size of the user struct. */
#define KERNEL_U_SIZE kernel_u_size()
extern int kernel_u_size (void);
/* Offset of the registers within the user area. */
#define U_REGS_OFFSET 0
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
#define PTRACE_ARG3_TYPE void*
#define PTRACE_XFER_TYPE unsigned long
/* We define this if link.h is available, because with ELF we use SVR4 style
shared libraries. */
#ifdef HAVE_LINK_H
#define SVR4_SHARED_LIBS
#include "solib.h" /* Support for shared libraries. */
#endif
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
#define FETCH_INFERIOR_REGISTERS
#undef PREPARE_TO_PROCEED
#include <signal.h>
extern void lin_thread_get_thread_signals (sigset_t * mask);
#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
#endif /* NM_X86_64.h */

View File

@ -1,7 +0,0 @@
# Host: Sequent Symmetry running ptx 1.3, with Weitek 1167 or i387
XM_FILE= xm-ptx.h
NATDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o core-aout.o
XM_CLIBS= -lPW -lseq
NAT_FILE= nm-symmetry.h

View File

@ -1,3 +0,0 @@
# Target: Sequent Symmetry running ptx 2.0, with Weitek 1167 or i387.
TDEPFILES= symm-tdep.o i387-tdep.o i386-tdep.o
TM_FILE= tm-ptx.h

View File

@ -1,8 +0,0 @@
# Host: Sequent Symmetry running ptx 1.3, with Weitek 1167 or i387
XM_FILE= xm-ptx4.h
NATDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o core-aout.o \
core-regset.o solib.o solib-svr4.o solib-legacy.o
XM_CLIBS= -lseq
NAT_FILE= nm-ptx4.h

View File

@ -1,3 +0,0 @@
# Target: Sequent Symmetry running ptx 4.0, with Weitek 1167 or i387.
TDEPFILES= symm-tdep.o i387-tdep.o i386-tdep.o
TM_FILE= tm-ptx4.h

View File

@ -1,4 +0,0 @@
# Host: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
XM_FILE= xm-symmetry.h
NAT_FILE= nm-symmetry.h
NATDEPFILES= inftarg.o fork-child.o corelow.o core-aout.o symm-nat.o

View File

@ -1,3 +0,0 @@
# Target: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
TDEPFILES= i386-tdep.o symm-tdep.o i387-tdep.o
TM_FILE= tm-symmetry.h

View File

@ -1,49 +0,0 @@
/* Macro definitions for i386 running under the win32 API Unix.
Copyright 1995, 1996, 1997, 1998, 1999, 2000
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. */
/* Use SSE registers if winnt.h contains information about them. */
#ifdef HAVE_CONTEXT_EXTENDED_REGISTERS
#define HAVE_SSE_REGS
#else
#undef HAVE_SSE_REGS
#endif /* CONTEXT_EXTENDED_REGISTERS */
#define HAVE_I387_REGS
#include "i386/tm-i386.h"
#if 0
#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 (CORE_ADDR pc, char *name);
#endif
#define ATTACH_NO_WAIT
#define SOLIB_ADD(filename, from_tty, targ, readsyms) child_solib_add(filename, from_tty, targ, readsyms)
#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid)
#define CLEAR_SOLIB child_clear_solibs
#define ADD_SHARED_SYMBOL_FILES dll_symbol_command
struct target_ops;
char *cygwin_pid_to_str (ptid_t ptid);
void child_solib_add (char *, int, struct target_ops *, int);
char *child_solib_loaded_library_pathname(int);
void child_clear_solibs (void);
void dll_symbol_command (char *, int);

View File

@ -1,48 +0,0 @@
/* Macro defintions for IBM AIX PS/2 (i386).
Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 2000
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. */
/* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com). */
#ifndef TM_I386AIX_H
#define TM_I386AIX_H 1
#include "i386/tm-i386.h"
#include <sys/reg.h>
#ifndef I386
#define I386 1
#endif
/* AIX/i386 has FPU support. However, the native configuration (which
is the only supported configuration) doesn't make the FPU control
registers available. Override the appropriate symbols such that
only the normal FPU registers are included in GDB's register array. */
#undef NUM_FPREGS
#define NUM_FPREGS (8)
#undef NUM_REGS
#define NUM_REGS (NUM_GREGS + NUM_FPREGS)
#undef REGISTER_BYTES
#define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS)
#endif /* TM_I386AIX_H */

View File

@ -1,45 +0,0 @@
/* Macro definitions for i386 running under BSD Unix.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 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. */
#ifndef TM_I386BSD_H
#define TM_I386BSD_H 1
#include "i386/tm-i386.h"
/* 386BSD cannot handle the segment registers. */
/* BSDI can't handle them either. */
#undef NUM_REGS
#define NUM_REGS 10
/* On 386 bsd, sigtramp is above the user stack and immediately below
the user area. Using constants here allows for cross debugging.
These are tested for BSDI but should work on 386BSD. */
#define SIGTRAMP_START(pc) 0xfdbfdfc0
#define SIGTRAMP_END(pc) 0xfdbfe000
/* Saved Pc. Get it from sigcontext if within sigtramp. */
/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
#define SIGCONTEXT_PC_OFFSET 20
#endif /* ifndef TM_I386BSD_H */

View File

@ -1,56 +0,0 @@
/* Macro definitions for i386 running the GNU Hurd.
Copyright 1992, 1999, 2000 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 TM_I386GNU_H
#define TM_I386GNU_H 1
/* Include common definitions for GNU systems.
FIXME: This does not belong here since this is supposed to contain
only native-dependent information. */
#include "nm-gnu.h"
/* Thread flavors used in re-setting the T bit.
FIXME: This is native-dependent. */
#define THREAD_STATE_FLAVOR i386_REGS_SEGS_STATE
#define THREAD_STATE_SIZE i386_THREAD_STATE_COUNT
#define THREAD_STATE_SET_TRACED(state) \
((struct i386_thread_state *)state)->efl |= 0x100
#define THREAD_STATE_CLEAR_TRACED(state) \
((((struct i386_thread_state *)state)->efl &= ~0x100), 1)
/* We can attach and detach.
FIXME: This is probably native-dependent too. */
#define ATTACH_DETACH 1
#define HAVE_I387_REGS
#include "i386/tm-i386.h"
/* We use stabs-in-ELF with the DWARF register numbering scheme. */
#undef STAB_REG_TO_REGNUM
#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
/* Offset to saved PC in sigcontext. */
#define SIGCONTEXT_PC_OFFSET 68
/* We need this file for the SOLIB_TRAMPOLINE stuff. */
#include "tm-sysv4.h"
#endif /* TM_I386GNU_H */

View File

@ -1,56 +0,0 @@
/* Macro definitions for i386, Mach 3.0
Copyright 1992, 1993, 1995, 1999 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 common definitions for Mach3 systems */
#include "nm-m3.h"
/* Define offsets to access CPROC stack when it does not have
* a kernel thread.
*/
#define MACHINE_CPROC_SP_OFFSET 20
#define MACHINE_CPROC_PC_OFFSET 16
#define MACHINE_CPROC_FP_OFFSET 12
/* Thread flavors used in re-setting the T bit.
* @@ this is also bad for cross debugging.
*/
#define TRACE_FLAVOR i386_THREAD_STATE
#define TRACE_FLAVOR_SIZE i386_THREAD_STATE_COUNT
#define TRACE_SET(x,state) \
((struct i386_thread_state *)state)->efl |= 0x100
#define TRACE_CLEAR(x,state) \
((((struct i386_thread_state *)state)->efl &= ~0x100), 1)
/* we can do it */
#define ATTACH_DETACH 1
/* Sigh. There should be a file for i386 but no sysv stuff in it */
#include "i386/tm-i386.h"
/* I want to test this float info code. See comment in tm-i386v.h */
#undef FLOAT_INFO
#define FLOAT_INFO { i386_mach3_float_info (); }
/* Address of end of stack space.
* for MACH, see <machine/vmparam.h>
* @@@ I don't know what is in the 5 ints...
*/
#undef STACK_END_ADDR
#define STACK_END_ADDR (0xc0000000-sizeof(int [5]))

View File

@ -1,38 +0,0 @@
/* Macro definitions for i386, Mach 3.0, OSF 1/MK
Copyright 1992, 1993, 2000 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. */
/* Until OSF switches to a newer Mach kernel that has
* a different get_emul_vector() interface.
*/
#define MK67 1
#include "i386/tm-i386m3.h"
/* FIMXE: kettenis/2000-03-26: On OSF 1, `long double' is equivalent
to `double'. However, I'm not sure what is the consequence of:
#define TARGET_LONG_DOUBLE_FORMAT TARGET_DOUBLE_FORMAT
#define TARGET_LONG_DOUBLE_BIT TARGET_DOUBLE_BIT
So I'll go with the current status quo instead. It looks like this
target won't compile anyway. Perhaps it should be obsoleted? */
#undef TARGET_LONG_DOUBLE_FORMAT
#undef TARGET_LONG_DOUBLE_BIT

View File

@ -1,49 +0,0 @@
/* Macro definitions for i386 running NetWare.
Copyright 1993, 1994, 1995, 1998, 1999, 2000
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 TM_I386NW_H
#define TM_I386NW_H 1
#include "i386/tm-i386.h"
/* Stop backtracing when we wander into main. */
#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
/* Offsets (in target ints) into jmp_buf. Not defined in any system header
file, so we have to step through setjmp/longjmp with a debugger and figure
them out. */
#define JB_ELEMENT_SIZE 4 /* jmp_buf[] is array of ints */
#define JB_PC 6 /* Setjmp()'s return PC saved here */
/* Figure out where the longjmp will land. Slurp the args out of the stack.
We expect the first arg to be a pointer to the jmp_buf structure from which
we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
extern int get_longjmp_target (CORE_ADDR *);
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
#endif /* ifndef TM_I386NW_H */

View File

@ -1,65 +0,0 @@
/* Macro definitions for i386 running under BSD Unix.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996
Free Software Foundation, Inc.
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 TM_I386OS9K_H
#define TM_I386OS9K_H 1
#include "i386/tm-i386.h"
/* Number of machine registers */
#undef NUM_REGS
#define NUM_REGS (16) /* Basic i*86 regs */
/* Initializer for an array of names of registers. There should be at least
NUM_REGS strings in this initializer. Any excess ones are simply ignored.
The order of the first 8 registers must match the compiler's numbering
scheme (which is the same as the 386 scheme) and also regmap in the various
*-nat.c files. */
#undef REGISTER_NAME
#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
"esp", "ebp", "esi", "edi", \
"eip", "eflags", "cs", "ss", \
"ds", "es", "fs", "gs", \
}
#define DATABASE_REG 3 /* ebx */
/* Amount PC must be decremented by after a breakpoint. This is often the
number of bytes in BREAKPOINT but not always (such as now). */
#undef DECR_PC_AFTER_BREAK
#define DECR_PC_AFTER_BREAK 0
/* On 386 bsd, sigtramp is above the user stack and immediately below
the user area. Using constants here allows for cross debugging.
These are tested for BSDI but should work on 386BSD. */
#define SIGTRAMP_START(pc) 0xfdbfdfc0
#define SIGTRAMP_END(pc) 0xfdbfe000
/* Saved Pc. Get it from sigcontext if within sigtramp. */
/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
#define SIGCONTEXT_PC_OFFSET 20
#define BELIEVE_PCC_PROMOTION 1
#endif /* #ifndef TM_I386OS9K_H */

View File

@ -1,63 +0,0 @@
/* Macro definitions for GDB on an Intel i386 running SCO Open Server 5.
Copyright 1998 Free Software Foundation, Inc.
Written by J. Kean Johnston (jkj@sco.com).
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 TM_I386SCO5_H
#define TM_I386SCO5_H 1
/* Pick up most of what we need from the generic i386 target include file. */
#include "i386/tm-i386.h"
/* Pick up more stuff from the generic SYSV and SVR4 host include files. */
#include "i386/tm-i386v.h"
#include "tm-sysv4.h"
#define KERNEL_U_SIZE kernel_u_size()
/*
* SCO is unlike other SVR3 targets in that it has SVR4 style shared
* libs, with a slight twist. We expect 3 traps (2 for the exec and
* one for the dynamic loader). After the third trap we insert the
* SOLIB breakpoints, then wait for the 4th trap.
*/
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 3
/* We can also do hardware watchpoints */
#define TARGET_HAS_HARDWARE_WATCHPOINTS
#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
/* After a watchpoint trap, the PC points to the instruction which
caused the trap. But we can continue over it without disabling the
trap. */
#define HAVE_CONTINUABLE_WATCHPOINT
#define HAVE_STEPPABLE_WATCHPOINT
#define STOPPED_BY_WATCHPOINT(W) \
i386_stopped_by_watchpoint (PIDGET (inferior_ptid))
#define target_insert_watchpoint(addr, len, type) \
i386_insert_watchpoint (PIDGET (inferior_ptid), addr, len, type)
#define target_remove_watchpoint(addr, len, type) \
i386_remove_watchpoint (PIDGET (inferior_ptid), addr, len)
#endif /* ifndef TM_I386SCO5_H */

View File

@ -1,36 +0,0 @@
/* Macro definitions for i386, Unix System V.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
2000, 2001 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 TM_I386V_H
#define TM_I386V_H 1
/* First pick up the generic *86 target file. */
#include "i386/tm-i386.h"
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is
2 on most implementations. Override here to 4. */
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 4
#endif /* ifndef TM_I386V_H */

View File

@ -1,79 +0,0 @@
/* Macro definitions for GDB on an Intel i386 running SVR4.
Copyright 1991, 1994, 1995, 1998, 1999, 2000
Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
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 TM_I386V4_H
#define TM_I386V4_H 1
/* Pick up most of what we need from the generic i386 target include file. */
#define HAVE_I387_REGS
#include "i386/tm-i386.h"
/* Pick up more stuff from the generic SVR4 host include file. */
#include "tm-sysv4.h"
/* Use the alternate method of determining valid frame chains. */
#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
/* Offsets (in target ints) into jmp_buf. Not defined in any system header
file, so we have to step through setjmp/longjmp with a debugger and figure
them out. Note that <setjmp> defines _JBLEN as 10, which is the default
if no specific machine is selected, even though we only use 6 slots. */
#define JB_ELEMENT_SIZE sizeof(int) /* jmp_buf[_JBLEN] is array of ints */
#define JB_EBX 0
#define JB_ESI 1
#define JB_EDI 2
#define JB_EBP 3
#define JB_ESP 4
#define JB_EDX 5
#define JB_PC JB_EDX /* Setjmp()'s return PC saved in EDX */
/* Figure out where the longjmp will land. Slurp the args out of the stack.
We expect the first arg to be a pointer to the jmp_buf structure from which
we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
extern int get_longjmp_target (CORE_ADDR *);
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
/* The following redefines make backtracing through sigtramp work.
They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp
from the ucontext structure which is pushed by the kernel on the
user stack. Unfortunately there are three variants of sigtramp handlers. */
#define I386V4_SIGTRAMP_SAVED_PC
#define IN_SIGTRAMP(pc, name) ((name) \
&& (STREQ ("_sigreturn", name) \
|| STREQ ("_sigacthandler", name) \
|| STREQ ("sigvechandler", name)))
/* Saved Pc. Get it from ucontext if within sigtramp. */
#define sigtramp_saved_pc i386v4_sigtramp_saved_pc
extern CORE_ADDR i386v4_sigtramp_saved_pc (struct frame_info *);
#endif /* ifndef TM_I386V4_H */

View File

@ -1,93 +0,0 @@
/* Macro definitions for GDB on an Intel i386 running SVR4.2MP
Copyright 1991, 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
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 TM_I386V42MP_H
#define TM_I386V42MP_H 1
/* pick up more generic x86 sysv4 stuff */
#include "i386/tm-i386v4.h"
/* define to select for other sysv4.2mp weirdness (see procfs.c) */
#define UNIXWARE
#if 0
/* The following macros extract process and lwp/thread ids from a
composite id.
For consistency with UnixWare core files, allocate bits 0-15 for
process ids and bits 16 and up for lwp ids. Reserve bit 31 for
negative return values to indicate exceptions, and use bit 30 as a
flag to indicate a user-mode thread, leaving 14 bits for lwp
ids. */
/* Number of bits in composite id allocated to process number. */
#define PIDBITS 16
/* Return the process id stored in composite PID. */
#define PIDGET(PID) (((PID) & ((1 << PIDBITS) - 1)))
/* Return the thread or lwp id stored in composite PID. */
#define TIDGET(PID) (((PID) & 0x3fffffff) >> PIDBITS)
#define LIDGET(PID) TIDGET(PID)
/* Construct a composite id from lwp LID and the process portion of
composite PID. */
#define MERGEPID(PID, LID) (PIDGET(PID) | ((LID) << PIDBITS))
#define MKLID(PID, LID) MERGEPID(PID, LID)
/* Construct a composite id from thread TID and the process portion of
composite PID. */
#define MKTID(PID, TID) (MERGEPID(PID, TID) | 0x40000000)
/* Return whether PID contains a user-space thread id. */
#define ISTID(PID) ((PID) & 0x40000000)
#endif
/* New definitions of the ptid stuff. Due to the way the
code is structured in uw-thread.c, I'm overloading the thread id
and lwp id onto the lwp field. The tid field is used to indicate
whether the lwp is a tid or not.
FIXME: Check that core file support is not broken. (See original
#if 0'd comments above.)
FIXME: Restructure uw-thread.c so that the struct ptid fields
can be used as intended. */
/* Return the process id stored in composite PID. */
#define PIDGET(PID) (ptid_get_pid (PID))
/* Return the thread or lwp id stored in composite PID. */
#define TIDGET(PID) (ptid_get_lwp (PID))
#define LIDGET(PID) TIDGET(PID)
#define MERGEPID(PID, LID) (ptid_build ((PID), (LID), 0))
#define MKLID(PID, LID) (ptid_build ((PID), (LID), 0))
/* Construct a composite id from thread TID and the process portion of
composite PID. */
#define MKTID(PID, TID) (ptid_build ((PID), (TID), 1))
/* Return whether PID contains a user-space thread id. */
#define ISTID(PID) (ptid_get_tid (PID))
#endif /* ifndef TM_I386V42MP_H */

View File

@ -1,130 +0,0 @@
/* Definitions to target GDB to GNU/Linux on 386.
Copyright 1992, 1993, 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. */
#ifndef TM_LINUX_H
#define TM_LINUX_H
#define I386_GNULINUX_TARGET
#define HAVE_I387_REGS
#ifdef HAVE_PTRACE_GETFPXREGS
#define HAVE_SSE_REGS
#endif
#include "i386/tm-i386.h"
#include "tm-linux.h"
/* Register number for the "orig_eax" pseudo-register. If this
pseudo-register contains a value >= 0 it is interpreted as the
system call number that the kernel is supposed to restart. */
#define I386_LINUX_ORIG_EAX_REGNUM (NUM_GREGS + NUM_FREGS + NUM_SSE_REGS)
/* Adjust a few macros to deal with this extra register. */
#undef NUM_REGS
#define NUM_REGS (NUM_GREGS + NUM_FREGS + NUM_SSE_REGS + 1)
#undef MAX_NUM_REGS
#define MAX_NUM_REGS (16 + 16 + 9 + 1)
#undef REGISTER_BYTES
#define REGISTER_BYTES \
(SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS + 4)
#undef REGISTER_NAME
#define REGISTER_NAME(reg) i386_linux_register_name ((reg))
extern char *i386_linux_register_name (int reg);
#undef REGISTER_BYTE
#define REGISTER_BYTE(reg) i386_linux_register_byte ((reg))
extern int i386_linux_register_byte (int reg);
#undef REGISTER_RAW_SIZE
#define REGISTER_RAW_SIZE(reg) i386_linux_register_raw_size ((reg))
extern int i386_linux_register_raw_size (int reg);
/* GNU/Linux ELF uses stabs-in-ELF with the DWARF register numbering
scheme by default, so we must redefine STAB_REG_TO_REGNUM. This
messes up the floating-point registers for a.out, but there is not
much we can do about that. */
#undef STAB_REG_TO_REGNUM
#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
/* Use target_specific function to define link map offsets. */
extern struct link_map_offsets *i386_linux_svr4_fetch_link_map_offsets (void);
#define SVR4_FETCH_LINK_MAP_OFFSETS() i386_linux_svr4_fetch_link_map_offsets ()
/* The following works around a problem with /usr/include/sys/procfs.h */
#define sys_quotactl 1
/* When the i386 Linux kernel calls a signal handler, the return
address points to a bit of code on the stack. These definitions
are used to identify this bit of code as a signal trampoline in
order to support backtracing through calls to signal handlers. */
#define IN_SIGTRAMP(pc, name) i386_linux_in_sigtramp (pc, name)
extern int i386_linux_in_sigtramp (CORE_ADDR, char *);
#undef FRAME_CHAIN
#define FRAME_CHAIN(frame) i386_linux_frame_chain (frame)
extern CORE_ADDR i386_linux_frame_chain (struct frame_info *frame);
#undef FRAME_SAVED_PC
#define FRAME_SAVED_PC(frame) i386_linux_frame_saved_pc (frame)
extern CORE_ADDR i386_linux_frame_saved_pc (struct frame_info *frame);
#undef SAVED_PC_AFTER_CALL
#define SAVED_PC_AFTER_CALL(frame) i386_linux_saved_pc_after_call (frame)
extern CORE_ADDR i386_linux_saved_pc_after_call (struct frame_info *);
#define TARGET_WRITE_PC(pc, ptid) i386_linux_write_pc (pc, ptid)
extern void i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid);
/* When we call a function in a shared library, and the PLT sends us
into the dynamic linker to find the function's real address, we
need to skip over the dynamic linker call. This function decides
when to skip, and where to skip to. See the comments for
SKIP_SOLIB_RESOLVER at the top of infrun.c. */
#define SKIP_SOLIB_RESOLVER i386_linux_skip_solib_resolver
extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
/* N_FUN symbols in shared libaries have 0 for their values and need
to be relocated. */
#define SOFUN_ADDRESS_MAYBE_MISSING
/* Support for longjmp. */
/* Details about jmp_buf. It's supposed to be an array of integers. */
#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
#define JB_PC 5 /* Array index of saved PC. */
/* Figure out where the longjmp will land. Slurp the args out of the
stack. We expect the first arg to be a pointer to the jmp_buf
structure from which we extract the pc (JB_PC) that we will land
at. The pc is copied into ADDR. This routine returns true on
success. */
#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
extern int get_longjmp_target (CORE_ADDR *addr);
#endif /* #ifndef TM_LINUX_H */

View File

@ -1,28 +0,0 @@
/* Macro definitions for i386 running under NetBSD.
Copyright 2000 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 TM_NBSDELF_H
#define TM_NBSDELF_H
#include "i386/tm-nbsd.h"
#undef USE_STRUCT_CONVENTION
#endif /* TM_NBSD_H */

View File

@ -1,77 +0,0 @@
/* Target-dependent definitions for OpenBSD/i386.
Copyright 2001 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 TM_OBSD_H
#define TM_OBSD_H
#define HAVE_I387_REGS
#include "i386/tm-i386.h"
/* OpenBSD uses the old gcc convention for struct returns. */
#define USE_STRUCT_CONVENTION(gcc_p, type) \
generic_use_struct_convention (1, type)
/* Support for longjmp. */
/* Details about jmp_buf. It's supposed to be an array of integers. */
#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
#define JB_PC 0 /* Array index of saved PC. */
/* Figure out where the longjmp will land. Store the address that
longjmp will jump to in *ADDR, and return non-zero if successful. */
#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
extern int get_longjmp_target (CORE_ADDR *addr);
/* Support for signal handlers. */
#define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
/* These defines allow the recognition of sigtramps as a function name
<sigtramp>.
FIXME: kettenis/2001-07-13: These should be added to the target
vector and turned into functions when we go "multi-arch". */
#define SIGTRAMP_START(pc) i386bsd_sigtramp_start
#define SIGTRAMP_END(pc) i386bsd_sigtramp_end
extern CORE_ADDR i386bsd_sigtramp_start;
extern CORE_ADDR i386bsd_sigtramp_end;
/* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
#undef FRAME_SAVED_PC
#define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
/* Shared library support. */
/* Return non-zero if we are in a shared library trampoline code stub. */
#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
(name && !strcmp(name, "_DYNAMIC"))
#endif /* tm-obsd.h */

View File

@ -1,233 +0,0 @@
/* Target machine definitions for GDB on a Sequent Symmetry under ptx
with Weitek 1167 and i387 support.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 2000
Free Software Foundation, Inc.
Symmetry version by Jay Vosburgh (fubar@sequent.com).
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 TM_PTX_H
#define TM_PTX_H 1
/* I don't know if this will work for cross-debugging, even if you do get
a copy of the right include file. */
#include <sys/reg.h>
#ifdef SEQUENT_PTX4
#include "i386/tm-i386v4.h"
#else /* !SEQUENT_PTX4 */
#include "i386/tm-i386v.h"
#endif
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is 2
on most implementations. Here we have to undo what tm-i386v.h gave
us and restore the default. */
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
/* Amount PC must be decremented by after a breakpoint. This is often the
number of bytes in BREAKPOINT but not always (such as now). */
#undef DECR_PC_AFTER_BREAK
#define DECR_PC_AFTER_BREAK 0
#if 0
-- -this code can 't be used unless we know we are running native,
since it uses host specific ptrace calls.
/* code for 80387 fpu. Functions are from i386-dep.c, copied into
* symm-dep.c.
*/
#define FLOAT_INFO { i386_float_info(); }
#endif
/* Number of machine registers */
#undef NUM_REGS
#define NUM_REGS 49
/* Initializer for an array of names of registers. There should be at least
NUM_REGS strings in this initializer. Any excess ones are simply ignored.
The order of the first 8 registers must match the compiler's numbering
scheme (which is the same as the 386 scheme) and also regmap in the various
*-nat.c files. */
#undef REGISTER_NAME
#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
"esp", "ebp", "esi", "edi", \
"eip", "eflags", "st0", "st1", \
"st2", "st3", "st4", "st5", \
"st6", "st7", "fp1", "fp2", \
"fp3", "fp4", "fp5", "fp6", \
"fp7", "fp8", "fp9", "fp10", \
"fp11", "fp12", "fp13", "fp14", \
"fp15", "fp16", "fp17", "fp18", \
"fp19", "fp20", "fp21", "fp22", \
"fp23", "fp24", "fp25", "fp26", \
"fp27", "fp28", "fp29", "fp30", \
"fp31" }
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
and correspond to the general registers of the machine,
and some are "phony" register numbers which are too large
to be actual register numbers as far as the user is concerned
but do serve to get the desired values when passed to read_register. */
#define EAX_REGNUM 0
#define ECX_REGNUM 1
#define EDX_REGNUM 2
#define EBX_REGNUM 3
#define ESP_REGNUM 4
#define EBP_REGNUM 5
#define ESI_REGNUM 6
#define EDI_REGNUM 7
#define EIP_REGNUM 8
#define EFLAGS_REGNUM 9
#define ST0_REGNUM 10
#define ST1_REGNUM 11
#define ST2_REGNUM 12
#define ST3_REGNUM 13
#define ST4_REGNUM 14
#define ST5_REGNUM 15
#define ST6_REGNUM 16
#define ST7_REGNUM 17
#define FP1_REGNUM 18 /* first 1167 register */
/* Get %fp2 - %fp31 by addition, since they are contiguous */
#undef SP_REGNUM
#define SP_REGNUM ESP_REGNUM /* Contains address of top of stack */
#undef FP_REGNUM
#define FP_REGNUM EBP_REGNUM /* Contains address of executing stack frame */
#undef PC_REGNUM
#define PC_REGNUM EIP_REGNUM /* Contains program counter */
#undef PS_REGNUM
#define PS_REGNUM EFLAGS_REGNUM /* Contains processor status */
/*
* For ptx, this is a little bit bizarre, since the register block
* is below the u area in memory. This means that blockend here ends
* up being negative (for the call from coredep.c) since the value in
* u.u_ar0 will be less than KERNEL_U_ADDR (and coredep.c passes us
* u.u_ar0 - KERNEL_U_ADDR in blockend). Since we also define
* FETCH_INFERIOR_REGISTERS (and supply our own functions for that),
* the core file case will be the only use of this function.
*/
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ (addr) = ptx_register_u_addr((blockend), (regno)); }
extern int ptx_register_u_addr (int, int);
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. 10 i*86 registers, 8 i387
registers, and 31 Weitek 1167 registers */
#undef REGISTER_BYTES
#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
/* Index within `registers' of the first byte of the space for register N. */
#undef REGISTER_BYTE
#define REGISTER_BYTE(N) \
(((N) < ST0_REGNUM) ? ((N) * 4) : \
((N) < FP1_REGNUM) ? (40 + (((N) - ST0_REGNUM) * 10)) : \
(40 + 80 + (((N) - FP1_REGNUM) * 4)))
/* Number of bytes of storage in the actual machine representation for
register N. All registers are 4 bytes, except 387 st(0) - st(7),
which are 80 bits each. */
#undef REGISTER_RAW_SIZE
#define REGISTER_RAW_SIZE(N) \
(((N) < ST0_REGNUM) ? 4 : \
((N) < FP1_REGNUM) ? 10 : \
4)
/* Largest value REGISTER_RAW_SIZE can have. */
#undef MAX_REGISTER_RAW_SIZE
#define MAX_REGISTER_RAW_SIZE 10
/* Nonzero if register N requires conversion
from raw format to virtual format. */
#undef REGISTER_CONVERTIBLE
#define REGISTER_CONVERTIBLE(N) \
((N < ST0_REGNUM) ? 0 : \
(N < FP1_REGNUM) ? 1 : \
0)
/* Convert data from raw format for register REGNUM
to virtual format for register REGNUM. */
extern const struct floatformat floatformat_i387_ext; /* from floatformat.h */
#undef REGISTER_CONVERT_TO_VIRTUAL
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
((REGNUM < ST0_REGNUM) ? (void)memcpy ((TO), (FROM), 4) : \
(REGNUM < FP1_REGNUM) ? (void)floatformat_to_double(&floatformat_i387_ext, \
(FROM),(TO)) : \
(void)memcpy ((TO), (FROM), 4))
/* Convert data from virtual format for register REGNUM
to raw format for register REGNUM. */
#undef REGISTER_CONVERT_TO_RAW
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
((REGNUM < ST0_REGNUM) ? (void)memcpy ((TO), (FROM), 4) : \
(REGNUM < FP1_REGNUM) ? (void)floatformat_from_double(&floatformat_i387_ext, \
(FROM),(TO)) : \
(void)memcpy ((TO), (FROM), 4))
/* Return the GDB type object for the "standard" data type
of data in register N. */
/*
* Note: the 1167 registers (the last line, builtin_type_float) are
* generally used in pairs, with each pair being treated as a double.
* It it also possible to use them singly as floats. I'm not sure how
* in gdb to treat the register pair pseudo-doubles. -fubar
*/
#undef REGISTER_VIRTUAL_TYPE
#define REGISTER_VIRTUAL_TYPE(N) \
((N < ST0_REGNUM) ? builtin_type_int : \
(N < FP1_REGNUM) ? builtin_type_double : \
builtin_type_float)
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
#undef EXTRACT_RETURN_VALUE
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
/*
#undef FRAME_FIND_SAVED_REGS
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
{ ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }
*/
#endif /* ifndef TM_PTX_H */

View File

@ -1,26 +0,0 @@
/* Target machine definitions for GDB on a Sequent Symmetry under ptx
with Weitek 1167 and i387 support.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
Free Software Foundation, Inc.
Symmetry version by Jay Vosburgh (fubar@sequent.com).
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 SEQUENT_PTX4
#include "tm-ptx.h"

View File

@ -1,325 +0,0 @@
/* Target machine definitions for GDB on a Sequent Symmetry under dynix 3.0,
with Weitek 1167 and i387 support.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995
Free Software Foundation, Inc.
Symmetry version by Jay Vosburgh (fubar@sequent.com).
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 TM_SYMMETRY_H
#define TM_SYMMETRY_H 1
#include "regcache.h"
#include "doublest.h"
/* I don't know if this will work for cross-debugging, even if you do get
a copy of the right include file. */
#include <machine/reg.h>
#include "i386/tm-i386v.h"
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
/* Amount PC must be decremented by after a breakpoint. This is often the
number of bytes in BREAKPOINT but not always (such as now). */
#undef DECR_PC_AFTER_BREAK
#define DECR_PC_AFTER_BREAK 0
#if 0
/* --- this code can't be used unless we know we are running native,
since it uses host specific ptrace calls. */
/* code for 80387 fpu. Functions are from i386-dep.c, copied into
* symm-dep.c.
*/
#define FLOAT_INFO { i386_float_info(); }
#endif
/* Number of machine registers */
#undef NUM_REGS
#define NUM_REGS 49
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
/* Initializer for an array of names of registers. There should be at least
NUM_REGS strings in this initializer. Any excess ones are simply ignored.
Symmetry registers are in this weird order to match the register numbers
in the symbol table entries. If you change the order, things will probably
break mysteriously for no apparent reason. Also note that the st(0)...
st(7) 387 registers are represented as st0...st7. */
#undef REGISTER_NAME
#define REGISTER_NAMES { "eax", "edx", "ecx", "st0", "st1", \
"ebx", "esi", "edi", "st2", "st3", \
"st4", "st5", "st6", "st7", "esp", \
"ebp", "eip", "eflags","fp1", "fp2", \
"fp3", "fp4", "fp5", "fp6", "fp7", \
"fp8", "fp9", "fp10", "fp11", "fp12", \
"fp13", "fp14", "fp15", "fp16", "fp17", \
"fp18", "fp19", "fp20", "fp21", "fp22", \
"fp23", "fp24", "fp25", "fp26", "fp27", \
"fp28", "fp29", "fp30", "fp31" }
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
and correspond to the general registers of the machine,
and some are "phony" register numbers which are too large
to be actual register numbers as far as the user is concerned
but do serve to get the desired values when passed to read_register. */
#define EAX_REGNUM 0
#define EDX_REGNUM 1
#define ECX_REGNUM 2
#define ST0_REGNUM 3
#define ST1_REGNUM 4
#define EBX_REGNUM 5
#define ESI_REGNUM 6
#define EDI_REGNUM 7
#define ST2_REGNUM 8
#define ST3_REGNUM 9
#define ST4_REGNUM 10
#define ST5_REGNUM 11
#define ST6_REGNUM 12
#define ST7_REGNUM 13
#define FP1_REGNUM 18 /* first 1167 register */
/* Get %fp2 - %fp31 by addition, since they are contiguous */
#undef SP_REGNUM
#define SP_REGNUM 14 /* (usp) Contains address of top of stack */
#define ESP_REGNUM 14
#undef FP_REGNUM
#define FP_REGNUM 15 /* (ebp) Contains address of executing stack frame */
#define EBP_REGNUM 15
#undef PC_REGNUM
#define PC_REGNUM 16 /* (eip) Contains program counter */
#define EIP_REGNUM 16
#undef PS_REGNUM
#define PS_REGNUM 17 /* (ps) Contains processor status */
#define EFLAGS_REGNUM 17
/*
* Following macro translates i386 opcode register numbers to Symmetry
* register numbers. This is used by i386_frame_find_saved_regs.
*
* %eax %ecx %edx %ebx %esp %ebp %esi %edi
* i386 0 1 2 3 4 5 6 7
* Symmetry 0 2 1 5 14 15 6 7
*
*/
#define I386_REGNO_TO_SYMMETRY(n) \
((n)==0?0 :(n)==1?2 :(n)==2?1 :(n)==3?5 :(n)==4?14 :(n)==5?15 :(n))
/* The magic numbers below are offsets into u_ar0 in the user struct.
* They live in <machine/reg.h>. Gdb calls this macro with blockend
* holding u.u_ar0 - KERNEL_U_ADDR. Only the registers listed are
* saved in the u area (along with a few others that aren't useful
* here. See <machine/reg.h>).
*/
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ struct user foo; /* needed for finding fpu regs */ \
switch (regno) { \
case 0: \
addr = blockend + EAX * sizeof(int); break; \
case 1: \
addr = blockend + EDX * sizeof(int); break; \
case 2: \
addr = blockend + ECX * sizeof(int); break; \
case 3: /* st(0) */ \
addr = ((int)&foo.u_fpusave.fpu_stack[0][0] - (int)&foo); \
break; \
case 4: /* st(1) */ \
addr = ((int) &foo.u_fpusave.fpu_stack[1][0] - (int)&foo); \
break; \
case 5: \
addr = blockend + EBX * sizeof(int); break; \
case 6: \
addr = blockend + ESI * sizeof(int); break; \
case 7: \
addr = blockend + EDI * sizeof(int); break; \
case 8: /* st(2) */ \
addr = ((int) &foo.u_fpusave.fpu_stack[2][0] - (int)&foo); \
break; \
case 9: /* st(3) */ \
addr = ((int) &foo.u_fpusave.fpu_stack[3][0] - (int)&foo); \
break; \
case 10: /* st(4) */ \
addr = ((int) &foo.u_fpusave.fpu_stack[4][0] - (int)&foo); \
break; \
case 11: /* st(5) */ \
addr = ((int) &foo.u_fpusave.fpu_stack[5][0] - (int)&foo); \
break; \
case 12: /* st(6) */ \
addr = ((int) &foo.u_fpusave.fpu_stack[6][0] - (int)&foo); \
break; \
case 13: /* st(7) */ \
addr = ((int) &foo.u_fpusave.fpu_stack[7][0] - (int)&foo); \
break; \
case 14: \
addr = blockend + ESP * sizeof(int); break; \
case 15: \
addr = blockend + EBP * sizeof(int); break; \
case 16: \
addr = blockend + EIP * sizeof(int); break; \
case 17: \
addr = blockend + FLAGS * sizeof(int); break; \
case 18: /* fp1 */ \
case 19: /* fp2 */ \
case 20: /* fp3 */ \
case 21: /* fp4 */ \
case 22: /* fp5 */ \
case 23: /* fp6 */ \
case 24: /* fp7 */ \
case 25: /* fp8 */ \
case 26: /* fp9 */ \
case 27: /* fp10 */ \
case 28: /* fp11 */ \
case 29: /* fp12 */ \
case 30: /* fp13 */ \
case 31: /* fp14 */ \
case 32: /* fp15 */ \
case 33: /* fp16 */ \
case 34: /* fp17 */ \
case 35: /* fp18 */ \
case 36: /* fp19 */ \
case 37: /* fp20 */ \
case 38: /* fp21 */ \
case 39: /* fp22 */ \
case 40: /* fp23 */ \
case 41: /* fp24 */ \
case 42: /* fp25 */ \
case 43: /* fp26 */ \
case 44: /* fp27 */ \
case 45: /* fp28 */ \
case 46: /* fp29 */ \
case 47: /* fp30 */ \
case 48: /* fp31 */ \
addr = ((int) &foo.u_fpasave.fpa_regs[(regno)-18] - (int)&foo); \
} \
}
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. 10 i*86 registers, 8 i387
registers, and 31 Weitek 1167 registers */
#undef REGISTER_BYTES
#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
/* Index within `registers' of the first byte of the space for
register N. */
#undef REGISTER_BYTE
#define REGISTER_BYTE(N) \
(((N) < 3) ? ((N) * 4) : \
((N) < 5) ? ((((N) - 2) * 10) + 2) : \
((N) < 8) ? ((((N) - 5) * 4) + 32) : \
((N) < 14) ? ((((N) - 8) * 10) + 44) : \
((((N) - 14) * 4) + 104))
/* Number of bytes of storage in the actual machine representation
* for register N. All registers are 4 bytes, except 387 st(0) - st(7),
* which are 80 bits each.
*/
#undef REGISTER_RAW_SIZE
#define REGISTER_RAW_SIZE(N) \
(((N) < 3) ? 4 : \
((N) < 5) ? 10 : \
((N) < 8) ? 4 : \
((N) < 14) ? 10 : \
4)
/* Nonzero if register N requires conversion
from raw format to virtual format. */
#undef REGISTER_CONVERTIBLE
#define REGISTER_CONVERTIBLE(N) \
(((N) < 3) ? 0 : \
((N) < 5) ? 1 : \
((N) < 8) ? 0 : \
((N) < 14) ? 1 : \
0)
#include "floatformat.h"
/* Convert data from raw format for register REGNUM in buffer FROM
to virtual format with type TYPE in buffer TO. */
#undef REGISTER_CONVERT_TO_VIRTUAL
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
{ \
DOUBLEST val; \
floatformat_to_doublest (&floatformat_i387_ext, (FROM), &val); \
store_floating ((TO), TYPE_LENGTH (TYPE), val); \
}
/* Convert data from virtual format with type TYPE in buffer FROM
to raw format for register REGNUM in buffer TO. */
#undef REGISTER_CONVERT_TO_RAW
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
{ \
DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
floatformat_from_doublest (&floatformat_i387_ext, &val, (TO)); \
}
/* Return the GDB type object for the "standard" data type
of data in register N. */
#undef REGISTER_VIRTUAL_TYPE
#define REGISTER_VIRTUAL_TYPE(N) \
((N < 3) ? builtin_type_int : \
(N < 5) ? builtin_type_double : \
(N < 8) ? builtin_type_int : \
(N < 14) ? builtin_type_double : \
builtin_type_int)
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function.
Native cc passes the address in eax, gcc (up to version 2.5.8)
passes it on the stack. gcc should be fixed in future versions to
adopt native cc conventions. */
#undef PUSH_ARGUMENTS
#undef STORE_STRUCT_RETURN
#define STORE_STRUCT_RETURN(ADDR, SP) write_register(0, (ADDR))
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
#undef EXTRACT_RETURN_VALUE
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
/* The following redefines make backtracing through sigtramp work.
They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp
from the sigcontext structure which is pushed by the kernel on the
user stack, along with a pointer to it. */
#define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigcode", name))
/* Offset to saved PC in sigcontext, from <signal.h>. */
#define SIGCONTEXT_PC_OFFSET 16
#endif /* ifndef TM_SYMMETRY_H */

Some files were not shown because too many files have changed in this diff Show More