* m3-nat.c, config/nm-m3.h: Add a target_ops struct and other
[deliverable/binutils-gdb.git] / gdb / config / nm-m3.h
CommitLineData
c2d751d5
JK
1/* Mach 3.0 common definitions and global vars.
2
3 Copyright (C) 1992 Free Software Foundation, Inc.
4
5This file is part of GDB.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21#ifndef _OS_MACH3_H_
22#define _OS_MACH3_H
23
24#include <mach.h>
25
26/* Mach3 doesn't declare errno in <errno.h>. */
27extern int errno;
28
29/* Task port of our debugged inferior. */
30
31extern task_t inferior_task;
32
33/* Thread port of the current thread in the inferior. */
34
35extern thread_t current_thread;
36
37/* If nonzero, we must suspend/abort && resume threads
38 * when setting or getting the state.
39 */
40extern int must_suspend_thread;
41
c2d751d5
JK
42/* Startup the inferior task and suspend it after the correct code is loaded */
43
44#define STARTUP_INFERIOR(x) intercept_exec_calls(x)
45
46#define PREPARE_TO_PROCEED(select_it) mach3_prepare_to_proceed(select_it)
47
48/* Try to get the privileged host port for authentication to machid
49 *
50 * If you can get this, you may debug anything on this host.
51 *
52 * If you can't, gdb gives it's own task port as the
53 * authentication port
54 */
55#define mach_privileged_host_port() task_by_pid(-1)
56
57/*
58 * This is the MIG ID number of the emulator/server bsd_execve() RPC call.
59 *
60 * It SHOULD never change, but if it does, gdb `run'
61 * command won't work until you fix this define.
62 *
63 */
64#define MIG_EXEC_SYSCALL_ID 101000
65
66/* If our_message_port gets a msg with this ID,
67 * GDB suspends it's inferior and enters command level.
68 * (Useful at least if ^C does not work)
69 */
70#define GDB_MESSAGE_ID_STOP 0x41151
71
72/* wait3 WNOHANG is defined in <sys/wait.h> but
73 * for some reason gdb does not want to include
74 * that file.
75 *
76 * If your system defines WNOHANG differently, this has to be changed.
77 */
78#define WNOHANG 1
79
80/* Before storing, we need to read all the registers. */
81
82#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
83
84/* Check if the inferior exists */
85#define MACH_ERROR_NO_INFERIOR \
86 do if (!MACH_PORT_VALID (inferior_task)) \
87 error ("Inferior task does not exist."); while(0)
88
89/* Error handler for mach calls */
90#define CHK(str,ret) \
91 do if (ret != KERN_SUCCESS) \
92 error ("Gdb %s [%d] %s : %s\n",__FILE__,__LINE__,str, \
93 mach_error_string(ret)); while(0)
94
95/* This is from POE9 emulator/emul_stack.h
96 */
97/*
98 * Top of emulator stack holds link and reply port.
99 */
100struct emul_stack_top {
101 struct emul_stack_top *link;
102 mach_port_t reply_port;
103};
104
105#define EMULATOR_STACK_SIZE (4096*4)
106
107#define THREAD_ALLOWED_TO_BREAK(mid) mach_thread_for_breakpoint (mid)
108
109#define THREAD_PARSE_ID(arg) mach_thread_parse_id (arg)
110
111#define THREAD_OUTPUT_ID(mid) mach_thread_output_id (mid)
112
113#define ATTACH_TO_THREAD attach_to_thread
114
115/* Do Mach 3 dependent operations when ^C or a STOP is requested */
116#define DO_QUIT() mach3_quit ()
117
118/* If in mach_msg() and ^C is typed set immediate_quit */
119#define REQUEST_QUIT() mach3_request_quit ()
120
121#endif /* _OS_MACH3_H_ */
This page took 0.027088 seconds and 4 git commands to generate.