Lint fixes from Paul Eggert (eggert@twinsun.com):
[deliverable/binutils-gdb.git] / gdb / i386b-nat.c
CommitLineData
ede9d8a7
JG
1/* Native-dependent code for BSD Unix running on i386's, for GDB.
2 Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
6d685882
JG
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20#include "defs.h"
6d685882
JG
21#include <machine/reg.h>
22
6d685882
JG
23/* this table must line up with REGISTER_NAMES in tm-i386.h */
24/* symbols like 'tEAX' come from <machine/reg.h> */
25static int tregmap[] =
26{
27 tEAX, tECX, tEDX, tEBX,
28 tESP, tEBP, tESI, tEDI,
29 tEIP, tEFLAGS, tCS, tSS
30};
31static int sregmap[] =
32{
33 sEAX, sECX, sEDX, sEBX,
34 sESP, sEBP, sESI, sEDI,
35 sEIP, sEFLAGS, sCS, sSS
36};
37
38/* blockend is the value of u.u_ar0, and points to the
39 place where ES is stored. */
40
41int
42i386_register_u_addr (blockend, regnum)
43 int blockend;
44 int regnum;
45{
46 /* The following condition is a kludge to get at the proper register map
47 depending upon the state of pcb_flag.
48 The proper condition would be
49 if (u.u_pcb.pcb_flag & FM_TRAP)
50 but that would require a ptrace call here and wouldn't work
51 for corefiles. */
52
53 if (blockend < 0x1fcc)
54 return (blockend + 4 * tregmap[regnum]);
55 else
56 return (blockend + 4 * sregmap[regnum]);
57}
This page took 0.041931 seconds and 4 git commands to generate.