Initialize all registers (from John Kohl; PR#1651).
The REGISTER_U_ADDR is no longer needed.
This commit is contained in:
parent
c13a492707
commit
1f061d8392
|
@ -17,7 +17,7 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: i386b-nat.c,v 1.10 1995/08/06 20:38:46 mycroft Exp $
|
||||
$Id: i386b-nat.c,v 1.11 1995/11/22 00:25:50 pk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -31,9 +31,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||
#include "defs.h"
|
||||
#include "inferior.h"
|
||||
|
||||
int tregmap[] = {tEAX, tECX, tEDX, tEBX, tESP, tEBP, tESI, tEDI,
|
||||
tEIP, tEFLAGS, tCS, tSS, tDS, tES};
|
||||
|
||||
void
|
||||
fetch_inferior_registers (regno)
|
||||
int regno;
|
||||
|
@ -43,7 +40,7 @@ fetch_inferior_registers (regno)
|
|||
ptrace (PT_GETREGS, inferior_pid,
|
||||
(PTRACE_ARG3_TYPE) &inferior_registers, 0);
|
||||
|
||||
memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers, 4*14);
|
||||
memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers, 4*NUM_REGS);
|
||||
|
||||
registers_fetched ();
|
||||
}
|
||||
|
@ -54,7 +51,7 @@ store_inferior_registers (regno)
|
|||
{
|
||||
struct reg inferior_registers;
|
||||
|
||||
memcpy (&inferior_registers, ®isters[REGISTER_BYTE (0)], 4*14);
|
||||
memcpy (&inferior_registers, ®isters[REGISTER_BYTE (0)], 4*NUM_REGS);
|
||||
|
||||
ptrace (PT_SETREGS, inferior_pid,
|
||||
(PTRACE_ARG3_TYPE) &inferior_registers, 0);
|
||||
|
@ -349,20 +346,20 @@ fetch_kcore_registers(pcb)
|
|||
if (target_read_memory(pcb->pcb_tss.tss_esp+4, regs, sizeof regs, 0))
|
||||
error("Cannot read ebx, esi, and edi.");
|
||||
for (i = 0, regno = 0; regno < 3; regno++)
|
||||
supply_register(regno, &i);
|
||||
supply_register(3, ®s[2]);
|
||||
supply_register(4, &pcb->pcb_tss.tss_esp);
|
||||
supply_register(5, &pcb->pcb_tss.tss_ebp);
|
||||
supply_register(6, ®s[1]);
|
||||
supply_register(7, ®s[0]);
|
||||
supply_register(8, ®s[3]);
|
||||
supply_register(regno, (char *)&i);
|
||||
supply_register(3, (char *)®s[2]);
|
||||
supply_register(4, (char *)&pcb->pcb_tss.tss_esp);
|
||||
supply_register(5, (char *)&pcb->pcb_tss.tss_ebp);
|
||||
supply_register(6, (char *)®s[1]);
|
||||
supply_register(7, (char *)®s[0]);
|
||||
supply_register(8, (char *)®s[3]);
|
||||
for (i = 0, regno = 9; regno < 10; regno++)
|
||||
supply_register(regno, &i);
|
||||
supply_register(regno, (char *)&i);
|
||||
#if 0
|
||||
i = 0x08;
|
||||
supply_register(10, &i);
|
||||
supply_register(10, (char *)&i);
|
||||
i = 0x10;
|
||||
supply_register(11, &i);
|
||||
supply_register(11, (char *)&i);
|
||||
#endif
|
||||
/* XXX 80387 registers? */
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: nm.h,v 1.4 1995/01/26 22:39:17 mycroft Exp $
|
||||
$Id: nm.h,v 1.5 1995/11/22 00:25:52 pk Exp $
|
||||
*/
|
||||
|
||||
#ifndef NM_I386BSD_H
|
||||
|
@ -37,10 +37,4 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||
to get the offset in the core file of the register values. */
|
||||
#define KERNEL_U_ADDR USRSTACK
|
||||
|
||||
#define REGISTER_U_ADDR(addr, blockend, regno) \
|
||||
{ \
|
||||
extern int tregmap[]; \
|
||||
addr = blockend + 4 * tregmap[regno]; \
|
||||
}
|
||||
|
||||
#endif /* NM_I386BSD_H */
|
||||
|
|
Loading…
Reference in New Issue