]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/i386/tm-i386os9k.h
Update FSF address.
[thirdparty/binutils-gdb.git] / gdb / config / i386 / tm-i386os9k.h
1 /* Macro definitions for i386 running under BSD Unix.
2 Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
3
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18
19 /* Override number of expected traps from sysv. */
20 #define START_INFERIOR_TRAPS_EXPECTED 2
21
22 /* Most definitions from sysv could be used. */
23 #include "i386/tm-i386v.h"
24
25 /* 386BSD cannot handle the segment registers. */
26 /* BSDI can't handle them either. */
27 #if 0
28 #undef NUM_REGS
29 #define NUM_REGS 10
30 #endif 0
31
32 #undef REGISTER_NAMES
33 #define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
34 "esp", "ebp", "esi", "edi", \
35 "eip", "eflags", "cs", "ss", \
36 "ds", "es", "fs", "gs", \
37 }
38
39 #define DATABASE_REG 3 /* ebx */
40 #undef DECR_PC_AFTER_BREAK
41 #define DECR_PC_AFTER_BREAK 0
42
43 /* On 386 bsd, sigtramp is above the user stack and immediately below
44 the user area. Using constants here allows for cross debugging.
45 These are tested for BSDI but should work on 386BSD. */
46 #define SIGTRAMP_START 0xfdbfdfc0
47 #define SIGTRAMP_END 0xfdbfe000
48
49 /* The following redefines make backtracing through sigtramp work.
50 They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp
51 from the sigcontext structure which is pushed by the kernel on the
52 user stack, along with a pointer to it. */
53
54 /* FRAME_CHAIN takes a frame's nominal address and produces the frame's
55 chain-pointer.
56 In the case of the i386, the frame's nominal address
57 is the address of a 4-byte word containing the calling frame's address. */
58 #undef FRAME_CHAIN
59 #define FRAME_CHAIN(thisframe) \
60 (thisframe->signal_handler_caller \
61 ? thisframe->frame \
62 : (!inside_entry_file ((thisframe)->pc) \
63 ? read_memory_integer ((thisframe)->frame, 4) \
64 : 0))
65
66 /* A macro that tells us whether the function invocation represented
67 by FI does not have a frame on the stack associated with it. If it
68 does not, FRAMELESS is set to 1, else 0. */
69 #undef FRAMELESS_FUNCTION_INVOCATION
70 #define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
71 do { \
72 if ((FI)->signal_handler_caller) \
73 (FRAMELESS) = 0; \
74 else \
75 (FRAMELESS) = frameless_look_for_prologue(FI); \
76 } while (0)
77
78 /* Saved Pc. Get it from sigcontext if within sigtramp. */
79
80 /* Offset to saved PC in sigcontext, from <sys/signal.h>. */
81 #define SIGCONTEXT_PC_OFFSET 20
82
83 #undef FRAME_SAVED_PC(FRAME)
84 #define FRAME_SAVED_PC(FRAME) \
85 (((FRAME)->signal_handler_caller \
86 ? sigtramp_saved_pc (FRAME) \
87 : read_memory_integer ((FRAME)->frame + 4, 4)) \
88 )
89
90 #define BELIEVE_PCC_PROMOTION 1