1 /* Target operations for the remote server for GDB.
3 Free Software Foundation, Inc.
5 Contributed by MontaVista Software.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
29 /* Start a new process.
31 PROGRAM is a path to the program to execute.
32 ARGS is a standard NULL-terminated array of arguments,
33 to be passed to the inferior as ``argv''.
35 Returns the new PID on success, -1 on failure. Registers the new
36 process with the process list. */
38 int (*create_inferior
) (char *program
, char **args
);
40 /* Attach to a running process.
42 PID is the process ID to attach to, specified by the user
45 int (*attach
) (int pid
);
47 /* Kill all inferiors. */
51 /* Detach from all inferiors. */
53 void (*detach
) (void);
55 /* Return 1 iff the thread with process ID PID is alive. */
57 int (*thread_alive
) (int pid
);
59 /* Resume the inferior process.
61 If STEP is non-zero, we want to single-step.
63 If SIGNAL is nonzero, send the process that signal as we resume it.
66 void (*resume
) (int step
, int signo
);
68 /* Wait for the inferior process to change state.
70 STATUSP will be filled in with a response code to send to GDB.
72 Returns the signal which caused the process to stop. */
74 unsigned char (*wait
) (char *status
);
76 /* Fetch registers from the inferior process.
78 If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */
80 void (*fetch_registers
) (int regno
);
82 /* Store registers to the inferior process.
84 If REGNO is -1, store all registers; otherwise, store at least REGNO. */
86 void (*store_registers
) (int regno
);
88 /* Read memory from the inferior process. This should generally be
89 called through read_inferior_memory, which handles breakpoint shadowing.
91 Read LEN bytes at MEMADDR into a buffer at MYADDR. */
93 void (*read_memory
) (CORE_ADDR memaddr
, char *myaddr
, int len
);
95 /* Write memory to the inferior process. This should generally be
96 called through write_inferior_memory, which handles breakpoint shadowing.
98 Write LEN bytes from the buffer at MYADDR to MEMADDR.
100 Returns 0 on success and errno on failure. */
102 int (*write_memory
) (CORE_ADDR memaddr
, const char *myaddr
, int len
);
104 /* Query GDB for the values of any symbols we're interested in.
105 This function is called whenever we receive a "qSymbols::"
106 query, which corresponds to every time more symbols (might)
107 become available. NULL if we aren't interested in any
110 void (*look_up_symbols
) (void);
112 /* Send a signal to the inferior process, however is appropriate. */
113 void (*send_signal
) (int);
116 extern struct target_ops
*the_target
;
118 void set_target_ops (struct target_ops
*);
120 #define create_inferior(program, args) \
121 (*the_target->create_inferior) (program, args)
123 #define myattach(pid) \
124 (*the_target->attach) (pid)
126 #define kill_inferior() \
127 (*the_target->kill) ()
129 #define detach_inferior() \
130 (*the_target->detach) ()
132 #define mythread_alive(pid) \
133 (*the_target->thread_alive) (pid)
135 #define myresume(step,signo) \
136 (*the_target->resume) (step, signo)
138 #define fetch_inferior_registers(regno) \
139 (*the_target->fetch_registers) (regno)
141 #define store_inferior_registers(regno) \
142 (*the_target->store_registers) (regno)
144 unsigned char mywait (char *statusp
, int connected_wait
);
146 void read_inferior_memory (CORE_ADDR memaddr
, char *myaddr
, int len
);
148 int write_inferior_memory (CORE_ADDR memaddr
, const char *myaddr
, int len
);
150 void set_desired_inferior (int id
);
152 #endif /* TARGET_H */
This page took 0.04311 seconds and 4 git commands to generate.