|
GDBserver
|
#include "server.h"#include "gdb_wait.h"#include <stdio.h>#include <sys/ptrace.h>#include <fcntl.h>#include <string.h>#include <stdlib.h>#include <unistd.h>#include <errno.h>#include <sys/syscall.h>#include "filestuff.h"#include "hostio.h"Go to the source code of this file.
Defines | |
| #define | __WNOTHREAD |
| #define | PTRACE_TYPE_RET long |
| #define | PTRACE_TYPE_ARG3 long |
| #define | SPU_NUM_REGS 130 |
| #define | SPU_NUM_CORE_REGS 128 |
| #define | SPU_ID_REGNUM 128 |
| #define | SPU_PC_REGNUM 129 |
| #define | INSTR_SC 0x44000002 |
| #define | NR_spu_run 0x0116 |
Functions | |
| void | init_registers_spu (void) |
| static CORE_ADDR | fetch_ppc_register (int regno) |
| static int | fetch_ppc_memory_1 (int tid, CORE_ADDR memaddr, PTRACE_TYPE_RET *word) |
| static int | store_ppc_memory_1 (int tid, CORE_ADDR memaddr, PTRACE_TYPE_RET word) |
| static int | fetch_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len) |
| static int | store_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len) |
| static int | parse_spufs_run (int *fd, CORE_ADDR *addr) |
| static int | spu_proc_xfer_spu (const char *annex, unsigned char *readbuf, const unsigned char *writebuf, CORE_ADDR offset, int len) |
| static int | spu_create_inferior (char *program, char **allargs) |
| int | spu_attach (unsigned long pid) |
| static int | spu_kill (int pid) |
| static int | spu_detach (int pid) |
| static void | spu_mourn (struct process_info *process) |
| static void | spu_join (int pid) |
| static int | spu_thread_alive (ptid_t ptid) |
| static void | spu_resume (struct thread_resume *resume_info, size_t n) |
| static ptid_t | spu_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options) |
| static void | spu_fetch_registers (struct regcache *regcache, int regno) |
| static void | spu_store_registers (struct regcache *regcache, int regno) |
| static int | spu_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) |
| static int | spu_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) |
| static void | spu_look_up_symbols (void) |
| static void | spu_request_interrupt (void) |
| void | initialize_low (void) |
Variables | |
| int | using_threads = 0 |
| struct target_desc * | tdesc_spu |
| static struct target_ops | spu_target_ops |
| #define __WNOTHREAD |
0x20000000 /* Don't wait on children of other threads in this group */
Definition at line 37 of file spu-low.c.
Referenced by spu_wait().
| #define INSTR_SC 0x44000002 |
Definition at line 52 of file spu-low.c.
Referenced by parse_spufs_run().
| #define NR_spu_run 0x0116 |
Definition at line 53 of file spu-low.c.
Referenced by parse_spufs_run().
| #define PTRACE_TYPE_ARG3 long |
Definition at line 41 of file spu-low.c.
Referenced by arm_prepare_to_resume(), dequeue_one_deferred_signal(), enqueue_one_deferred_signal(), fetch_ppc_memory_1(), fetch_ppc_register(), handle_extended_wait(), linux_attach_lwp_1(), linux_check_ptrace_features(), linux_child_function(), linux_create_inferior(), linux_detach_one_lwp(), linux_enable_event_reporting(), linux_kill_one_lwp(), linux_ptrace_test_ret_to_nx(), linux_read_memory(), linux_resume_one_lwp(), linux_resume_one_thread(), linux_test_for_tracefork(), linux_test_for_tracesysgood(), linux_wait_1(), linux_write_memory(), linux_xfer_siginfo(), maybe_move_out_of_jump_pad(), spu_wait(), and store_ppc_memory_1().
| #define PTRACE_TYPE_RET long |
Definition at line 40 of file spu-low.c.
Referenced by fetch_ppc_memory(), fetch_ppc_register(), and store_ppc_memory().
| #define SPU_ID_REGNUM 128 |
Definition at line 48 of file spu-low.c.
Referenced by spu_fetch_registers().
| #define SPU_NUM_CORE_REGS 128 |
Definition at line 45 of file spu-low.c.
Referenced by spu_fetch_registers(), and spu_store_registers().
| #define SPU_NUM_REGS 130 |
| #define SPU_PC_REGNUM 129 |
Definition at line 49 of file spu-low.c.
Referenced by spu_fetch_registers(), and spu_store_registers().
| static int fetch_ppc_memory | ( | CORE_ADDR | memaddr, |
| char * | myaddr, | ||
| int | len | ||
| ) | [static] |
Definition at line 142 of file spu-low.c.
References current_ptid, fetch_ppc_memory_1(), memcpy(), ptid_get_lwp(), and PTRACE_TYPE_RET.
Referenced by parse_spufs_run(), and spu_fetch_registers().
| static int fetch_ppc_memory_1 | ( | int | tid, |
| CORE_ADDR | memaddr, | ||
| PTRACE_TYPE_RET * | word | ||
| ) | [static] |
Definition at line 104 of file spu-low.c.
References errno, and PTRACE_TYPE_ARG3.
Referenced by fetch_ppc_memory(), and store_ppc_memory().
| static CORE_ADDR fetch_ppc_register | ( | int | regno | ) | [static] |
Definition at line 64 of file spu-low.c.
References current_ptid, errno, perror_with_name(), ptid_get_lwp(), PTRACE_TYPE_ARG3, and PTRACE_TYPE_RET.
Referenced by parse_spufs_run().
| void init_registers_spu | ( | void | ) |
Referenced by initialize_low().
| void initialize_low | ( | void | ) |
Definition at line 672 of file spu-low.c.
References init_registers_spu(), set_breakpoint_data(), and set_target_ops().
| static int parse_spufs_run | ( | int * | fd, |
| CORE_ADDR * | addr | ||
| ) | [static] |
Definition at line 205 of file spu-low.c.
References fetch_ppc_memory(), fetch_ppc_register(), INSTR_SC, and NR_spu_run.
Referenced by spu_fetch_registers(), spu_read_memory(), spu_store_registers(), spu_wait(), and spu_write_memory().
| int spu_attach | ( | unsigned long | pid | ) |
Definition at line 303 of file spu-low.c.
References add_process(), add_thread(), errno, ptid_build(), strerror, and process_info::tdesc.
| static int spu_create_inferior | ( | char * | program, |
| char ** | allargs | ||
| ) | [static] |
Definition at line 266 of file spu-low.c.
References add_process(), add_thread(), close_most_fds(), errno, perror_with_name(), ptid_build(), strerror, and process_info::tdesc.
| static int spu_detach | ( | int | pid | ) | [static] |
Definition at line 347 of file spu-low.c.
References clear_inferiors(), find_process_pid(), and remove_process().
| static void spu_fetch_registers | ( | struct regcache * | regcache, |
| int | regno | ||
| ) | [static] |
Definition at line 482 of file spu-low.c.
References fetch_ppc_memory(), parse_spufs_run(), SPU_ID_REGNUM, SPU_NUM_CORE_REGS, SPU_PC_REGNUM, spu_proc_xfer_spu(), and supply_register().
| static void spu_join | ( | int | pid | ) | [static] |
| static int spu_kill | ( | int | pid | ) | [static] |
Definition at line 325 of file spu-low.c.
References clear_inferiors(), errno, find_process_pid(), and remove_process().
| static void spu_look_up_symbols | ( | void | ) | [static] |
| static void spu_mourn | ( | struct process_info * | process | ) | [static] |
Definition at line 361 of file spu-low.c.
References remove_process().
| static int spu_proc_xfer_spu | ( | const char * | annex, |
| unsigned char * | readbuf, | ||
| const unsigned char * | writebuf, | ||
| CORE_ADDR | offset, | ||
| int | len | ||
| ) | [static] |
Definition at line 230 of file spu-low.c.
References current_ptid, and ptid_get_lwp().
Referenced by spu_fetch_registers(), spu_read_memory(), spu_store_registers(), and spu_write_memory().
| static int spu_read_memory | ( | CORE_ADDR | memaddr, |
| unsigned char * | myaddr, | ||
| int | len | ||
| ) | [static] |
Definition at line 558 of file spu-low.c.
References memset(), parse_spufs_run(), and spu_proc_xfer_spu().
| static void spu_request_interrupt | ( | void | ) | [static] |
Definition at line 637 of file spu-low.c.
References current_ptid, and ptid_get_lwp().
| static void spu_resume | ( | struct thread_resume * | resume_info, |
| size_t | n | ||
| ) | [static] |
Definition at line 387 of file spu-low.c.
References current_ptid, errno, minus_one_ptid, perror_with_name(), ptid_equal(), ptid_get_lwp(), and regcache_invalidate().
| static void spu_store_registers | ( | struct regcache * | regcache, |
| int | regno | ||
| ) | [static] |
Definition at line 519 of file spu-low.c.
References collect_register(), parse_spufs_run(), SPU_NUM_CORE_REGS, SPU_PC_REGNUM, spu_proc_xfer_spu(), and store_ppc_memory().
| static int spu_thread_alive | ( | ptid_t | ptid | ) | [static] |
Definition at line 380 of file spu-low.c.
References current_ptid, and ptid_equal().
Definition at line 414 of file spu-low.c.
References __WNOTHREAD, clear_inferiors(), errno, gdb_signal_from_host(), parse_spufs_run(), perror_with_name(), pid_to_ptid(), ptid_build(), ptid_get_pid(), PTRACE_TYPE_ARG3, and server_waiting.
| static int spu_write_memory | ( | CORE_ADDR | memaddr, |
| const unsigned char * | myaddr, | ||
| int | len | ||
| ) | [static] |
Definition at line 596 of file spu-low.c.
References memset(), parse_spufs_run(), and spu_proc_xfer_spu().
| static int store_ppc_memory | ( | CORE_ADDR | memaddr, |
| char * | myaddr, | ||
| int | len | ||
| ) | [static] |
Definition at line 167 of file spu-low.c.
References current_ptid, fetch_ppc_memory_1(), memcpy(), ptid_get_lwp(), PTRACE_TYPE_RET, and store_ppc_memory_1().
Referenced by spu_store_registers().
| static int store_ppc_memory_1 | ( | int | tid, |
| CORE_ADDR | memaddr, | ||
| PTRACE_TYPE_RET | word | ||
| ) | [static] |
Definition at line 123 of file spu-low.c.
References errno, and PTRACE_TYPE_ARG3.
Referenced by store_ppc_memory().
struct target_ops spu_target_ops [static] |
{
spu_create_inferior,
spu_attach,
spu_kill,
spu_detach,
spu_mourn,
spu_join,
spu_thread_alive,
spu_resume,
spu_wait,
spu_fetch_registers,
spu_store_registers,
NULL,
NULL,
spu_read_memory,
spu_write_memory,
spu_look_up_symbols,
spu_request_interrupt,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
spu_proc_xfer_spu,
hostio_last_error_from_errno,
}
| struct target_desc* tdesc_spu |
| int using_threads = 0 |
1.7.6.1