mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 18:39:34 +08:00
* go32-nat.c: Include i387-nat.h.
(fetch_register): New function, uses some of the guts of go32_fetch_registers and i387_supply_register. (go32_fetch_registers): Most of the code moved into fetch_register. Use i387_supply_fsave. (store_register): Use i387_fill_fsave instead of custom code. (go32_store_registers): Use i387_fill_fsave. * Makefile.in (go32-nat.o): Depend on i387-nat.h. * config/i386/go32.mh (NATDEPFILES): Add i387-nat.o.
This commit is contained in:
@ -1,5 +1,17 @@
|
|||||||
2001-02-18 Eli Zaretskii <eliz@is.elta.co.il>
|
2001-02-18 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* go32-nat.c: Include i387-nat.h.
|
||||||
|
(fetch_register): New function, uses some of the guts of
|
||||||
|
go32_fetch_registers and calls i387_supply_register.
|
||||||
|
(go32_fetch_registers): Most of the code moved into
|
||||||
|
fetch_register. Use i387_supply_fsave.
|
||||||
|
(store_register): Use i387_fill_fsave instead of custom code.
|
||||||
|
(go32_store_registers): Use i387_fill_fsave.
|
||||||
|
|
||||||
|
* Makefile.in (go32-nat.o): Depend on i387-nat.h.
|
||||||
|
|
||||||
|
* config/i386/go32.mh (NATDEPFILES): Add i387-nat.o.
|
||||||
|
|
||||||
* completer.c (gdb_completer_file_name_break_characters): Remove
|
* completer.c (gdb_completer_file_name_break_characters): Remove
|
||||||
slash from file-name break characters.
|
slash from file-name break characters.
|
||||||
[__MSDOS__]: Special definition for DOS/Windows file names.
|
[__MSDOS__]: Special definition for DOS/Windows file names.
|
||||||
|
@ -1450,7 +1450,7 @@ gdbtypes.o: gdbtypes.c $(bfd_h) complaints.h $(defs_h) $(expression_h) \
|
|||||||
$(value_h) gdb_string.h wrapper.h
|
$(value_h) gdb_string.h wrapper.h
|
||||||
|
|
||||||
go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) gdb_wait.h $(gdbcore_h) \
|
go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) gdb_wait.h $(gdbcore_h) \
|
||||||
$(command_h) $(floatformat_h) target.h
|
$(command_h) $(floatformat_h) target.h i387-nat.h
|
||||||
|
|
||||||
gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \
|
gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \
|
||||||
exc_request_U.h msg_U.h gnu-nat.h
|
exc_request_U.h msg_U.h gnu-nat.h
|
||||||
|
@ -8,7 +8,7 @@ XM_FILE= xm-go32.h
|
|||||||
XDEPFILES=
|
XDEPFILES=
|
||||||
|
|
||||||
NAT_FILE= nm-go32.h
|
NAT_FILE= nm-go32.h
|
||||||
NATDEPFILES= go32-nat.o
|
NATDEPFILES= go32-nat.o i387-nat.o
|
||||||
|
|
||||||
TERMCAP=
|
TERMCAP=
|
||||||
HOST_IPC=
|
HOST_IPC=
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "floatformat.h"
|
#include "floatformat.h"
|
||||||
#include "buildsym.h"
|
#include "buildsym.h"
|
||||||
|
#include "i387-nat.h"
|
||||||
|
|
||||||
#include <stdio.h> /* required for __DJGPP_MINOR__ */
|
#include <stdio.h> /* required for __DJGPP_MINOR__ */
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -449,56 +450,28 @@ go32_wait (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *status)
|
|||||||
return SOME_PID;
|
return SOME_PID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fetch_register (int regno)
|
||||||
|
{
|
||||||
|
if (regno < FP0_REGNUM)
|
||||||
|
supply_register (regno, (char *) &a_tss + regno_mapping[regno].tss_ofs);
|
||||||
|
else if (regno <= LAST_FPU_CTRL_REGNUM)
|
||||||
|
i387_supply_register (regno, (char *) &npx);
|
||||||
|
else
|
||||||
|
internal_error (__FILE__, __LINE__,
|
||||||
|
"Invalid register no. %d in fetch_register.", regno);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
go32_fetch_registers (int regno)
|
go32_fetch_registers (int regno)
|
||||||
{
|
{
|
||||||
/*JHW */
|
if (regno >= 0)
|
||||||
int end_reg = regno + 1; /* just one reg initially */
|
fetch_register (regno);
|
||||||
|
else
|
||||||
if (regno < 0) /* do the all registers */
|
|
||||||
{
|
{
|
||||||
regno = 0; /* start at first register */
|
for (regno = 0; regno < FP0_REGNUM; regno++)
|
||||||
/* # regs in table */
|
fetch_register (regno);
|
||||||
end_reg = sizeof (regno_mapping) / sizeof (regno_mapping[0]);
|
i387_supply_fsave ((char *) &npx);
|
||||||
}
|
|
||||||
|
|
||||||
for (; regno < end_reg; regno++)
|
|
||||||
{
|
|
||||||
if (regno < 16)
|
|
||||||
supply_register (regno,
|
|
||||||
(char *) &a_tss + regno_mapping[regno].tss_ofs);
|
|
||||||
else if (regno < 24)
|
|
||||||
supply_register (regno,
|
|
||||||
(char *) &npx.reg[regno_mapping[regno].tss_ofs]);
|
|
||||||
else if (regno < 32)
|
|
||||||
{
|
|
||||||
unsigned regval;
|
|
||||||
|
|
||||||
switch (regno_mapping[regno].size)
|
|
||||||
{
|
|
||||||
case 2:
|
|
||||||
regval = *(unsigned short *)
|
|
||||||
((char *) &npx + regno_mapping[regno].tss_ofs);
|
|
||||||
regval &= 0xffff;
|
|
||||||
if (regno == FOP_REGNUM && regval)
|
|
||||||
/* Feature: restore the 5 bits of the opcode
|
|
||||||
stripped by FSAVE/FNSAVE. */
|
|
||||||
regval |= 0xd800;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
regval = *(unsigned *)
|
|
||||||
((char *) &npx + regno_mapping[regno].tss_ofs);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
internal_error (__FILE__, __LINE__, "\
|
|
||||||
Invalid native size for register no. %d in go32_fetch_register.", regno);
|
|
||||||
}
|
|
||||||
supply_register (regno, (char *) ®val);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
internal_error (__FILE__, __LINE__,
|
|
||||||
"Invalid register no. %d in go32_fetch_register.",
|
|
||||||
regno);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,18 +481,14 @@ store_register (int regno)
|
|||||||
void *rp;
|
void *rp;
|
||||||
void *v = (void *) ®isters[REGISTER_BYTE (regno)];
|
void *v = (void *) ®isters[REGISTER_BYTE (regno)];
|
||||||
|
|
||||||
if (regno < 16)
|
if (regno < FP0_REGNUM)
|
||||||
rp = (char *) &a_tss + regno_mapping[regno].tss_ofs;
|
memcpy ((char *) &a_tss + regno_mapping[regno].tss_ofs,
|
||||||
else if (regno < 24)
|
v, regno_mapping[regno].size);
|
||||||
rp = (char *) &npx.reg[regno_mapping[regno].tss_ofs];
|
else if (regno <= LAST_FPU_CTRL_REGNUM)
|
||||||
else if (regno < 32)
|
i387_fill_fsave ((char *)&npx, regno);
|
||||||
rp = (char *) &npx + regno_mapping[regno].tss_ofs;
|
|
||||||
else
|
else
|
||||||
internal_error (__FILE__, __LINE__,
|
internal_error (__FILE__, __LINE__,
|
||||||
"Invalid register no. %d in store_register.", regno);
|
"Invalid register no. %d in store_register.", regno);
|
||||||
memcpy (rp, v, regno_mapping[regno].size);
|
|
||||||
if (regno == FOP_REGNUM)
|
|
||||||
*(short *)rp &= 0x07ff; /* strip high 5 bits, in case they added them */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -531,8 +500,9 @@ go32_store_registers (int regno)
|
|||||||
store_register (regno);
|
store_register (regno);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (r = 0; r < sizeof (regno_mapping) / sizeof (regno_mapping[0]); r++)
|
for (r = 0; r < FP0_REGNUM; r++)
|
||||||
store_register (r);
|
store_register (r);
|
||||||
|
i387_fill_fsave ((char *) &npx, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user