1 /*
2 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
40 uintptr_t base;
41 struct symtab* symtab;
42 int fd; // file descriptor for lib
43 struct lib_info* next;
44 } lib_info;
45
46 // list of threads
47 typedef struct thread_info {
48 lwpid_t lwp_id;
49 pthread_t pthread_id; // not used cores, always -1
50 struct user_regs_struct regs; // not for process, core uses for caching regset
51 struct thread_info* next;
52 } thread_info;
53
54 // list of virtual memory maps
55 typedef struct map_info {
56 int fd; // file descriptor
57 off_t offset; // file offset of this mapping
58 uintptr_t vaddr; // starting virtual address
59 size_t memsz; // size of the mapping
60 struct map_info* next;
61 } map_info;
62
63 // vtable for ps_prochandle
64 typedef struct ps_prochandle_ops {
65 // "derived class" clean-up
66 void (*release)(struct ps_prochandle* ph);
67 // read from debuggee
68 bool (*p_pread)(struct ps_prochandle *ph,
69 uintptr_t addr, char *buf, size_t size);
70 // write into debuggee
71 bool (*p_pwrite)(struct ps_prochandle *ph,
72 uintptr_t addr, const char *buf , size_t size);
73 // get integer regset of a thread
74 bool (*get_lwp_regs)(struct ps_prochandle* ph, lwpid_t lwp_id, struct user_regs_struct* regs);
75 } ps_prochandle_ops;
76
77 // the ps_prochandle
78
79 struct core_data {
|
1 /*
2 * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
40 uintptr_t base;
41 struct symtab* symtab;
42 int fd; // file descriptor for lib
43 struct lib_info* next;
44 } lib_info;
45
46 // list of threads
47 typedef struct thread_info {
48 lwpid_t lwp_id;
49 pthread_t pthread_id; // not used cores, always -1
50 struct user_regs_struct regs; // not for process, core uses for caching regset
51 struct thread_info* next;
52 } thread_info;
53
54 // list of virtual memory maps
55 typedef struct map_info {
56 int fd; // file descriptor
57 off_t offset; // file offset of this mapping
58 uintptr_t vaddr; // starting virtual address
59 size_t memsz; // size of the mapping
60 uint32_t flags; // acces flags
61 struct map_info* next;
62 } map_info;
63
64 // vtable for ps_prochandle
65 typedef struct ps_prochandle_ops {
66 // "derived class" clean-up
67 void (*release)(struct ps_prochandle* ph);
68 // read from debuggee
69 bool (*p_pread)(struct ps_prochandle *ph,
70 uintptr_t addr, char *buf, size_t size);
71 // write into debuggee
72 bool (*p_pwrite)(struct ps_prochandle *ph,
73 uintptr_t addr, const char *buf , size_t size);
74 // get integer regset of a thread
75 bool (*get_lwp_regs)(struct ps_prochandle* ph, lwpid_t lwp_id, struct user_regs_struct* regs);
76 } ps_prochandle_ops;
77
78 // the ps_prochandle
79
80 struct core_data {
|