diff options
Diffstat (limited to 'gdb/gdbserver/target.h')
-rw-r--r-- | gdb/gdbserver/target.h | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index 1c47a3aedb3..770ffcbbb05 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -1,5 +1,5 @@ /* Target operations for the remote server for GDB. - Copyright 2002 + Copyright 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by MontaVista Software. @@ -24,6 +24,25 @@ #ifndef TARGET_H #define TARGET_H +/* This structure describes how to resume a particular thread (or + all threads) based on the client's request. If thread is -1, then + this entry applies to all threads. These are generally passed around + as an array, and terminated by a thread == -1 entry. */ + +struct thread_resume +{ + int thread; + + /* If non-zero, leave this thread stopped. */ + int leave_stopped; + + /* If non-zero, we want to single-step. */ + int step; + + /* If non-zero, send this signal when we resume. */ + int sig; +}; + struct target_ops { /* Start a new process. @@ -56,14 +75,9 @@ struct target_ops int (*thread_alive) (int pid); - /* Resume the inferior process. - - If STEP is non-zero, we want to single-step. - - If SIGNAL is nonzero, send the process that signal as we resume it. - */ + /* Resume the inferior process. */ - void (*resume) (int step, int signo); + void (*resume) (struct thread_resume *resume_info); /* Wait for the inferior process to change state. @@ -78,7 +92,7 @@ struct target_ops If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */ void (*fetch_registers) (int regno); - + /* Store registers to the inferior process. If REGNO is -1, store all registers; otherwise, store at least REGNO. */ @@ -88,9 +102,11 @@ struct target_ops /* Read memory from the inferior process. This should generally be called through read_inferior_memory, which handles breakpoint shadowing. - Read LEN bytes at MEMADDR into a buffer at MYADDR. */ + Read LEN bytes at MEMADDR into a buffer at MYADDR. + + Returns 0 on success and errno on failure. */ - void (*read_memory) (CORE_ADDR memaddr, char *myaddr, int len); + int (*read_memory) (CORE_ADDR memaddr, char *myaddr, int len); /* Write memory to the inferior process. This should generally be called through write_inferior_memory, which handles breakpoint shadowing. @@ -111,6 +127,12 @@ struct target_ops /* Send a signal to the inferior process, however is appropriate. */ void (*send_signal) (int); + + /* Read auxiliary vector data from the inferior process. + + Read LEN bytes at OFFSET into a buffer at MYADDR. */ + + int (*read_auxv) (CORE_ADDR offset, char *myaddr, unsigned int len); }; extern struct target_ops *the_target; @@ -132,9 +154,6 @@ void set_target_ops (struct target_ops *); #define mythread_alive(pid) \ (*the_target->thread_alive) (pid) -#define myresume(step,signo) \ - (*the_target->resume) (step, signo) - #define fetch_inferior_registers(regno) \ (*the_target->fetch_registers) (regno) @@ -143,7 +162,7 @@ void set_target_ops (struct target_ops *); unsigned char mywait (char *statusp, int connected_wait); -void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len); +int read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len); int write_inferior_memory (CORE_ADDR memaddr, const char *myaddr, int len); |