aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend.h62
-rw-r--r--breakpoint.h38
-rw-r--r--breakpoints.c49
-rw-r--r--debug.c2
-rw-r--r--debug.h2
-rw-r--r--fetch.c26
-rw-r--r--fetch.h16
-rw-r--r--forward.h2
-rw-r--r--handle_event.c62
-rw-r--r--libltrace.c6
-rw-r--r--library.c4
-rw-r--r--library.h11
-rw-r--r--ltrace-elf.c16
-rw-r--r--ltrace-elf.h12
-rw-r--r--ltrace.h2
-rw-r--r--output.c24
-rw-r--r--output.h6
-rw-r--r--proc.c156
-rw-r--r--proc.h77
-rw-r--r--sysdeps/linux-gnu/alpha/plt.c6
-rw-r--r--sysdeps/linux-gnu/alpha/regs.c15
-rw-r--r--sysdeps/linux-gnu/alpha/trace.c9
-rw-r--r--sysdeps/linux-gnu/arm/breakpoint.c2
-rw-r--r--sysdeps/linux-gnu/arm/plt.c3
-rw-r--r--sysdeps/linux-gnu/arm/regs.c15
-rw-r--r--sysdeps/linux-gnu/arm/trace.c9
-rw-r--r--sysdeps/linux-gnu/breakpoint.c4
-rw-r--r--sysdeps/linux-gnu/cris/plt.c2
-rw-r--r--sysdeps/linux-gnu/cris/regs.c8
-rw-r--r--sysdeps/linux-gnu/cris/trace.c6
-rw-r--r--sysdeps/linux-gnu/events.c6
-rw-r--r--sysdeps/linux-gnu/events.h2
-rw-r--r--sysdeps/linux-gnu/ia64/fetch.c24
-rw-r--r--sysdeps/linux-gnu/ia64/plt.c5
-rw-r--r--sysdeps/linux-gnu/ia64/regs.c15
-rw-r--r--sysdeps/linux-gnu/ia64/trace.c6
-rw-r--r--sysdeps/linux-gnu/m68k/fetch.c10
-rw-r--r--sysdeps/linux-gnu/m68k/plt.c3
-rw-r--r--sysdeps/linux-gnu/m68k/regs.c15
-rw-r--r--sysdeps/linux-gnu/m68k/trace.c6
-rw-r--r--sysdeps/linux-gnu/mipsel/plt.c17
-rw-r--r--sysdeps/linux-gnu/mipsel/regs.c15
-rw-r--r--sysdeps/linux-gnu/mipsel/trace.c13
-rw-r--r--sysdeps/linux-gnu/ppc/fetch.c22
-rw-r--r--sysdeps/linux-gnu/ppc/plt.c44
-rw-r--r--sysdeps/linux-gnu/ppc/regs.c21
-rw-r--r--sysdeps/linux-gnu/ppc/trace.c14
-rw-r--r--sysdeps/linux-gnu/proc.c46
-rw-r--r--sysdeps/linux-gnu/s390/fetch.c20
-rw-r--r--sysdeps/linux-gnu/s390/plt.c3
-rw-r--r--sysdeps/linux-gnu/s390/regs.c15
-rw-r--r--sysdeps/linux-gnu/s390/trace.c10
-rw-r--r--sysdeps/linux-gnu/sparc/plt.c3
-rw-r--r--sysdeps/linux-gnu/sparc/regs.c15
-rw-r--r--sysdeps/linux-gnu/sparc/trace.c9
-rw-r--r--sysdeps/linux-gnu/trace.c75
-rw-r--r--sysdeps/linux-gnu/trace.h4
-rw-r--r--sysdeps/linux-gnu/x86/fetch.c32
-rw-r--r--sysdeps/linux-gnu/x86/plt.c6
-rw-r--r--sysdeps/linux-gnu/x86/regs.c11
-rw-r--r--sysdeps/linux-gnu/x86/trace.c8
-rw-r--r--type.c16
-rw-r--r--type.h6
-rw-r--r--value.c4
-rw-r--r--value.h4
65 files changed, 623 insertions, 554 deletions
diff --git a/backend.h b/backend.h
index 89c05c3..57c2f03 100644
--- a/backend.h
+++ b/backend.h
@@ -70,7 +70,7 @@ int wait_for_proc(pid_t pid);
int task_kill(pid_t pid, int sig);
/* Called after PID is attached, but before it is continued. */
-void trace_set_options(struct Process *proc);
+void trace_set_options(struct process *proc);
/* Called after ltrace forks. Should attach the newly created child,
* in whose context this function is called. */
@@ -86,7 +86,7 @@ void untrace_pid(pid_t pid);
/* The back end may need to store arbitrary data to a process. This
* is a place where it can initialize PROC->arch_dep. XXX this should
* be dropped in favor of arhc_process_init on pmachata/libs. */
-void get_arch_dep(struct Process *proc);
+void get_arch_dep(struct process *proc);
/* Return current instruction pointer of PROC.
*
@@ -95,34 +95,34 @@ void get_arch_dep(struct Process *proc);
* that would otherwise support this. Above we have a definition of
* arch_addr_t. This should be converted to an integral type and
* used for target addresses throughout. */
-void *get_instruction_pointer(struct Process *proc);
+void *get_instruction_pointer(struct process *proc);
/* Set instruction pointer of PROC to ADDR. XXX see above. */
-void set_instruction_pointer(struct Process *proc, void *addr);
+void set_instruction_pointer(struct process *proc, void *addr);
/* Return current stack pointer of PROC. XXX see above. */
-void *get_stack_pointer(struct Process *proc);
+void *get_stack_pointer(struct process *proc);
/* Find and return caller address, i.e. the address where the current
* function returns. */
-void *get_return_addr(struct Process *proc, void *stack_pointer);
+void *get_return_addr(struct process *proc, void *stack_pointer);
/* Adjust PROC so that when the current function returns, it returns
* to ADDR. */
-void set_return_addr(struct Process *proc, void *addr);
+void set_return_addr(struct process *proc, void *addr);
/* Enable breakpoint SBP in process PROC. */
-void enable_breakpoint(struct Process *proc, struct breakpoint *sbp);
+void enable_breakpoint(struct process *proc, struct breakpoint *sbp);
/* Disable breakpoint SBP in process PROC. */
-void disable_breakpoint(struct Process *proc, struct breakpoint *sbp);
+void disable_breakpoint(struct process *proc, struct breakpoint *sbp);
/* Determine whether the event that we have just seen (and that is
* recorded in STATUS) was a syscall. If it was, return 1. If it was
* a return from syscall, return 2. In both cases, set *SYSNUM to the
* number of said syscall. If it wasn't a syscall, return 0. If
* there was an error, return -1. */
-int syscall_p(struct Process *proc, int status, int *sysnum);
+int syscall_p(struct process *proc, int status, int *sysnum);
/* Continue execution of the process with given PID. */
void continue_process(pid_t pid);
@@ -136,17 +136,17 @@ void continue_after_signal(pid_t pid, int signum);
* is system call, otherwise it's return from a system call. The
* callback should do whatever book-keeping is necessary and continue
* the process if necessary. */
-void continue_after_syscall(struct Process *proc, int sysnum, int ret_p);
+void continue_after_syscall(struct process *proc, int sysnum, int ret_p);
/* Called after we hit a breakpoint SBP. Should do whatever
* book-keeping is necessary and then continue the process. */
-void continue_after_breakpoint(struct Process *proc, struct breakpoint *sbp);
+void continue_after_breakpoint(struct process *proc, struct breakpoint *sbp);
/* Called after we received a vfork. Should do whatever book-keeping
* is necessary and continue the process if necessary. N.B. right
* now, with Linux/GNU the only back end, this is not necessary. I
* imagine other systems may be different. */
-void continue_after_vfork(struct Process *proc);
+void continue_after_vfork(struct process *proc);
/* Called when trace_me or primary trace_pid fail. This may plug in
* any platform-specific knowledge of why it could be so. */
@@ -171,14 +171,14 @@ void os_ltrace_exiting(void);
/* Should copy COUNT bytes from address ADDR of process PROC to local
* buffer BUF. */
-size_t umovebytes (struct Process *proc, void *addr, void *buf, size_t count);
+size_t umovebytes(struct process *proc, void *addr, void *buf, size_t count);
/* Find out an address of symbol SYM in process PROC, and return.
* Returning NULL delays breakpoint insertion and enables heaps of
* arch-specific black magic that we should clean up some day.
*
* XXX the same points as for get_instruction_pointer apply. */
-void *sym2addr(struct Process *proc, struct library_symbol *sym);
+void *sym2addr(struct process *proc, struct library_symbol *sym);
/* Obtain address of PLT entry corresponding to relocation RELA in
* file LTE. This is NDX-th PLT entry in the file.
@@ -189,7 +189,7 @@ GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela *rela);
/* Called at some point after we have attached to PROC. This callback
* should insert an introspection breakpoint for handling dynamic
* linker library loads. */
-int linkmap_init(struct Process *proc, arch_addr_t dyn_addr);
+int linkmap_init(struct process *proc, arch_addr_t dyn_addr);
/* This should produce and return the next event of one of the traced
* processes. The returned pointer will not be freed by the core and
@@ -198,14 +198,14 @@ int linkmap_init(struct Process *proc, arch_addr_t dyn_addr);
struct Event *next_event(void);
/* Called when process PROC was removed. */
-void process_removed(struct Process *proc);
+void process_removed(struct process *proc);
/* This should extract entry point address and interpreter (dynamic
* linker) bias if possible. Returns 0 if there were no errors, -1
* otherwise. Sets *ENTRYP and *INTERP_BIASP to non-zero values if
* the corresponding value is known, or zero otherwise; this is not
* done for pointers that are NULL. */
-int process_get_entry(struct Process *proc,
+int process_get_entry(struct process *proc,
arch_addr_t *entryp,
arch_addr_t *interp_biasp);
@@ -232,7 +232,7 @@ void arch_elf_destroy(struct ltelf *lte);
* destroy, and clone SBP->arch. arch_breakpoint_init and
* arch_breakpoint_clone return 0 on success or a negative value on
* failure. */
-int arch_breakpoint_init(struct Process *proc, struct breakpoint *sbp);
+int arch_breakpoint_init(struct process *proc, struct breakpoint *sbp);
void arch_breakpoint_destroy(struct breakpoint *sbp);
int arch_breakpoint_clone(struct breakpoint *retp, struct breakpoint *sbp);
@@ -259,19 +259,19 @@ int arch_library_symbol_clone(struct library_symbol *retp,
* PROC->arch in case that PROC underwent an exec. See notes at
* process_init, process_destroy, process_clone and process_exec in
* proc.h. */
-int arch_process_init(struct Process *proc);
-void arch_process_destroy(struct Process *proc);
-int arch_process_clone(struct Process *retp, struct Process *proc);
-int arch_process_exec(struct Process *proc);
+int arch_process_init(struct process *proc);
+void arch_process_destroy(struct process *proc);
+int arch_process_clone(struct process *retp, struct process *proc);
+int arch_process_exec(struct process *proc);
/* The following callbacks have to be implemented in OS backend if
* os.h defines OS_HAVE_PROCESS_DATA. The protocol is same as for,
* respectively, arch_process_init, arch_process_destroy,
* arch_process_clone and arch_process_exec. */
-int os_process_init(struct Process *proc);
-void os_process_destroy(struct Process *proc);
-int os_process_clone(struct Process *retp, struct Process *proc);
-int os_process_exec(struct Process *proc);
+int os_process_init(struct process *proc);
+void os_process_destroy(struct process *proc);
+int os_process_clone(struct process *retp, struct process *proc);
+int os_process_exec(struct process *proc);
/* The following callback has to be implemented in backend if arch.h
* defines ARCH_HAVE_GET_SYM_INFO.
@@ -306,18 +306,18 @@ enum plt_status {
* calling arch_plt_sym_val, and symbol is allocated. If plt_ok or
* plt_default are returned, the chain of symbols passed back in RET
* is added to library under construction. */
-enum plt_status arch_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
+enum plt_status arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
const char *name, GElf_Rela *rela,
size_t i, struct library_symbol **ret);
/* This callback needs to be implemented if arch.h defines
* ARCH_HAVE_DYNLINK_DONE. It is called after the dynamic linker is
* done with the process startup. */
-void arch_dynlink_done(struct Process *proc);
+void arch_dynlink_done(struct process *proc);
/* This callback needs to be implemented if arch.h defines
* ARCH_HAVE_SYMBOL_RET. It is called after a traced call returns. */
-void arch_symbol_ret(struct Process *proc, struct library_symbol *libsym);
+void arch_symbol_ret(struct process *proc, struct library_symbol *libsym);
/* This callback needs to be implemented if arch.h defines
@@ -327,7 +327,7 @@ void arch_symbol_ret(struct Process *proc, struct library_symbol *libsym);
* DYN_ADDR holds the address of the dynamic section.
* If the debug area is found, return 0 and fill in the address in *RET.
* If the debug area is not found, return a negative value. */
-int arch_find_dl_debug(struct Process *proc, arch_addr_t dyn_addr,
+int arch_find_dl_debug(struct process *proc, arch_addr_t dyn_addr,
arch_addr_t *ret);
/* If arch.h defines ARCH_HAVE_FETCH_ARG, the following callbacks have
diff --git a/breakpoint.h b/breakpoint.h
index 7cd914e..18af7a9 100644
--- a/breakpoint.h
+++ b/breakpoint.h
@@ -41,14 +41,12 @@
#include "sysdep.h"
#include "library.h"
-
-struct Process;
-struct breakpoint;
+#include "forward.h"
struct bp_callbacks {
- void (*on_hit)(struct breakpoint *bp, struct Process *proc);
- void (*on_continue)(struct breakpoint *bp, struct Process *proc);
- void (*on_retract)(struct breakpoint *bp, struct Process *proc);
+ void (*on_hit)(struct breakpoint *bp, struct process *proc);
+ void (*on_continue)(struct breakpoint *bp, struct process *proc);
+ void (*on_retract)(struct breakpoint *bp, struct process *proc);
};
struct breakpoint {
@@ -61,11 +59,11 @@ struct breakpoint {
};
/* Call on-hit handler of BP, if any is set. */
-void breakpoint_on_hit(struct breakpoint *bp, struct Process *proc);
+void breakpoint_on_hit(struct breakpoint *bp, struct process *proc);
/* Call on-continue handler of BP. If none is set, call
* continue_after_breakpoint. */
-void breakpoint_on_continue(struct breakpoint *bp, struct Process *proc);
+void breakpoint_on_continue(struct breakpoint *bp, struct process *proc);
/* Call on-retract handler of BP, if any is set. This should be
* called before the breakpoints are destroyed. The reason for a
@@ -74,21 +72,21 @@ void breakpoint_on_continue(struct breakpoint *bp, struct Process *proc);
* be called every time we disable the breakpoint, which is too often
* (a breakpoint has to be disabled every time that we need to execute
* the instruction underneath it). */
-void breakpoint_on_retract(struct breakpoint *bp, struct Process *proc);
+void breakpoint_on_retract(struct breakpoint *bp, struct process *proc);
/* Initialize a breakpoint structure. That doesn't actually realize
* the breakpoint. The breakpoint is initially assumed to be
* disabled. orig_value has to be set separately. CBS may be
* NULL. */
-int breakpoint_init(struct breakpoint *bp, struct Process *proc,
+int breakpoint_init(struct breakpoint *bp, struct process *proc,
arch_addr_t addr, struct library_symbol *libsym);
/* Make a clone of breakpoint BP into the area of memory pointed to by
* RETP. The original breakpoint was assigned to process OLD_PROC,
* the cloned breakpoint will be attached to process NEW_PROC.
* Returns 0 on success or a negative value on failure. */
-int breakpoint_clone(struct breakpoint *retp, struct Process *new_proc,
- struct breakpoint *bp, struct Process *old_proc);
+int breakpoint_clone(struct breakpoint *retp, struct process *new_proc,
+ struct breakpoint *bp, struct process *old_proc);
/* Set callbacks. If CBS is non-NULL, then BP->cbs shall be NULL. */
void breakpoint_set_callbacks(struct breakpoint *bp, struct bp_callbacks *cbs);
@@ -98,12 +96,12 @@ void breakpoint_destroy(struct breakpoint *bp);
/* Call enable_breakpoint the first time it's called. Returns 0 on
* success and a negative value on failure. */
-int breakpoint_turn_on(struct breakpoint *bp, struct Process *proc);
+int breakpoint_turn_on(struct breakpoint *bp, struct process *proc);
/* Call disable_breakpoint when turned off the same number of times
* that it was turned on. Returns 0 on success and a negative value
* on failure. */
-int breakpoint_turn_off(struct breakpoint *bp, struct Process *proc);
+int breakpoint_turn_off(struct breakpoint *bp, struct process *proc);
/* Utility function that does what typically needs to be done when a
* breakpoint is to be inserted. It checks whether there is another
@@ -113,7 +111,7 @@ int breakpoint_turn_off(struct breakpoint *bp, struct Process *proc);
* added as well as preexisting breakpoints, it then calls
* BREAKPOINT_TURN_ON. If anything fails, it cleans up and returns
* NULL. Otherwise it returns the breakpoint for ADDR. */
-struct breakpoint *insert_breakpoint(struct Process *proc, void *addr,
+struct breakpoint *insert_breakpoint(struct process *proc, void *addr,
struct library_symbol *libsym);
/* Name of a symbol associated with BP. May be NULL. */
@@ -127,12 +125,12 @@ struct library *breakpoint_library(const struct breakpoint *bp);
* - proc_remove_breakpoint
* - breakpoint_destroy
* XXX */
-void delete_breakpoint(struct Process *proc, void *addr);
+void delete_breakpoint(struct process *proc, void *addr);
/* XXX some of the following belongs to proc.h/proc.c. */
-struct breakpoint *address2bpstruct(struct Process *proc, void *addr);
-void enable_all_breakpoints(struct Process *proc);
-void disable_all_breakpoints(struct Process *proc);
-int breakpoints_init(struct Process *proc);
+struct breakpoint *address2bpstruct(struct process *proc, void *addr);
+void enable_all_breakpoints(struct process *proc);
+void disable_all_breakpoints(struct process *proc);
+int breakpoints_init(struct process *proc);
#endif /* BREAKPOINT_H */
diff --git a/breakpoints.c b/breakpoints.c
index 258be93..8db4e26 100644
--- a/breakpoints.c
+++ b/breakpoints.c
@@ -42,7 +42,7 @@
#ifndef ARCH_HAVE_TRANSLATE_ADDRESS
int
-arch_translate_address_dyn(struct Process *proc,
+arch_translate_address_dyn(struct process *proc,
arch_addr_t addr, arch_addr_t *ret)
{
*ret = addr;
@@ -60,7 +60,7 @@ arch_translate_address(struct ltelf *lte,
#endif
void
-breakpoint_on_hit(struct breakpoint *bp, struct Process *proc)
+breakpoint_on_hit(struct breakpoint *bp, struct process *proc)
{
assert(bp != NULL);
if (bp->cbs != NULL && bp->cbs->on_hit != NULL)
@@ -68,7 +68,7 @@ breakpoint_on_hit(struct breakpoint *bp, struct Process *proc)
}
void
-breakpoint_on_continue(struct breakpoint *bp, struct Process *proc)
+breakpoint_on_continue(struct breakpoint *bp, struct process *proc)
{
assert(bp != NULL);
if (bp->cbs != NULL && bp->cbs->on_continue != NULL)
@@ -78,7 +78,7 @@ breakpoint_on_continue(struct breakpoint *bp, struct Process *proc)
}
void
-breakpoint_on_retract(struct breakpoint *bp, struct Process *proc)
+breakpoint_on_retract(struct breakpoint *bp, struct process *proc)
{
assert(bp != NULL);
if (bp->cbs != NULL && bp->cbs->on_retract != NULL)
@@ -88,7 +88,7 @@ breakpoint_on_retract(struct breakpoint *bp, struct Process *proc)
/*****************************************************************************/
struct breakpoint *
-address2bpstruct(Process *proc, void *addr)
+address2bpstruct(struct process *proc, void *addr)
{
assert(proc != NULL);
assert(proc->breakpoints != NULL);
@@ -99,7 +99,7 @@ address2bpstruct(Process *proc, void *addr)
#ifndef ARCH_HAVE_BREAKPOINT_DATA
int
-arch_breakpoint_init(struct Process *proc, struct breakpoint *sbp)
+arch_breakpoint_init(struct process *proc, struct breakpoint *sbp)
{
return 0;
}
@@ -117,7 +117,7 @@ arch_breakpoint_clone(struct breakpoint *retp, struct breakpoint *sbp)
#endif
static void
-breakpoint_init_base(struct breakpoint *bp, struct Process *proc,
+breakpoint_init_base(struct breakpoint *bp, struct process *proc,
arch_addr_t addr, struct library_symbol *libsym)
{
bp->cbs = NULL;
@@ -132,7 +132,7 @@ breakpoint_init_base(struct breakpoint *bp, struct Process *proc,
* static lookups of various sections in the ELF file. We shouldn't
* need process for anything. */
int
-breakpoint_init(struct breakpoint *bp, struct Process *proc,
+breakpoint_init(struct breakpoint *bp, struct process *proc,
arch_addr_t addr, struct library_symbol *libsym)
{
breakpoint_init_base(bp, proc, addr, libsym);
@@ -156,8 +156,8 @@ breakpoint_destroy(struct breakpoint *bp)
}
int
-breakpoint_clone(struct breakpoint *retp, struct Process *new_proc,
- struct breakpoint *bp, struct Process *old_proc)
+breakpoint_clone(struct breakpoint *retp, struct process *new_proc,
+ struct breakpoint *bp, struct process *old_proc)
{
struct library_symbol *libsym = NULL;
if (bp->libsym != NULL) {
@@ -175,7 +175,7 @@ breakpoint_clone(struct breakpoint *retp, struct Process *new_proc,
}
int
-breakpoint_turn_on(struct breakpoint *bp, struct Process *proc)
+breakpoint_turn_on(struct breakpoint *bp, struct process *proc)
{
bp->enabled++;
if (bp->enabled == 1) {
@@ -186,7 +186,7 @@ breakpoint_turn_on(struct breakpoint *bp, struct Process *proc)
}
int
-breakpoint_turn_off(struct breakpoint *bp, struct Process *proc)
+breakpoint_turn_off(struct breakpoint *bp, struct process *proc)
{
bp->enabled--;
if (bp->enabled == 0)
@@ -196,10 +196,10 @@ breakpoint_turn_off(struct breakpoint *bp, struct Process *proc)
}
struct breakpoint *
-insert_breakpoint(struct Process *proc, void *addr,
+insert_breakpoint(struct process *proc, void *addr,
struct library_symbol *libsym)
{
- Process *leader = proc->leader;
+ struct process *leader = proc->leader;
/* Only the group leader should be getting the breakpoints and
* thus have ->breakpoint initialized. */
@@ -243,11 +243,11 @@ insert_breakpoint(struct Process *proc, void *addr,
}
void
-delete_breakpoint(Process *proc, void *addr)
+delete_breakpoint(struct process *proc, void *addr)
{
debug(DEBUG_FUNCTION, "delete_breakpoint(pid=%d, addr=%p)", proc->pid, addr);
- Process * leader = proc->leader;
+ struct process *leader = proc->leader;
assert(leader != NULL);
struct breakpoint *sbp = dict_find_entry(leader->breakpoints, addr);
@@ -285,13 +285,14 @@ breakpoint_library(const struct breakpoint *bp)
static void
enable_bp_cb(void *addr, void *sbp, void *proc)
{
- debug(DEBUG_FUNCTION, "enable_bp_cb(pid=%d)", ((Process *)proc)->pid);
+ debug(DEBUG_FUNCTION, "enable_bp_cb(pid=%d)",
+ ((struct process *)proc)->pid);
if (((struct breakpoint *)sbp)->enabled)
enable_breakpoint(proc, sbp);
}
void
-enable_all_breakpoints(Process *proc)
+enable_all_breakpoints(struct process *proc)
{
debug(DEBUG_FUNCTION, "enable_all_breakpoints(pid=%d)", proc->pid);
@@ -305,13 +306,15 @@ enable_all_breakpoints(Process *proc)
static void
disable_bp_cb(void *addr, void *sbp, void *proc)
{
- debug(DEBUG_FUNCTION, "disable_bp_cb(pid=%d)", ((Process *)proc)->pid);
+ debug(DEBUG_FUNCTION, "disable_bp_cb(pid=%d)",
+ ((struct process *)proc)->pid);
if (((struct breakpoint *)sbp)->enabled)
disable_breakpoint(proc, sbp);
}
void
-disable_all_breakpoints(Process *proc) {
+disable_all_breakpoints(struct process *proc)
+{
debug(DEBUG_FUNCTION, "disable_all_breakpoints(pid=%d)", proc->pid);
assert(proc->leader == proc);
dict_apply_to_all(proc->breakpoints, disable_bp_cb, proc);
@@ -330,7 +333,7 @@ struct entry_breakpoint {
};
static void
-entry_breakpoint_on_hit(struct breakpoint *a, struct Process *proc)
+entry_breakpoint_on_hit(struct breakpoint *a, struct process *proc)
{
struct entry_breakpoint *bp = (void *)a;
if (proc == NULL || proc->leader == NULL)
@@ -342,7 +345,7 @@ entry_breakpoint_on_hit(struct breakpoint *a, struct Process *proc)
}
int
-entry_breakpoint_init(struct Process *proc,
+entry_breakpoint_init(struct process *proc,
struct entry_breakpoint *bp, arch_addr_t addr,
struct library *lib)
{
@@ -360,7 +363,7 @@ entry_breakpoint_init(struct Process *proc,
}
int
-breakpoints_init(Process *proc)
+breakpoints_init(struct process *proc)
{
debug(DEBUG_FUNCTION, "breakpoints_init(pid=%d)", proc->pid);
diff --git a/debug.c b/debug.c
index bcaa404..ce220fe 100644
--- a/debug.c
+++ b/debug.c
@@ -57,7 +57,7 @@ xwritedump(long *ptr, arch_addr_t addr, size_t count)
}
int
-xinfdump(struct Process *proc, arch_addr_t addr, size_t length)
+xinfdump(struct process *proc, arch_addr_t addr, size_t length)
{
unsigned char buf[length];
size_t got = umovebytes(proc, addr, buf, length);
diff --git a/debug.h b/debug.h
index 8ae1804..542dda5 100644
--- a/debug.h
+++ b/debug.h
@@ -38,7 +38,7 @@ void debug_(int level, const char *file, int line,
/* Dump LENGTH bytes of memory starting on address ADDR of inferior
* PID. */
-int xinfdump(struct Process *proc, arch_addr_t addr, size_t length);
+int xinfdump(struct process *proc, arch_addr_t addr, size_t length);
#define debug(level, expr...) debug_(level, __FILE__, __LINE__, expr)
diff --git a/fetch.c b/fetch.c
index 88966a5..cbceefb 100644
--- a/fetch.c
+++ b/fetch.c
@@ -27,18 +27,18 @@
#include "type.h"
#ifdef ARCH_HAVE_FETCH_ARG
-struct fetch_context *arch_fetch_arg_init(enum tof type, struct Process *proc,
+struct fetch_context *arch_fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info);
-struct fetch_context *arch_fetch_arg_clone(struct Process *proc,
+struct fetch_context *arch_fetch_arg_clone(struct process *proc,
struct fetch_context *context);
int arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep);
int arch_fetch_retval(struct fetch_context *ctx, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep);
void arch_fetch_arg_done(struct fetch_context *context);
@@ -53,7 +53,7 @@ void arch_fetch_param_pack_end(struct fetch_context *context);
#else
/* Fall back to gimme_arg. */
-long gimme_arg(enum tof type, struct Process *proc, int arg_num,
+long gimme_arg(enum tof type, struct process *proc, int arg_num,
struct arg_type_info *info);
struct fetch_context {
@@ -61,14 +61,14 @@ struct fetch_context {
};
struct fetch_context *
-arch_fetch_arg_init(enum tof type, struct Process *proc,
+arch_fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info)
{
return calloc(sizeof(struct fetch_context), 1);
}
struct fetch_context *
-arch_fetch_arg_clone(struct Process *proc, struct fetch_context *context)
+arch_fetch_arg_clone(struct process *proc, struct fetch_context *context)
{
struct fetch_context *ret = malloc(sizeof(*ret));
if (ret == NULL)
@@ -78,7 +78,7 @@ arch_fetch_arg_clone(struct Process *proc, struct fetch_context *context)
int
arch_fetch_arg_next(struct fetch_context *context, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
long l = gimme_arg(type, proc, context->argnum++, info);
@@ -88,7 +88,7 @@ arch_fetch_arg_next(struct fetch_context *context, enum tof type,
int
arch_fetch_retval(struct fetch_context *context, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
long l = gimme_arg(type, proc, -1, info);
@@ -118,21 +118,21 @@ arch_fetch_param_pack_end(struct fetch_context *context)
#endif
struct fetch_context *
-fetch_arg_init(enum tof type, struct Process *proc,
+fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info)
{
return arch_fetch_arg_init(type, proc, ret_info);
}
struct fetch_context *
-fetch_arg_clone(struct Process *proc, struct fetch_context *context)
+fetch_arg_clone(struct process *proc, struct fetch_context *context)
{
return arch_fetch_arg_clone(proc, context);
}
int
fetch_arg_next(struct fetch_context *context, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
return arch_fetch_arg_next(context, type, proc, info, valuep);
@@ -140,7 +140,7 @@ fetch_arg_next(struct fetch_context *context, enum tof type,
int
fetch_retval(struct fetch_context *context, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
return arch_fetch_retval(context, type, proc, info, valuep);
diff --git a/fetch.h b/fetch.h
index 2a13214..3a1644a 100644
--- a/fetch.h
+++ b/fetch.h
@@ -38,24 +38,24 @@ struct fetch_context;
/* Initialize argument fetching. Returns NULL on failure. RET_INFO
* is the return type of the function. */
-struct fetch_context *fetch_arg_init(enum tof type, struct Process *proc,
+struct fetch_context *fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info);
/* Make a clone of context. */
-struct fetch_context *fetch_arg_clone(struct Process *proc,
+struct fetch_context *fetch_arg_clone(struct process *proc,
struct fetch_context *context);
/* Load next argument. The function returns 0 on success or a
* negative value on failure. The extracted value is stored in
* *VALUEP. */
int fetch_arg_next(struct fetch_context *context, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep);
/* Load return value. The function returns 0 on success or a negative
* value on failure. The extracted value is stored in *VALUEP. */
int fetch_retval(struct fetch_context *context, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep);
/* Destroy fetch context. CONTEXT shall be the same memory location
@@ -74,15 +74,15 @@ void fetch_param_pack_end(struct fetch_context *context);
/* The following callbacks have to be implemented in backend if arch.h
* defines ARCH_HAVE_FETCH_ARG. These backend callbacks correspond to
* above functions. */
-struct fetch_context *arch_fetch_arg_init(enum tof type, struct Process *proc,
+struct fetch_context *arch_fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info);
-struct fetch_context *arch_fetch_arg_clone(struct Process *proc,
+struct fetch_context *arch_fetch_arg_clone(struct process *proc,
struct fetch_context *context);
int arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep);
int arch_fetch_retval(struct fetch_context *ctx, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep);
void arch_fetch_arg_done(struct fetch_context *context);
diff --git a/forward.h b/forward.h
index 85a0630..d334339 100644
--- a/forward.h
+++ b/forward.h
@@ -21,7 +21,7 @@
/* Important types defined in other header files are declared
here. */
struct Event;
-struct Process;
+struct process;
struct arg_type_info;
struct breakpoint;
struct expr_node;
diff --git a/handle_event.c b/handle_event.c
index c711b14..dd1eaaa 100644
--- a/handle_event.c
+++ b/handle_event.c
@@ -54,20 +54,20 @@ static void handle_exec(Event *event);
static void handle_breakpoint(Event *event);
static void handle_new(Event *event);
-static void callstack_push_syscall(Process *proc, int sysnum);
-static void callstack_push_symfunc(Process *proc,
+static void callstack_push_syscall(struct process *proc, int sysnum);
+static void callstack_push_symfunc(struct process *proc,
struct library_symbol *sym);
/* XXX Stack maintenance should be moved to a dedicated module, or to
* proc.c, and push/pop should be visible outside this module. For
* now, because we need this in proc.c, this is non-static. */
-void callstack_pop(struct Process *proc);
+void callstack_pop(struct process *proc);
-static char * shortsignal(Process *proc, int signum);
-static char * sysname(Process *proc, int sysnum);
-static char * arch_sysname(Process *proc, int sysnum);
+static char *shortsignal(struct process *proc, int signum);
+static char *sysname(struct process *proc, int sysnum);
+static char *arch_sysname(struct process *proc, int sysnum);
static Event *
-call_handler(Process * proc, Event * event)
+call_handler(struct process *proc, Event *event)
{
assert(proc != NULL);
@@ -256,7 +256,7 @@ handle_clone(Event *event)
{
debug(DEBUG_FUNCTION, "handle_clone(pid=%d)", event->proc->pid);
- struct Process *proc = malloc(sizeof(*proc));
+ struct process *proc = malloc(sizeof(*proc));
if (proc == NULL) {
fail:
free(proc);
@@ -297,12 +297,11 @@ handle_clone(Event *event)
}
static void
-handle_new(Event * event) {
- Process * proc;
-
+handle_new(Event *event)
+{
debug(DEBUG_FUNCTION, "handle_new(pid=%d)", event->e_un.newpid);
- proc = pid2proc(event->e_un.newpid);
+ struct process *proc = pid2proc(event->e_un.newpid);
if (!proc) {
pending_new_insert(event->e_un.newpid);
} else {
@@ -317,7 +316,8 @@ handle_new(Event * event) {
}
static char *
-shortsignal(Process *proc, int signum) {
+shortsignal(struct process *proc, int signum)
+{
static char *signalent0[] = {
#include "signalent.h"
};
@@ -341,7 +341,8 @@ shortsignal(Process *proc, int signum) {
}
static char *
-sysname(Process *proc, int sysnum) {
+sysname(struct process *proc, int sysnum)
+{
static char result[128];
static char *syscalent0[] = {
#include "syscallent.h"
@@ -369,7 +370,8 @@ sysname(Process *proc, int sysnum) {
}
static char *
-arch_sysname(Process *proc, int sysnum) {
+arch_sysname(struct process *proc, int sysnum)
+{
static char result[128];
static char *arch_syscalent[] = {
#include "arch_syscallent.h"
@@ -424,8 +426,8 @@ handle_exit_signal(Event *event) {
}
static void
-output_syscall(struct Process *proc, const char *name, enum tof tof,
- void (*output)(enum tof, struct Process *,
+output_syscall(struct process *proc, const char *name, enum tof tof,
+ void (*output)(enum tof, struct process *,
struct library_symbol *))
{
struct library_symbol syscall;
@@ -436,13 +438,13 @@ output_syscall(struct Process *proc, const char *name, enum tof tof,
}
static void
-output_syscall_left(struct Process *proc, const char *name)
+output_syscall_left(struct process *proc, const char *name)
{
output_syscall(proc, name, LT_TOF_SYSCALL, &output_left);
}
static void
-output_syscall_right(struct Process *proc, const char *name)
+output_syscall_right(struct process *proc, const char *name)
{
output_syscall(proc, name, LT_TOF_SYSCALLR, &output_right);
}
@@ -461,8 +463,9 @@ handle_syscall(Event *event) {
}
static void
-handle_exec(Event * event) {
- Process * proc = event->proc;
+handle_exec(Event *event)
+{
+ struct process *proc = event->proc;
/* Save the PID so that we can use it after unsuccessful
* process_exec. */
@@ -514,7 +517,8 @@ handle_arch_syscall(Event *event) {
struct timeval current_time_spent;
static void
-calc_time_spent(Process *proc) {
+calc_time_spent(struct process *proc)
+{
struct timeval tv;
struct timezone tz;
struct timeval diff;
@@ -572,7 +576,7 @@ handle_arch_sysret(Event *event) {
}
static void
-output_right_tos(struct Process *proc)
+output_right_tos(struct process *proc)
{
size_t d = proc->callstack_depth;
struct callstack_element *elem = &proc->callstack[d - 1];
@@ -581,7 +585,7 @@ output_right_tos(struct Process *proc)
}
#ifndef ARCH_HAVE_SYMBOL_RET
-void arch_symbol_ret(struct Process *proc, struct library_symbol *libsym)
+void arch_symbol_ret(struct process *proc, struct library_symbol *libsym)
{
}
#endif
@@ -591,7 +595,7 @@ handle_breakpoint(Event *event)
{
int i, j;
struct breakpoint *sbp;
- Process *leader = event->proc->leader;
+ struct process *leader = event->proc->leader;
void *brk_addr = event->e_un.brk_addr;
/* The leader has terminated. */
@@ -686,7 +690,8 @@ handle_breakpoint(Event *event)
}
static void
-callstack_push_syscall(Process *proc, int sysnum) {
+callstack_push_syscall(struct process *proc, int sysnum)
+{
struct callstack_element *elem;
debug(DEBUG_FUNCTION, "callstack_push_syscall(pid=%d, sysnum=%d)", proc->pid, sysnum);
@@ -711,7 +716,8 @@ callstack_push_syscall(Process *proc, int sysnum) {
}
static void
-callstack_push_symfunc(Process *proc, struct library_symbol *sym) {
+callstack_push_symfunc(struct process *proc, struct library_symbol *sym)
+{
struct callstack_element *elem;
debug(DEBUG_FUNCTION, "callstack_push_symfunc(pid=%d, symbol=%s)", proc->pid, sym->name);
@@ -738,7 +744,7 @@ callstack_push_symfunc(Process *proc, struct library_symbol *sym) {
}
void
-callstack_pop(struct Process *proc)
+callstack_pop(struct process *proc)
{
struct callstack_element *elem;
assert(proc->callstack_depth > 0);
diff --git a/libltrace.c b/libltrace.c
index 35d668f..b69a0c9 100644
--- a/libltrace.c
+++ b/libltrace.c
@@ -41,13 +41,13 @@ char *command = NULL;
int exiting = 0; /* =1 if a SIGINT or SIGTERM has been received */
static enum callback_status
-stop_non_p_processes(Process *proc, void *data)
+stop_non_p_processes(struct process *proc, void *data)
{
int stop = 1;
struct opt_p_t *it;
for (it = opt_p; it != NULL; it = it->next) {
- Process * p_proc = pid2proc(it->pid);
+ struct process *p_proc = pid2proc(it->pid);
if (p_proc == NULL) {
printf("stop_non_p_processes: %d terminated?\n", it->pid);
continue;
@@ -142,7 +142,7 @@ ltrace_init(int argc, char **argv) {
do_close_elf(&lte);
pid_t pid = execute_program(command, argv);
- struct Process *proc = open_program(command, pid);
+ struct process *proc = open_program(command, pid);
if (proc == NULL) {
fprintf(stderr, "couldn't open program '%s': %s\n",
command, strerror(errno));
diff --git a/library.c b/library.c
index 594472b..b5f6386 100644
--- a/library.c
+++ b/library.c
@@ -412,7 +412,7 @@ library_add_symbol(struct library *lib, struct library_symbol *first)
}
enum callback_status
-library_named_cb(struct Process *proc, struct library *lib, void *name)
+library_named_cb(struct process *proc, struct library *lib, void *name)
{
if (name == lib->soname
|| strcmp(lib->soname, (char *)name) == 0)
@@ -422,7 +422,7 @@ library_named_cb(struct Process *proc, struct library *lib, void *name)
}
enum callback_status
-library_with_key_cb(struct Process *proc, struct library *lib, void *keyp)
+library_with_key_cb(struct process *proc, struct library *lib, void *keyp)
{
return lib->key == *(arch_addr_t *)keyp ? CBS_STOP : CBS_CONT;
}
diff --git a/library.h b/library.h
index 555fa80..74e1df2 100644
--- a/library.h
+++ b/library.h
@@ -23,12 +23,11 @@
#define _LIBRARY_H_
#include <stdint.h>
+
#include "callback.h"
+#include "forward.h"
#include "sysdep.h"
-struct Process;
-struct library;
-
enum toplt {
LS_TOPLT_NONE = 0, /* PLT not used for this symbol. */
LS_TOPLT_EXEC, /* PLT for this symbol is executable. */
@@ -195,7 +194,7 @@ void library_add_symbol(struct library *lib, struct library_symbol *sym);
/* A function that can be used as proc_each_library callback. Looks
* for a library with the name passed in DATA. PROC is ignored. */
-enum callback_status library_named_cb(struct Process *proc,
+enum callback_status library_named_cb(struct process *proc,
struct library *lib, void *name);
/* A function that can be used as proc_each_library callback. Looks
@@ -203,7 +202,7 @@ enum callback_status library_named_cb(struct Process *proc,
*
* NOTE: The key is passed as a POINTER to arch_addr_t (that
* because in general, arch_addr_t doesn't fit in void*). */
-enum callback_status library_with_key_cb(struct Process *proc,
+enum callback_status library_with_key_cb(struct process *proc,
struct library *lib, void *keyp);
/* XXX this should really be in backend.h (as on pmachata/revamp
@@ -220,7 +219,7 @@ int arch_translate_address(struct ltelf *lte,
arch_addr_t addr, arch_addr_t *ret);
/* This is the same function as arch_translate_address, except it's
* used at the point that we don't have ELF available anymore. */
-int arch_translate_address_dyn(struct Process *proc,
+int arch_translate_address_dyn(struct process *proc,
arch_addr_t addr, arch_addr_t *ret);
#endif /* _LIBRARY_H_ */
diff --git a/ltrace-elf.c b/ltrace-elf.c
index f4f4375..c147ad8 100644
--- a/ltrace-elf.c
+++ b/ltrace-elf.c
@@ -65,7 +65,7 @@ arch_elf_destroy(struct ltelf *lte)
#endif
int
-default_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
+default_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
const char *a_name, GElf_Rela *rela, size_t ndx,
struct library_symbol **ret)
{
@@ -102,7 +102,7 @@ default_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
#ifndef ARCH_HAVE_ADD_PLT_ENTRY
enum plt_status
-arch_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
+arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
const char *a_name, GElf_Rela *rela, size_t ndx,
struct library_symbol **ret)
{
@@ -541,7 +541,7 @@ mark_chain_latent(struct library_symbol *libsym)
}
static int
-populate_plt(struct Process *proc, const char *filename,
+populate_plt(struct process *proc, const char *filename,
struct ltelf *lte, struct library *lib,
int latent_plts)
{
@@ -615,7 +615,7 @@ symbol_with_address(struct library_symbol *sym, void *addrptr)
}
static int
-populate_this_symtab(struct Process *proc, const char *filename,
+populate_this_symtab(struct process *proc, const char *filename,
struct ltelf *lte, struct library *lib,
Elf_Data *symtab, const char *strtab, size_t size,
struct library_exported_name **names)
@@ -778,7 +778,7 @@ populate_this_symtab(struct Process *proc, const char *filename,
}
static int
-populate_symtab(struct Process *proc, const char *filename,
+populate_symtab(struct process *proc, const char *filename,
struct ltelf *lte, struct library *lib,
int symtabs, int exports)
{
@@ -803,7 +803,7 @@ populate_symtab(struct Process *proc, const char *filename,
}
static int
-read_module(struct library *lib, struct Process *proc,
+read_module(struct library *lib, struct process *proc,
const char *filename, GElf_Addr bias, int main)
{
struct ltelf lte = {};
@@ -943,7 +943,7 @@ fail:
}
int
-ltelf_read_library(struct library *lib, struct Process *proc,
+ltelf_read_library(struct library *lib, struct process *proc,
const char *filename, GElf_Addr bias)
{
return read_module(lib, proc, filename, bias, 0);
@@ -951,7 +951,7 @@ ltelf_read_library(struct library *lib, struct Process *proc,
struct library *
-ltelf_read_main_binary(struct Process *proc, const char *path)
+ltelf_read_main_binary(struct process *proc, const char *path)
{
struct library *lib = malloc(sizeof(*lib));
if (lib == NULL)
diff --git a/ltrace-elf.h b/ltrace-elf.h
index 1a1321e..f0b7c90 100644
--- a/ltrace-elf.h
+++ b/ltrace-elf.h
@@ -26,11 +26,9 @@
#include <gelf.h>
#include <stdlib.h>
-#include "sysdep.h"
-struct Process;
-struct library;
-struct library_symbol;
+#include "forward.h"
+#include "sysdep.h"
/* XXX Ok, the original idea was to separate the low-level ELF data
* from the abstract "struct library" object, but we use some of the
@@ -73,12 +71,12 @@ void do_close_elf(struct ltelf *lte);
/* XXX is it possible to put breakpoints in VDSO and VSYSCALL
* pseudo-libraries? For now we assume that all libraries can be
* opened via a filesystem. BASE is ignored for ET_EXEC files. */
-int ltelf_read_library(struct library *lib, struct Process *proc,
+int ltelf_read_library(struct library *lib, struct process *proc,
const char *filename, GElf_Addr bias);
/* Create a library object representing the main binary. The entry
* point address is stored to *ENTRYP. */
-struct library *ltelf_read_main_binary(struct Process *proc, const char *path);
+struct library *ltelf_read_main_binary(struct process *proc, const char *path);
/* Create a default PLT entry. This can be used instead (or in
* addition to) returning plt_default from arch_elf_add_plt_entry.
@@ -87,7 +85,7 @@ struct library *ltelf_read_main_binary(struct Process *proc, const char *path);
* the symbol to LTE. arch_elf_add_plt_entry has the chance to adjust
* symbol internals to its liking, and then return either plt_default
* or plt_ok. */
-int default_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
+int default_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
const char *a_name, GElf_Rela *rela, size_t ndx,
struct library_symbol **ret);
diff --git a/ltrace.h b/ltrace.h
index ee7e27b..3e714a8 100644
--- a/ltrace.h
+++ b/ltrace.h
@@ -44,7 +44,7 @@ enum Event_type {
typedef struct Event Event;
struct Event {
struct Event * next;
- struct Process * proc;
+ struct process *proc;
Event_type type;
union {
int ret_val; /* EVENT_EXIT */
diff --git a/output.c b/output.c
index 2037f46..fe62bb4 100644
--- a/output.c
+++ b/output.c
@@ -50,19 +50,19 @@ extern struct timeval current_time_spent;
Dict *dict_opt_c = NULL;
-static Process *current_proc = 0;
+static struct process *current_proc = 0;
static size_t current_depth = 0;
static int current_column = 0;
static void
-output_indent(struct Process *proc)
+output_indent(struct process *proc)
{
int d = options.indent * (proc->callstack_depth - 1);
current_column += fprintf(options.output, "%*s", d, "");
}
static void
-begin_of_line(Process *proc, int is_func, int indent)
+begin_of_line(struct process *proc, int is_func, int indent)
{
current_column = 0;
if (!proc) {
@@ -205,7 +205,7 @@ name2func(char const *name) {
}
void
-output_line(struct Process *proc, const char *fmt, ...)
+output_line(struct process *proc, const char *fmt, ...)
{
if (options.summary)
return;
@@ -245,7 +245,8 @@ output_error(FILE *stream)
}
static int
-fetch_simple_param(enum tof type, Process *proc, struct fetch_context *context,
+fetch_simple_param(enum tof type, struct process *proc,
+ struct fetch_context *context,
struct value_dict *arguments,
struct arg_type_info *info, int own,
struct value *valuep)
@@ -287,7 +288,8 @@ fetch_param_stop(struct value_dict *arguments, ssize_t *params_leftp)
}
static int
-fetch_param_pack(enum tof type, Process *proc, struct fetch_context *context,
+fetch_param_pack(enum tof type, struct process *proc,
+ struct fetch_context *context,
struct value_dict *arguments, struct param *param,
ssize_t *params_leftp)
{
@@ -340,7 +342,8 @@ fetch_param_pack(enum tof type, Process *proc, struct fetch_context *context,
}
static int
-fetch_one_param(enum tof type, Process *proc, struct fetch_context *context,
+fetch_one_param(enum tof type, struct process *proc,
+ struct fetch_context *context,
struct value_dict *arguments, struct param *param,
ssize_t *params_leftp)
{
@@ -369,7 +372,8 @@ fetch_one_param(enum tof type, Process *proc, struct fetch_context *context,
}
static int
-fetch_params(enum tof type, Process *proc, struct fetch_context *context,
+fetch_params(enum tof type, struct process *proc,
+ struct fetch_context *context,
struct value_dict *arguments, Function *func, ssize_t *params_leftp)
{
size_t i;
@@ -421,7 +425,7 @@ output_params(struct value_dict *arguments, size_t start, size_t end,
}
void
-output_left(enum tof type, struct Process *proc,
+output_left(enum tof type, struct process *proc,
struct library_symbol *libsym)
{
const char *function_name = libsym->name;
@@ -496,7 +500,7 @@ output_left(enum tof type, struct Process *proc,
}
void
-output_right(enum tof type, struct Process *proc, struct library_symbol *libsym)
+output_right(enum tof type, struct process *proc, struct library_symbol *libsym)
{
const char *function_name = libsym->name;
Function *func = name2func(function_name);
diff --git a/output.h b/output.h
index 0d16657..b9f0518 100644
--- a/output.h
+++ b/output.h
@@ -24,10 +24,10 @@
#include "fetch.h"
#include "forward.h"
-void output_line(struct Process *proc, const char *fmt, ...);
-void output_left(enum tof type, struct Process *proc,
+void output_line(struct process *proc, const char *fmt, ...);
+void output_left(enum tof type, struct process *proc,
struct library_symbol *libsym);
-void output_right(enum tof type, struct Process *proc,
+void output_right(enum tof type, struct process *proc,
struct library_symbol *libsym);
/* This function is for emitting lists of comma-separated strings.
diff --git a/proc.c b/proc.c
index 3b4bfdb..fc37c4e 100644
--- a/proc.c
+++ b/proc.c
@@ -43,24 +43,24 @@
#ifndef ARCH_HAVE_PROCESS_DATA
int
-arch_process_init(struct Process *proc)
+arch_process_init(struct process *proc)
{
return 0;
}
void
-arch_process_destroy(struct Process *proc)
+arch_process_destroy(struct process *proc)
{
}
int
-arch_process_clone(struct Process *retp, struct Process *proc)
+arch_process_clone(struct process *retp, struct process *proc)
{
return 0;
}
int
-arch_process_exec(struct Process *proc)
+arch_process_exec(struct process *proc)
{
return 0;
}
@@ -68,24 +68,24 @@ arch_process_exec(struct Process *proc)
#ifndef OS_HAVE_PROCESS_DATA
int
-os_process_init(struct Process *proc)
+os_process_init(struct process *proc)
{
return 0;
}
void
-os_process_destroy(struct Process *proc)
+os_process_destroy(struct process *proc)
{
}
int
-os_process_clone(struct Process *retp, struct Process *proc)
+os_process_clone(struct process *retp, struct process *proc)
{
return 0;
}
int
-os_process_exec(struct Process *proc)
+os_process_exec(struct process *proc)
{
return 0;
}
@@ -93,16 +93,16 @@ os_process_exec(struct Process *proc)
#ifndef ARCH_HAVE_DYNLINK_DONE
void
-arch_dynlink_done(struct Process *proc)
+arch_dynlink_done(struct process *proc)
{
}
#endif
-static void add_process(struct Process *proc, int was_exec);
-static void unlist_process(struct Process *proc);
+static void add_process(struct process *proc, int was_exec);
+static void unlist_process(struct process *proc);
static void
-destroy_unwind(struct Process *proc)
+destroy_unwind(struct process *proc)
{
#if defined(HAVE_LIBUNWIND)
_UPT_destroy(proc->unwind_priv);
@@ -111,7 +111,7 @@ destroy_unwind(struct Process *proc)
}
static int
-process_bare_init(struct Process *proc, const char *filename,
+process_bare_init(struct process *proc, const char *filename,
pid_t pid, int was_exec)
{
if (!was_exec) {
@@ -151,7 +151,7 @@ process_bare_init(struct Process *proc, const char *filename,
}
static void
-process_bare_destroy(struct Process *proc, int was_exec)
+process_bare_destroy(struct process *proc, int was_exec)
{
dict_clear(proc->breakpoints);
if (!was_exec) {
@@ -162,7 +162,7 @@ process_bare_destroy(struct Process *proc, int was_exec)
}
static int
-process_init_main(struct Process *proc)
+process_init_main(struct process *proc)
{
if (breakpoints_init(proc) < 0) {
fprintf(stderr, "failed to init breakpoints %d\n",
@@ -174,7 +174,7 @@ process_init_main(struct Process *proc)
}
int
-process_init(struct Process *proc, const char *filename, pid_t pid)
+process_init(struct process *proc, const char *filename, pid_t pid)
{
if (process_bare_init(proc, filename, pid, 0) < 0) {
fail:
@@ -204,7 +204,7 @@ process_init(struct Process *proc, const char *filename, pid_t pid)
}
static enum callback_status
-destroy_breakpoint_cb(struct Process *proc, struct breakpoint *bp, void *data)
+destroy_breakpoint_cb(struct process *proc, struct breakpoint *bp, void *data)
{
breakpoint_destroy(bp);
free(bp);
@@ -212,10 +212,10 @@ destroy_breakpoint_cb(struct Process *proc, struct breakpoint *bp, void *data)
}
// XXX see comment in handle_event.c
-void callstack_pop(struct Process *proc);
+void callstack_pop(struct process *proc);
static void
-private_process_destroy(struct Process *proc, int was_exec)
+private_process_destroy(struct process *proc, int was_exec)
{
/* Pop remaining stack elements. */
while (proc->callstack_depth > 0) {
@@ -257,7 +257,7 @@ private_process_destroy(struct Process *proc, int was_exec)
}
void
-process_destroy(struct Process *proc)
+process_destroy(struct process *proc)
{
arch_process_destroy(proc);
os_process_destroy(proc);
@@ -265,7 +265,7 @@ process_destroy(struct Process *proc)
}
int
-process_exec(struct Process *proc)
+process_exec(struct process *proc)
{
/* Call exec handlers first, before we destroy the main
* state. */
@@ -284,11 +284,11 @@ process_exec(struct Process *proc)
return 0;
}
-struct Process *
+struct process *
open_program(const char *filename, pid_t pid)
{
assert(pid != 0);
- struct Process *proc = malloc(sizeof(*proc));
+ struct process *proc = malloc(sizeof(*proc));
if (proc == NULL || process_init(proc, filename, pid) < 0) {
free(proc);
return NULL;
@@ -297,8 +297,8 @@ open_program(const char *filename, pid_t pid)
}
struct clone_single_bp_data {
- struct Process *old_proc;
- struct Process *new_proc;
+ struct process *old_proc;
+ struct process *new_proc;
int error;
};
@@ -327,7 +327,7 @@ clone_single_bp(void *key, void *value, void *u)
}
int
-process_clone(struct Process *retp, struct Process *proc, pid_t pid)
+process_clone(struct process *retp, struct process *proc, pid_t pid)
{
if (process_bare_init(retp, proc->filename, pid, 0) < 0) {
fail1:
@@ -456,20 +456,18 @@ process_clone(struct Process *retp, struct Process *proc, pid_t pid)
static int
open_one_pid(pid_t pid)
{
- Process *proc;
- char *filename;
debug(DEBUG_PROCESS, "open_one_pid(pid=%d)", pid);
/* Get the filename first. Should the trace_pid fail, we can
* easily free it, untracing is more work. */
- if ((filename = pid2name(pid)) == NULL
- || trace_pid(pid) < 0) {
+ char *filename = pid2name(pid);
+ if (filename == NULL || trace_pid(pid) < 0) {
fail:
free(filename);
return -1;
}
- proc = open_program(filename, pid);
+ struct process *proc = open_program(filename, pid);
if (proc == NULL)
goto fail;
free(filename);
@@ -479,7 +477,7 @@ open_one_pid(pid_t pid)
}
static enum callback_status
-start_one_pid(Process * proc, void * data)
+start_one_pid(struct process *proc, void *data)
{
continue_process(proc->pid);
return CBS_CONT;
@@ -537,7 +535,7 @@ open_pid(pid_t pid)
old_ntasks = ntasks;
}
- struct Process *leader = pid2proc(pid)->leader;
+ struct process *leader = pid2proc(pid)->leader;
/* XXX Is there a way to figure out whether _start has
* actually already been hit? */
@@ -548,29 +546,29 @@ open_pid(pid_t pid)
}
static enum callback_status
-find_proc(Process * proc, void * data)
+find_proc(struct process *proc, void *data)
{
pid_t pid = (pid_t)(uintptr_t)data;
return proc->pid == pid ? CBS_STOP : CBS_CONT;
}
-Process *
-pid2proc(pid_t pid) {
+struct process *
+pid2proc(pid_t pid)
+{
return each_process(NULL, &find_proc, (void *)(uintptr_t)pid);
}
-static Process * list_of_processes = NULL;
+static struct process *list_of_processes = NULL;
static void
-unlist_process(Process * proc)
+unlist_process(struct process *proc)
{
- Process *tmp;
-
if (list_of_processes == proc) {
list_of_processes = list_of_processes->next;
return;
}
+ struct process *tmp;
for (tmp = list_of_processes; ; tmp = tmp->next) {
/* If the following assert fails, the process wasn't
* in the list. */
@@ -583,17 +581,17 @@ unlist_process(Process * proc)
}
}
-struct Process *
-each_process(struct Process *start_after,
- enum callback_status(*cb)(struct Process *proc, void *data),
+struct process *
+each_process(struct process *start_after,
+ enum callback_status(*cb)(struct process *proc, void *data),
void *data)
{
- struct Process *it = start_after == NULL ? list_of_processes
+ struct process *it = start_after == NULL ? list_of_processes
: start_after->next;
while (it != NULL) {
/* Callback might call remove_process. */
- struct Process *next = it->next;
+ struct process *next = it->next;
switch ((*cb)(it, data)) {
case CBS_FAIL:
/* XXX handle me */
@@ -607,20 +605,20 @@ each_process(struct Process *start_after,
return NULL;
}
-Process *
-each_task(struct Process *proc, struct Process *start_after,
- enum callback_status(*cb)(struct Process *proc, void *data),
+struct process *
+each_task(struct process *proc, struct process *start_after,
+ enum callback_status(*cb)(struct process *proc, void *data),
void *data)
{
assert(proc != NULL);
- struct Process *it = start_after == NULL ? proc->leader
+ struct process *it = start_after == NULL ? proc->leader
: start_after->next;
if (it != NULL) {
- struct Process *leader = it->leader;
+ struct process *leader = it->leader;
while (it != NULL && it->leader == leader) {
/* Callback might call remove_process. */
- struct Process *next = it->next;
+ struct process *next = it->next;
switch ((*cb)(it, data)) {
case CBS_FAIL:
/* XXX handle me */
@@ -636,19 +634,19 @@ each_task(struct Process *proc, struct Process *start_after,
}
static void
-add_process(struct Process *proc, int was_exec)
+add_process(struct process *proc, int was_exec)
{
- Process ** leaderp = &list_of_processes;
+ struct process **leaderp = &list_of_processes;
if (proc->pid) {
pid_t tgid = process_leader(proc->pid);
if (tgid == 0)
/* Must have been terminated before we managed
* to fully attach. */
return;
- if (tgid == proc->pid)
+ if (tgid == proc->pid) {
proc->leader = proc;
- else {
- Process * leader = pid2proc(tgid);
+ } else {
+ struct process *leader = pid2proc(tgid);
proc->leader = leader;
if (leader != NULL)
leaderp = &leader->next;
@@ -662,9 +660,9 @@ add_process(struct Process *proc, int was_exec)
}
void
-change_process_leader(Process * proc, Process * leader)
+change_process_leader(struct process *proc, struct process *leader)
{
- Process ** leaderp = &list_of_processes;
+ struct process **leaderp = &list_of_processes;
if (proc->leader == leader)
return;
@@ -679,7 +677,7 @@ change_process_leader(Process * proc, Process * leader)
}
static enum callback_status
-clear_leader(struct Process *proc, void *data)
+clear_leader(struct process *proc, void *data)
{
debug(DEBUG_FUNCTION, "detach_task %d from leader %d",
proc->pid, proc->leader->pid);
@@ -688,7 +686,7 @@ clear_leader(struct Process *proc, void *data)
}
void
-remove_process(Process *proc)
+remove_process(struct process *proc)
{
debug(DEBUG_FUNCTION, "remove_proc(pid=%d)", proc->pid);
@@ -702,7 +700,7 @@ remove_process(Process *proc)
}
void
-install_event_handler(Process *proc, struct event_handler *handler)
+install_event_handler(struct process *proc, struct event_handler *handler)
{
debug(DEBUG_FUNCTION, "install_event_handler(pid=%d, %p)", proc->pid, handler);
assert(proc->event_handler == NULL);
@@ -710,7 +708,7 @@ install_event_handler(Process *proc, struct event_handler *handler)
}
void
-destroy_event_handler(Process * proc)
+destroy_event_handler(struct process *proc)
{
struct event_handler *handler = proc->event_handler;
debug(DEBUG_FUNCTION, "destroy_event_handler(pid=%d, %p)", proc->pid, handler);
@@ -722,7 +720,7 @@ destroy_event_handler(Process * proc)
}
static int
-breakpoint_for_symbol(struct library_symbol *libsym, struct Process *proc)
+breakpoint_for_symbol(struct library_symbol *libsym, struct process *proc)
{
arch_addr_t bp_addr;
assert(proc->leader == proc);
@@ -799,7 +797,7 @@ cb_breakpoint_for_symbol(struct library_symbol *libsym, void *data)
}
static int
-proc_activate_latent_symbol(struct Process *proc,
+proc_activate_latent_symbol(struct process *proc,
struct library_symbol *libsym)
{
assert(libsym->latent);
@@ -809,7 +807,7 @@ proc_activate_latent_symbol(struct Process *proc,
}
int
-proc_activate_delayed_symbol(struct Process *proc,
+proc_activate_delayed_symbol(struct process *proc,
struct library_symbol *libsym)
{
assert(libsym->delayed);
@@ -819,7 +817,7 @@ proc_activate_delayed_symbol(struct Process *proc,
}
static enum callback_status
-activate_latent_in(struct Process *proc, struct library *lib, void *data)
+activate_latent_in(struct process *proc, struct library *lib, void *data)
{
struct library_exported_name *exported;
for (exported = data; exported != NULL; exported = exported->next) {
@@ -836,7 +834,7 @@ activate_latent_in(struct Process *proc, struct library *lib, void *data)
}
void
-proc_add_library(struct Process *proc, struct library *lib)
+proc_add_library(struct process *proc, struct library *lib)
{
assert(lib->next == NULL);
lib->next = proc->libraries;
@@ -864,7 +862,7 @@ proc_add_library(struct Process *proc, struct library *lib)
}
int
-proc_remove_library(struct Process *proc, struct library *lib)
+proc_remove_library(struct process *proc, struct library *lib)
{
struct library **libp;
for (libp = &proc->libraries; *libp != NULL; libp = &(*libp)->next)
@@ -876,8 +874,8 @@ proc_remove_library(struct Process *proc, struct library *lib)
}
struct library *
-proc_each_library(struct Process *proc, struct library *it,
- enum callback_status (*cb)(struct Process *proc,
+proc_each_library(struct process *proc, struct library *it,
+ enum callback_status (*cb)(struct process *proc,
struct library *lib, void *data),
void *data)
{
@@ -903,7 +901,7 @@ proc_each_library(struct Process *proc, struct library *it,
}
static void
-check_leader(struct Process *proc)
+check_leader(struct process *proc)
{
/* Only the group leader should be getting the breakpoints and
* thus have ->breakpoint initialized. */
@@ -913,7 +911,7 @@ check_leader(struct Process *proc)
}
int
-proc_add_breakpoint(struct Process *proc, struct breakpoint *bp)
+proc_add_breakpoint(struct process *proc, struct breakpoint *bp)
{
debug(DEBUG_FUNCTION, "proc_add_breakpoint(pid=%d, %s@%p)",
proc->pid, breakpoint_name(bp), bp->addr);
@@ -935,7 +933,7 @@ proc_add_breakpoint(struct Process *proc, struct breakpoint *bp)
}
void
-proc_remove_breakpoint(struct Process *proc, struct breakpoint *bp)
+proc_remove_breakpoint(struct process *proc, struct breakpoint *bp)
{
debug(DEBUG_FUNCTION, "proc_remove_breakpoint(pid=%d, %s@%p)",
proc->pid, breakpoint_name(bp), bp->addr);
@@ -950,8 +948,8 @@ struct each_breakpoint_data
{
void *start;
void *end;
- struct Process *proc;
- enum callback_status (*cb)(struct Process *proc,
+ struct process *proc;
+ enum callback_status (*cb)(struct process *proc,
struct breakpoint *bp,
void *data);
void *cb_data;
@@ -979,8 +977,8 @@ each_breakpoint_cb(void *key, void *value, void *d)
}
void *
-proc_each_breakpoint(struct Process *proc, void *start,
- enum callback_status (*cb)(struct Process *proc,
+proc_each_breakpoint(struct process *proc, void *start,
+ enum callback_status (*cb)(struct process *proc,
struct breakpoint *bp,
void *data), void *data)
{
@@ -995,7 +993,7 @@ proc_each_breakpoint(struct Process *proc, void *start,
}
int
-proc_find_symbol(struct Process *proc, struct library_symbol *sym,
+proc_find_symbol(struct process *proc, struct library_symbol *sym,
struct library **retlib, struct library_symbol **retsym)
{
struct library *lib = sym->lib;
@@ -1021,7 +1019,7 @@ proc_find_symbol(struct Process *proc, struct library_symbol *sym,
}
struct library_symbol *
-proc_each_symbol(struct Process *proc, struct library_symbol *start_after,
+proc_each_symbol(struct process *proc, struct library_symbol *start_after,
enum callback_status (*cb)(struct library_symbol *, void *),
void *data)
{
diff --git a/proc.h b/proc.h
index a97796c..8dd3356 100644
--- a/proc.h
+++ b/proc.h
@@ -75,13 +75,12 @@ struct callstack_element {
#define MAX_CALLDEPTH 64
/* XXX We would rather have this all organized a little differently,
- * have Process for the whole group and Task for what's there for
- * per-thread stuff. But for now this is the less invasive way of
- * structuring it. */
-typedef struct Process Process;
-struct Process {
+ * have struct process for the whole group and struct task (or struct
+ * lwp, struct thread) for what's there for per-thread stuff. But for
+ * now this is the less invasive way of structuring it. */
+struct process {
enum process_state state;
- Process * parent; /* needed by STATE_BEING_CREATED */
+ struct process *parent; /* needed by STATE_BEING_CREATED */
char * filename;
pid_t pid;
@@ -133,15 +132,15 @@ struct Process {
/**
* Process chaining.
**/
- Process * next;
+ struct process *next;
/* LEADER points to the leader thread of the POSIX.1 process.
If X->LEADER == X, then X is the leader thread and the
- Process structures chained by NEXT represent other threads,
+ process structures chained by NEXT represent other threads,
up until, but not including, the next leader thread.
LEADER may be NULL after the leader has already exited. In
that case this process is waiting to be collected. */
- Process * leader;
+ struct process *leader;
struct os_process_data os;
struct arch_process_data arch;
@@ -149,12 +148,12 @@ struct Process {
/* Initialize a process given a path to binary FILENAME, with a PID,
* and add the process to an internal chain of traced processes. */
-int process_init(struct Process *proc, const char *filename, pid_t pid);
+int process_init(struct process *proc, const char *filename, pid_t pid);
/* PROC underwent an exec. This is a bit like process_destroy
* followed by process_init, except that some state is kept and the
* process doesn't lose it's place in the list of processes. */
-int process_exec(struct Process *proc);
+int process_exec(struct process *proc);
/* Release any memory allocated for PROC (but not PROC itself). Does
* NOT remove PROC from internal chain.
@@ -162,74 +161,74 @@ int process_exec(struct Process *proc);
* XXX clearly this init/destroy pair is different than others and
* should be fixed. process_init should presumably be separate from
* process_add. */
-void process_destroy(struct Process *proc);
+void process_destroy(struct process *proc);
-struct Process *open_program(const char *filename, pid_t pid);
+struct process *open_program(const char *filename, pid_t pid);
void open_pid(pid_t pid);
-Process * pid2proc(pid_t pid);
+struct process *pid2proc(pid_t pid);
/* Clone the contents of PROC into the memory referenced by RETP.
* Returns 0 on success or a negative value on failure. */
-int process_clone(struct Process *retp, struct Process *proc, pid_t pid);
+int process_clone(struct process *retp, struct process *proc, pid_t pid);
/* Iterate through the processes that ltrace currently traces. Tasks
* are considered to be processes for the purpose of this iterator.
* See callback.h for notes on iteration interfaces. */
-Process *each_process(Process *start_after,
- enum callback_status (*cb)(struct Process *proc,
- void *data),
- void *data);
+struct process *each_process(struct process *start_after,
+ enum callback_status (*cb)(struct process *proc,
+ void *data),
+ void *data);
/* Iterate through list of tasks of given process PROC. See
* callback.h for notes on iteration interfaces. */
-Process *each_task(struct Process *proc, struct Process *start_after,
- enum callback_status (*cb)(struct Process *proc,
- void *data),
- void *data);
+struct process *each_task(struct process *proc, struct process *start_after,
+ enum callback_status (*cb)(struct process *proc,
+ void *data),
+ void *data);
-void change_process_leader(Process *proc, Process *leader);
+void change_process_leader(struct process *proc, struct process *leader);
/* Remove process from the list of traced processes, drop any events
* in the event queue, destroy it and free memory. */
-void remove_process(struct Process *proc);
+void remove_process(struct process *proc);
-void install_event_handler(Process *proc, struct event_handler *handler);
-void destroy_event_handler(Process *proc);
+void install_event_handler(struct process *proc, struct event_handler *handler);
+void destroy_event_handler(struct process *proc);
/* Add a library LIB to the list of PROC's libraries. */
-void proc_add_library(struct Process *proc, struct library *lib);
+void proc_add_library(struct process *proc, struct library *lib);
/* Remove LIB from list of PROC's libraries. Returns 0 if the library
* was found and unlinked, otherwise returns a negative value. */
-int proc_remove_library(struct Process *proc, struct library *lib);
+int proc_remove_library(struct process *proc, struct library *lib);
/* Clear a delayed flag. If a symbol is neither latent, nor delayed,
* a breakpoint is inserted for it. Returns 0 if the activation was
* successful or a negative value if it failed. Note that if a symbol
* is both latent and delayed, this will not enable the corresponding
* breakpoint. */
-int proc_activate_delayed_symbol(struct Process *proc,
+int proc_activate_delayed_symbol(struct process *proc,
struct library_symbol *libsym);
/* Iterate through the libraries of PROC. See callback.h for notes on
* iteration interfaces. */
-struct library *proc_each_library(struct Process *proc, struct library *start,
- enum callback_status (*cb)(struct Process *p,
+struct library *proc_each_library(struct process *proc, struct library *start,
+ enum callback_status (*cb)(struct process *p,
struct library *l,
void *data),
void *data);
/* Insert BP into PROC. */
-int proc_add_breakpoint(struct Process *proc, struct breakpoint *bp);
+int proc_add_breakpoint(struct process *proc, struct breakpoint *bp);
/* Remove BP from PROC. This has no reason to fail in runtime. If it
* does not find BP in PROC, it's hard error guarded by assertion. */
-void proc_remove_breakpoint(struct Process *proc, struct breakpoint *bp);
+void proc_remove_breakpoint(struct process *proc, struct breakpoint *bp);
/* Iterate through the breakpoints of PROC. See callback.h for notes
* on iteration interfaces. */
-void *proc_each_breakpoint(struct Process *proc, void *start,
- enum callback_status (*cb)(struct Process *proc,
+void *proc_each_breakpoint(struct process *proc, void *start,
+ enum callback_status (*cb)(struct process *proc,
struct breakpoint *bp,
void *data),
void *data);
@@ -237,20 +236,20 @@ void *proc_each_breakpoint(struct Process *proc, void *start,
/* Iterate through the dynamic section at src_addr looking for D_TAG.
* If tag is found, fill it's value in RET and return 0.
* If tag is not found, return a negative value. */
-int proc_find_dynamic_entry_addr(struct Process *proc, arch_addr_t src_addr,
+int proc_find_dynamic_entry_addr(struct process *proc, arch_addr_t src_addr,
int d_tag, arch_addr_t *ret);
/* Finds a symbol corresponding to LIBSYM in a process PROC. Returns
* 0 and sets *RETLIB and *RETSYM if the corresponding pointer is
* non-NULL. Returns a negative value when the symbols couldn't be
* found. */
-int proc_find_symbol(struct Process *proc, struct library_symbol *sym,
+int proc_find_symbol(struct process *proc, struct library_symbol *sym,
struct library **retlib, struct library_symbol **retsym);
/* Iterate through all symbols in all libraries of PROC. See
* callback.h for notes on this interface. */
struct library_symbol *proc_each_symbol
- (struct Process *proc, struct library_symbol *start_after,
+ (struct process *proc, struct library_symbol *start_after,
enum callback_status (*cb)(struct library_symbol *, void *),
void *data);
diff --git a/sysdeps/linux-gnu/alpha/plt.c b/sysdeps/linux-gnu/alpha/plt.c
index c7ce9fe..1185363 100644
--- a/sysdeps/linux-gnu/alpha/plt.c
+++ b/sysdeps/linux-gnu/alpha/plt.c
@@ -23,11 +23,13 @@
#include "common.h"
GElf_Addr
-arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
+arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
return lte->plt_addr + ndx * 12 + 32;
}
void *
-sym2addr(Process *proc, struct library_symbol *sym) {
+sym2addr(struct process *proc, struct library_symbol *sym)
+{
return sym->enter_addr;
}
diff --git a/sysdeps/linux-gnu/alpha/regs.c b/sysdeps/linux-gnu/alpha/regs.c
index 0b46afd..c197225 100644
--- a/sysdeps/linux-gnu/alpha/regs.c
+++ b/sysdeps/linux-gnu/alpha/regs.c
@@ -36,26 +36,31 @@
#endif
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 64 /* REG_PC */ , 0);
}
void
-set_instruction_pointer(Process *proc, void *addr) {
+set_instruction_pointer(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, 64 /* REG_PC */ , addr);
}
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 30 /* REG_FP */ , 0);
}
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 26 /* RA */ , 0);
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, 26 /* RA */ , addr);
}
diff --git a/sysdeps/linux-gnu/alpha/trace.c b/sysdeps/linux-gnu/alpha/trace.c
index a7c5e59..c6f7494 100644
--- a/sysdeps/linux-gnu/alpha/trace.c
+++ b/sysdeps/linux-gnu/alpha/trace.c
@@ -40,13 +40,15 @@
#endif
void
-get_arch_dep(Process *proc) {
+get_arch_dep(struct process *proc)
+{
}
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
int
-syscall_p(Process *proc, int status, int *sysnum) {
+syscall_p(struct process *proc, int status, int *sysnum)
+{
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
char *ip = get_instruction_pointer(proc) - 4;
@@ -69,7 +71,8 @@ syscall_p(Process *proc, int status, int *sysnum) {
}
long
-gimme_arg(enum tof type, Process *proc, int arg_num, struct arg_type_info *info)
+gimme_arg(enum tof type, struct process *proc, int arg_num,
+ struct arg_type_info *info)
{
if (arg_num == -1) { /* return value */
return ptrace(PTRACE_PEEKUSER, proc->pid, 0 /* REG_R0 */ , 0);
diff --git a/sysdeps/linux-gnu/arm/breakpoint.c b/sysdeps/linux-gnu/arm/breakpoint.c
index 5748401..2fb9578 100644
--- a/sysdeps/linux-gnu/arm/breakpoint.c
+++ b/sysdeps/linux-gnu/arm/breakpoint.c
@@ -92,7 +92,7 @@ arch_disable_breakpoint(pid_t pid, const struct breakpoint *sbp)
}
int
-arch_breakpoint_init(struct Process *proc, struct breakpoint *sbp)
+arch_breakpoint_init(struct process *proc, struct breakpoint *sbp)
{
/* XXX That uintptr_t cast is there temporarily until
* arch_addr_t becomes integral type. */
diff --git a/sysdeps/linux-gnu/arm/plt.c b/sysdeps/linux-gnu/arm/plt.c
index 1b97705..d1bf7ca 100644
--- a/sysdeps/linux-gnu/arm/plt.c
+++ b/sysdeps/linux-gnu/arm/plt.c
@@ -43,6 +43,7 @@ arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
}
void *
-sym2addr(Process *proc, struct library_symbol *sym) {
+sym2addr(struct process *proc, struct library_symbol *sym)
+{
return sym->enter_addr;
}
diff --git a/sysdeps/linux-gnu/arm/regs.c b/sysdeps/linux-gnu/arm/regs.c
index 484de7f..377df62 100644
--- a/sysdeps/linux-gnu/arm/regs.c
+++ b/sysdeps/linux-gnu/arm/regs.c
@@ -41,24 +41,28 @@
#define off_sp ((void *)52)
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_pc, 0);
}
void
-set_instruction_pointer(Process *proc, void *addr) {
+set_instruction_pointer(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, off_pc, addr);
}
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_sp, 0);
}
/* really, this is given the *stack_pointer expecting
* a CISC architecture; in our case, we don't need that */
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
long addr = ptrace(PTRACE_PEEKUSER, proc->pid, off_lr, 0);
/* Remember & unset the thumb mode bit. XXX This is really a
@@ -74,7 +78,8 @@ get_return_addr(Process *proc, void *stack_pointer) {
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
long iaddr = (int)addr | proc->thumb_mode;
ptrace(PTRACE_POKEUSER, proc->pid, off_lr, (void *)iaddr);
}
diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c
index c528cfb..fbbf676 100644
--- a/sysdeps/linux-gnu/arm/trace.c
+++ b/sysdeps/linux-gnu/arm/trace.c
@@ -48,7 +48,8 @@
#define off_pc ((void *)60)
void
-get_arch_dep(Process *proc) {
+get_arch_dep(struct process *proc)
+{
proc_archdep *a;
if (!proc->arch_ptr)
@@ -63,7 +64,8 @@ get_arch_dep(Process *proc) {
* -1 on error.
*/
int
-syscall_p(Process *proc, int status, int *sysnum) {
+syscall_p(struct process *proc, int status, int *sysnum)
+{
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
/* get the user's pc (plus 8) */
@@ -104,7 +106,8 @@ syscall_p(Process *proc, int status, int *sysnum) {
}
long
-gimme_arg(enum tof type, Process *proc, int arg_num, struct arg_type_info *info)
+gimme_arg(enum tof type, struct process *proc, int arg_num,
+ struct arg_type_info *info)
{
proc_archdep *a = (proc_archdep *) proc->arch_ptr;
diff --git a/sysdeps/linux-gnu/breakpoint.c b/sysdeps/linux-gnu/breakpoint.c
index fe336b1..c28d745 100644
--- a/sysdeps/linux-gnu/breakpoint.c
+++ b/sysdeps/linux-gnu/breakpoint.c
@@ -79,7 +79,7 @@ arch_enable_breakpoint(pid_t pid, struct breakpoint *sbp)
#endif /* ARCH_HAVE_ENABLE_BREAKPOINT */
void
-enable_breakpoint(Process *proc, struct breakpoint *sbp)
+enable_breakpoint(struct process *proc, struct breakpoint *sbp)
{
debug(DEBUG_PROCESS, "enable_breakpoint: pid=%d, addr=%p, symbol=%s",
proc->pid, sbp->addr, breakpoint_name(sbp));
@@ -127,7 +127,7 @@ arch_disable_breakpoint(pid_t pid, const struct breakpoint *sbp)
#endif /* ARCH_HAVE_DISABLE_BREAKPOINT */
void
-disable_breakpoint(Process *proc, struct breakpoint *sbp)
+disable_breakpoint(struct process *proc, struct breakpoint *sbp)
{
debug(DEBUG_PROCESS, "disable_breakpoint: pid=%d, addr=%p, symbol=%s",
proc->pid, sbp->addr, breakpoint_name(sbp));
diff --git a/sysdeps/linux-gnu/cris/plt.c b/sysdeps/linux-gnu/cris/plt.c
index 427ae93..fcc18d2 100644
--- a/sysdeps/linux-gnu/cris/plt.c
+++ b/sysdeps/linux-gnu/cris/plt.c
@@ -28,7 +28,7 @@ GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
return lte->plt_addr + 0x20 + (ndx * 26);
}
-void *sym2addr(Process *proc, struct library_symbol *sym)
+void *sym2addr(struct process *proc, struct library_symbol *sym)
{
return sym->enter_addr;
}
diff --git a/sysdeps/linux-gnu/cris/regs.c b/sysdeps/linux-gnu/cris/regs.c
index 7028b9e..4cf1fbf 100644
--- a/sysdeps/linux-gnu/cris/regs.c
+++ b/sysdeps/linux-gnu/cris/regs.c
@@ -37,22 +37,22 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void *get_instruction_pointer(Process *proc)
+void *get_instruction_pointer(struct process *proc)
{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_PPC, 0);
}
-void set_instruction_pointer(Process *proc, void *addr)
+void set_instruction_pointer(struct process *proc, void *addr)
{
ptrace(PTRACE_POKEUSER, proc->pid, 4 * PT_PPC, addr);
}
-void *get_stack_pointer(Process *proc)
+void *get_stack_pointer(struct process *proc)
{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_USP, 0);
}
-void *get_return_addr(Process *proc, void *stack_pointer)
+void *get_return_addr(struct process *proc, void *stack_pointer)
{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_SRP, 0);
}
diff --git a/sysdeps/linux-gnu/cris/trace.c b/sysdeps/linux-gnu/cris/trace.c
index 98cb7d8..7d8cca6 100644
--- a/sysdeps/linux-gnu/cris/trace.c
+++ b/sysdeps/linux-gnu/cris/trace.c
@@ -40,14 +40,14 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void get_arch_dep(Process *proc)
+void get_arch_dep(struct process *proc)
{
}
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
#define SYSCALL_INSN 0xe93d
-int syscall_p(Process *proc, int status, int *sysnum)
+int syscall_p(struct process *proc, int status, int *sysnum)
{
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
@@ -71,7 +71,7 @@ int syscall_p(Process *proc, int status, int *sysnum)
return 0;
}
-long gimme_arg(enum tof type, Process *proc, int arg_num,
+long gimme_arg(enum tof type, struct process *proc, int arg_num,
struct arg_type_info *info)
{
int pid = proc->pid;
diff --git a/sysdeps/linux-gnu/events.c b/sysdeps/linux-gnu/events.c
index 077a656..52e2f4f 100644
--- a/sysdeps/linux-gnu/events.c
+++ b/sysdeps/linux-gnu/events.c
@@ -48,7 +48,7 @@ static Event * delayed_events = NULL;
static Event * end_delayed_events = NULL;
static enum callback_status
-first (Process * proc, void * data)
+first(struct process *proc, void *data)
{
return CBS_STOP;
}
@@ -199,7 +199,7 @@ next_event(void)
}
get_arch_dep(event.proc);
debug(3, "event from pid %u", pid);
- Process *leader = event.proc->leader;
+ struct process *leader = event.proc->leader;
/* The process should be stopped after the waitpid call. But
* when the whole thread group is terminated, we see
@@ -347,7 +347,7 @@ event_for_proc(struct Event *event, void *data)
}
void
-delete_events_for(struct Process *proc)
+delete_events_for(struct process *proc)
{
struct Event *event;
while ((event = each_qd_event(&event_for_proc, proc)) != NULL)
diff --git a/sysdeps/linux-gnu/events.h b/sysdeps/linux-gnu/events.h
index 3802aff..82bf0e9 100644
--- a/sysdeps/linux-gnu/events.h
+++ b/sysdeps/linux-gnu/events.h
@@ -35,7 +35,7 @@ enum ecb_status {
struct Event *each_qd_event(enum ecb_status (*cb)(struct Event *event,
void *data), void *data);
-void delete_events_for(struct Process * proc);
+void delete_events_for(struct process *proc);
void enque_event(struct Event *event);
#endif /* SYSDEPS_LINUX_GNU_EVENTS_H */
diff --git a/sysdeps/linux-gnu/ia64/fetch.c b/sysdeps/linux-gnu/ia64/fetch.c
index 54dc5b8..e90dbed 100644
--- a/sysdeps/linux-gnu/ia64/fetch.c
+++ b/sysdeps/linux-gnu/ia64/fetch.c
@@ -63,7 +63,7 @@ union cfm_t {
};
static int
-fetch_context_init(struct Process *proc, struct fetch_context *context)
+fetch_context_init(struct process *proc, struct fetch_context *context)
{
context->slot_n = 0;
context->flt = 8;
@@ -76,7 +76,7 @@ fetch_context_init(struct Process *proc, struct fetch_context *context)
}
struct fetch_context *
-arch_fetch_arg_init(enum tof type, struct Process *proc,
+arch_fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info)
{
struct fetch_context *context = malloc(sizeof(*context));
@@ -91,7 +91,7 @@ arch_fetch_arg_init(enum tof type, struct Process *proc,
}
struct fetch_context *
-arch_fetch_arg_clone(struct Process *proc,
+arch_fetch_arg_clone(struct process *proc,
struct fetch_context *context)
{
struct fetch_context *clone = malloc(sizeof(*context));
@@ -102,7 +102,7 @@ arch_fetch_arg_clone(struct Process *proc,
}
int
-allocate_stack_slot(struct fetch_context *ctx, struct Process *proc,
+allocate_stack_slot(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
size_t al = type_alignof(proc, info);
@@ -121,7 +121,7 @@ allocate_stack_slot(struct fetch_context *ctx, struct Process *proc,
}
static int
-allocate_reg(struct fetch_context *ctx, struct Process *proc,
+allocate_reg(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
if (ctx->slot_n >= 8)
@@ -152,7 +152,7 @@ allocate_reg(struct fetch_context *ctx, struct Process *proc,
}
static int
-copy_aggregate_part(struct fetch_context *ctx, struct Process *proc,
+copy_aggregate_part(struct fetch_context *ctx, struct process *proc,
unsigned char *buf, size_t size)
{
size_t slots = (size + 7) / 8;
@@ -176,7 +176,7 @@ copy_aggregate_part(struct fetch_context *ctx, struct Process *proc,
}
static int
-allocate_arg(struct fetch_context *ctx, struct Process *proc,
+allocate_arg(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
size_t sz = type_sizeof(proc, info);
@@ -213,7 +213,7 @@ fpreg_to_double (struct ia64_fpreg *fp) {
}
static int
-allocate_float(struct fetch_context *ctx, struct Process *proc,
+allocate_float(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep,
int take_slot)
{
@@ -281,7 +281,7 @@ get_hfa_type(struct arg_type_info *info, size_t *countp)
}
static int
-allocate_hfa(struct fetch_context *ctx, struct Process *proc,
+allocate_hfa(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep,
enum arg_type hfa_type, size_t hfa_count)
{
@@ -366,7 +366,7 @@ allocate_hfa(struct fetch_context *ctx, struct Process *proc,
}
static int
-allocate_ret(struct fetch_context *ctx, struct Process *proc,
+allocate_ret(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
size_t sz = type_sizeof(proc, info);
@@ -405,7 +405,7 @@ allocate_ret(struct fetch_context *ctx, struct Process *proc,
int
arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
switch (info->type) {
@@ -446,7 +446,7 @@ arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
int
arch_fetch_retval(struct fetch_context *ctx, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
if (fetch_context_init(proc, ctx) < 0)
diff --git a/sysdeps/linux-gnu/ia64/plt.c b/sysdeps/linux-gnu/ia64/plt.c
index a29488f..f6bc939 100644
--- a/sysdeps/linux-gnu/ia64/plt.c
+++ b/sysdeps/linux-gnu/ia64/plt.c
@@ -68,12 +68,13 @@ arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
}
void *
-sym2addr(Process *proc, struct library_symbol *sym) {
+sym2addr(struct process *proc, struct library_symbol *sym)
+{
return sym->enter_addr;
}
int
-arch_translate_address_dyn(struct Process *proc,
+arch_translate_address_dyn(struct process *proc,
arch_addr_t addr, arch_addr_t *ret)
{
errno = 0;
diff --git a/sysdeps/linux-gnu/ia64/regs.c b/sysdeps/linux-gnu/ia64/regs.c
index cbc2744..fb79e8a 100644
--- a/sysdeps/linux-gnu/ia64/regs.c
+++ b/sysdeps/linux-gnu/ia64/regs.c
@@ -34,7 +34,8 @@
#include "common.h"
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
unsigned long ip = ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IIP, 0);
unsigned long slot =
(ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0) >> 41) & 3;
@@ -43,7 +44,8 @@ get_instruction_pointer(Process *proc) {
}
void
-set_instruction_pointer(Process *proc, void *addr) {
+set_instruction_pointer(struct process *proc, void *addr)
+{
unsigned long newip = (unsigned long)addr;
unsigned long slot = (unsigned long)addr & 0xf;
@@ -59,7 +61,8 @@ set_instruction_pointer(Process *proc, void *addr) {
}
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
long l = ptrace(PTRACE_PEEKUSER, proc->pid, PT_R12, 0);
if (l == -1 && errno)
return NULL;
@@ -67,7 +70,8 @@ get_stack_pointer(Process *proc) {
}
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
long l = ptrace(PTRACE_PEEKUSER, proc->pid, PT_B0, 0);
if (l == -1 && errno)
return NULL;
@@ -75,6 +79,7 @@ get_return_addr(Process *proc, void *stack_pointer) {
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, PT_B0, addr);
}
diff --git a/sysdeps/linux-gnu/ia64/trace.c b/sysdeps/linux-gnu/ia64/trace.c
index e608275..9e554ef 100644
--- a/sysdeps/linux-gnu/ia64/trace.c
+++ b/sysdeps/linux-gnu/ia64/trace.c
@@ -70,7 +70,8 @@ union cfm_t {
};
int
-syscall_p(Process *proc, int status, int *sysnum) {
+syscall_p(struct process *proc, int status, int *sysnum)
+{
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
long l = ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0);
@@ -141,5 +142,6 @@ syscall_p(Process *proc, int status, int *sysnum) {
}
void
-get_arch_dep(Process *proc) {
+get_arch_dep(struct process *proc)
+{
}
diff --git a/sysdeps/linux-gnu/m68k/fetch.c b/sysdeps/linux-gnu/m68k/fetch.c
index f6d8a0b..24bd8f0 100644
--- a/sysdeps/linux-gnu/m68k/fetch.c
+++ b/sysdeps/linux-gnu/m68k/fetch.c
@@ -43,7 +43,7 @@ struct fetch_context
};
static int
-fetch_register_banks(struct Process *proc, struct fetch_context *context,
+fetch_register_banks(struct process *proc, struct fetch_context *context,
int floating)
{
if (ptrace(PTRACE_GETREGS, proc->pid, 0, &context->regs) < 0)
@@ -57,7 +57,7 @@ fetch_register_banks(struct Process *proc, struct fetch_context *context,
}
struct fetch_context *
-arch_fetch_arg_init(enum tof type, struct Process *proc,
+arch_fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info)
{
struct fetch_context *context = malloc(sizeof(*context));
@@ -92,7 +92,7 @@ arch_fetch_arg_init(enum tof type, struct Process *proc,
}
struct fetch_context *
-arch_fetch_arg_clone(struct Process *proc, struct fetch_context *context)
+arch_fetch_arg_clone(struct process *proc, struct fetch_context *context)
{
struct fetch_context *ret = malloc(sizeof(*ret));
if (ret == NULL)
@@ -103,7 +103,7 @@ arch_fetch_arg_clone(struct Process *proc, struct fetch_context *context)
int
arch_fetch_arg_next(struct fetch_context *context, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
size_t sz = type_sizeof(proc, info);
@@ -143,7 +143,7 @@ arch_fetch_arg_next(struct fetch_context *context, enum tof type,
int
arch_fetch_retval(struct fetch_context *context, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
if (fetch_register_banks(proc, context, type == LT_TOF_FUNCTIONR) < 0)
diff --git a/sysdeps/linux-gnu/m68k/plt.c b/sysdeps/linux-gnu/m68k/plt.c
index c1b37dd..dcd6878 100644
--- a/sysdeps/linux-gnu/m68k/plt.c
+++ b/sysdeps/linux-gnu/m68k/plt.c
@@ -30,6 +30,7 @@ arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
}
void *
-sym2addr(Process *proc, struct library_symbol *sym) {
+sym2addr(struct process *proc, struct library_symbol *sym)
+{
return sym->enter_addr;
}
diff --git a/sysdeps/linux-gnu/m68k/regs.c b/sysdeps/linux-gnu/m68k/regs.c
index 4afdfbb..c2fafe1 100644
--- a/sysdeps/linux-gnu/m68k/regs.c
+++ b/sysdeps/linux-gnu/m68k/regs.c
@@ -36,26 +36,31 @@
#endif
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_PC, 0);
}
void
-set_instruction_pointer(Process *proc, void *addr) {
+set_instruction_pointer(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, 4 * PT_PC, addr);
}
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_USP, 0);
}
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
return (void *)ptrace(PTRACE_PEEKTEXT, proc->pid, stack_pointer, 0);
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKETEXT, proc->pid, proc->stack_pointer, addr);
}
diff --git a/sysdeps/linux-gnu/m68k/trace.c b/sysdeps/linux-gnu/m68k/trace.c
index 311ffd5..01b5253 100644
--- a/sysdeps/linux-gnu/m68k/trace.c
+++ b/sysdeps/linux-gnu/m68k/trace.c
@@ -40,13 +40,15 @@
#endif
void
-get_arch_dep(Process *proc) {
+get_arch_dep(struct process *proc)
+{
}
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
int
-syscall_p(Process *proc, int status, int *sysnum) {
+syscall_p(struct process *proc, int status, int *sysnum)
+{
int depth;
if (WIFSTOPPED(status)
diff --git a/sysdeps/linux-gnu/mipsel/plt.c b/sysdeps/linux-gnu/mipsel/plt.c
index b277fbc..b10bbbd 100644
--- a/sysdeps/linux-gnu/mipsel/plt.c
+++ b/sysdeps/linux-gnu/mipsel/plt.c
@@ -104,7 +104,8 @@ arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela *rela)
breakpoint changes I just add a new breakpoint for the new address.
*/
void *
-sym2addr(Process *proc, struct library_symbol *sym) {
+sym2addr(struct process *proc, struct library_symbol *sym)
+{
long ret;
if (sym->arch.pltalways
@@ -125,7 +126,7 @@ sym2addr(Process *proc, struct library_symbol *sym) {
/* Address of run time loader map, used for debugging. */
#define DT_MIPS_RLD_MAP 0x70000016
int
-arch_find_dl_debug(struct Process *proc, arch_addr_t dyn_addr,
+arch_find_dl_debug(struct process *proc, arch_addr_t dyn_addr,
arch_addr_t *ret)
{
arch_addr_t rld_addr;
@@ -251,11 +252,11 @@ arch_elf_destroy(struct ltelf *lte)
/* When functions return we check if the symbol needs an updated
breakpoint with the resolved address. */
-void arch_symbol_ret(struct Process *proc, struct library_symbol *libsym)
+void arch_symbol_ret(struct process *proc, struct library_symbol *libsym)
{
struct breakpoint *bp;
arch_addr_t resolved_addr;
- struct Process *leader = proc->leader;
+ struct process *leader = proc->leader;
/* Only deal with unresolved symbols. */
if (libsym->arch.type != MIPS_PLT_UNRESOLVED)
@@ -302,7 +303,7 @@ err:
static enum callback_status
cb_enable_breakpoint_sym(struct library_symbol *libsym, void *data)
{
- struct Process *proc = data;
+ struct process *proc = data;
arch_addr_t bp_addr;
if (!libsym->arch.gotonly)
@@ -329,19 +330,19 @@ cb_enable_breakpoint_sym(struct library_symbol *libsym, void *data)
}
static enum callback_status
-cb_enable_breakpoint_lib(struct Process *proc, struct library *lib, void *data)
+cb_enable_breakpoint_lib(struct process *proc, struct library *lib, void *data)
{
library_each_symbol(lib, NULL, cb_enable_breakpoint_sym, proc);
return CBS_CONT;
}
-void arch_dynlink_done(struct Process *proc)
+void arch_dynlink_done(struct process *proc)
{
proc_each_library(proc->leader, NULL, cb_enable_breakpoint_lib, NULL);
}
enum plt_status
-arch_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
+arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
const char *a_name, GElf_Rela *rela, size_t ndx,
struct library_symbol **ret)
{
diff --git a/sysdeps/linux-gnu/mipsel/regs.c b/sysdeps/linux-gnu/mipsel/regs.c
index 8731ac5..19f97cb 100644
--- a/sysdeps/linux-gnu/mipsel/regs.c
+++ b/sysdeps/linux-gnu/mipsel/regs.c
@@ -49,7 +49,8 @@
\return The current instruction pointer.
*/
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_pc, 0);
}
@@ -63,7 +64,8 @@ get_instruction_pointer(Process *proc) {
we \c continue_process() after a breakpoint. Check if this is OK.
*/
void
-set_instruction_pointer(Process *proc, void *addr) {
+set_instruction_pointer(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, off_pc, addr);
}
@@ -72,7 +74,8 @@ set_instruction_pointer(Process *proc, void *addr) {
\return The current stack pointer.
*/
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_sp, 0);
}
@@ -87,11 +90,13 @@ get_stack_pointer(Process *proc) {
unused.
*/
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_lr, 0);
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, off_lr, addr);
}
diff --git a/sysdeps/linux-gnu/mipsel/trace.c b/sysdeps/linux-gnu/mipsel/trace.c
index db9ec21..7fa3ed4 100644
--- a/sysdeps/linux-gnu/mipsel/trace.c
+++ b/sysdeps/linux-gnu/mipsel/trace.c
@@ -64,7 +64,8 @@
private data area.
*/
void
-get_arch_dep(Process *proc) {
+get_arch_dep(struct process *proc)
+{
}
/**
@@ -85,7 +86,8 @@ get_arch_dep(Process *proc) {
for the system calls is 4000.
*/
int
-syscall_p(Process *proc, int status, int *sysnum) {
+syscall_p(struct process *proc, int status, int *sysnum)
+{
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
/* get the user's pc (plus 8) */
@@ -141,7 +143,7 @@ mips32_relative_offset (uint32_t inst)
return ((itype_immediate(inst) ^ 0x8000) - 0x8000) << 2;
}
-int mips_next_pcs(struct Process *proc, uint32_t pc, uint32_t *newpc)
+int mips_next_pcs(struct process *proc, uint32_t pc, uint32_t *newpc)
{
uint32_t inst, rx;
int op;
@@ -262,7 +264,7 @@ fail:
}
int
-arch_atomic_singlestep(struct Process *proc, struct breakpoint *sbp,
+arch_atomic_singlestep(struct process *proc, struct breakpoint *sbp,
int (*add_cb)(void *addr, void *data),
void *add_cb_data)
{
@@ -317,7 +319,8 @@ I'm not doing any floating point support here.
*/
long
-gimme_arg(enum tof type, Process *proc, int arg_num, struct arg_type_info *info)
+gimme_arg(enum tof type, struct process *proc, int arg_num,
+ struct arg_type_info *info)
{
long ret;
long addr;
diff --git a/sysdeps/linux-gnu/ppc/fetch.c b/sysdeps/linux-gnu/ppc/fetch.c
index 9963a1e..ed38336 100644
--- a/sysdeps/linux-gnu/ppc/fetch.c
+++ b/sysdeps/linux-gnu/ppc/fetch.c
@@ -31,7 +31,7 @@
#include "proc.h"
#include "value.h"
-static int allocate_gpr(struct fetch_context *ctx, struct Process *proc,
+static int allocate_gpr(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep);
/* Floating point registers have the same width on 32-bit as well as
@@ -66,7 +66,7 @@ struct fetch_context {
};
static int
-fetch_context_init(struct Process *proc, struct fetch_context *context)
+fetch_context_init(struct process *proc, struct fetch_context *context)
{
context->greg = 3;
context->freg = 1;
@@ -108,7 +108,7 @@ fetch_context_init(struct Process *proc, struct fetch_context *context)
}
struct fetch_context *
-arch_fetch_arg_init(enum tof type, struct Process *proc,
+arch_fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info)
{
struct fetch_context *context = malloc(sizeof(*context));
@@ -132,7 +132,7 @@ arch_fetch_arg_init(enum tof type, struct Process *proc,
}
struct fetch_context *
-arch_fetch_arg_clone(struct Process *proc,
+arch_fetch_arg_clone(struct process *proc,
struct fetch_context *context)
{
struct fetch_context *clone = malloc(sizeof(*context));
@@ -143,7 +143,7 @@ arch_fetch_arg_clone(struct Process *proc,
}
static int
-allocate_stack_slot(struct fetch_context *ctx, struct Process *proc,
+allocate_stack_slot(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
size_t sz = type_sizeof(proc, info);
@@ -170,7 +170,7 @@ allocate_stack_slot(struct fetch_context *ctx, struct Process *proc,
}
static uint64_t
-read_gpr(struct fetch_context *ctx, struct Process *proc, int reg_num)
+read_gpr(struct fetch_context *ctx, struct process *proc, int reg_num)
{
if (proc->e_machine == EM_PPC)
return ctx->regs.r32[reg_num];
@@ -215,7 +215,7 @@ align_small_int(unsigned char *buf, size_t w, size_t sz)
}
static int
-allocate_gpr(struct fetch_context *ctx, struct Process *proc,
+allocate_gpr(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
if (ctx->greg > 10)
@@ -245,7 +245,7 @@ allocate_gpr(struct fetch_context *ctx, struct Process *proc,
}
static int
-allocate_float(struct fetch_context *ctx, struct Process *proc,
+allocate_float(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
int pool = proc->e_machine == EM_PPC64 ? 13 : 8;
@@ -276,7 +276,7 @@ allocate_float(struct fetch_context *ctx, struct Process *proc,
}
static int
-allocate_argument(struct fetch_context *ctx, struct Process *proc,
+allocate_argument(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
/* Floating point types and void are handled specially. */
@@ -400,7 +400,7 @@ allocate_argument(struct fetch_context *ctx, struct Process *proc,
int
arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
return allocate_argument(ctx, proc, info, valuep);
@@ -408,7 +408,7 @@ arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
int
arch_fetch_retval(struct fetch_context *ctx, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
if (ctx->ret_struct) {
diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
index f83f087..e49d30e 100644
--- a/sysdeps/linux-gnu/ppc/plt.c
+++ b/sysdeps/linux-gnu/ppc/plt.c
@@ -126,7 +126,7 @@ host_powerpc64()
}
int
-read_target_4(struct Process *proc, arch_addr_t addr, uint32_t *lp)
+read_target_4(struct process *proc, arch_addr_t addr, uint32_t *lp)
{
unsigned long l = ptrace(PTRACE_PEEKTEXT, proc->pid, addr, 0);
if (l == -1UL && errno)
@@ -139,7 +139,7 @@ read_target_4(struct Process *proc, arch_addr_t addr, uint32_t *lp)
}
static int
-read_target_8(struct Process *proc, arch_addr_t addr, uint64_t *lp)
+read_target_8(struct process *proc, arch_addr_t addr, uint64_t *lp)
{
unsigned long l = ptrace(PTRACE_PEEKTEXT, proc->pid, addr, 0);
if (l == -1UL && errno)
@@ -157,7 +157,7 @@ read_target_8(struct Process *proc, arch_addr_t addr, uint64_t *lp)
}
int
-read_target_long(struct Process *proc, arch_addr_t addr, uint64_t *lp)
+read_target_long(struct process *proc, arch_addr_t addr, uint64_t *lp)
{
if (proc->e_machine == EM_PPC) {
uint32_t w;
@@ -178,7 +178,7 @@ mark_as_resolved(struct library_symbol *libsym, GElf_Addr value)
}
void
-arch_dynlink_done(struct Process *proc)
+arch_dynlink_done(struct process *proc)
{
/* On PPC32 with BSS PLT, we need to enable delayed symbols. */
struct library_symbol *libsym = NULL;
@@ -258,7 +258,7 @@ arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela *rela)
* ourselves with bias, as the values in OPD have been resolved
* already. */
int
-arch_translate_address_dyn(struct Process *proc,
+arch_translate_address_dyn(struct process *proc,
arch_addr_t addr, arch_addr_t *ret)
{
if (proc->e_machine == EM_PPC64) {
@@ -324,7 +324,7 @@ load_opd_data(struct ltelf *lte, struct library *lib)
}
void *
-sym2addr(struct Process *proc, struct library_symbol *sym)
+sym2addr(struct process *proc, struct library_symbol *sym)
{
return sym->enter_addr;
}
@@ -560,7 +560,7 @@ arch_elf_init(struct ltelf *lte, struct library *lib)
}
static int
-read_plt_slot_value(struct Process *proc, GElf_Addr addr, GElf_Addr *valp)
+read_plt_slot_value(struct process *proc, GElf_Addr addr, GElf_Addr *valp)
{
/* On PPC64, we read from .plt, which contains 8 byte
* addresses. On PPC32 we read from .plt, which contains 4
@@ -579,7 +579,7 @@ read_plt_slot_value(struct Process *proc, GElf_Addr addr, GElf_Addr *valp)
}
static int
-unresolve_plt_slot(struct Process *proc, GElf_Addr addr, GElf_Addr value)
+unresolve_plt_slot(struct process *proc, GElf_Addr addr, GElf_Addr value)
{
/* We only modify plt_entry[0], which holds the resolved
* address of the routine. We keep the TOC and environment
@@ -594,7 +594,7 @@ unresolve_plt_slot(struct Process *proc, GElf_Addr addr, GElf_Addr value)
}
enum plt_status
-arch_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
+arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
const char *a_name, GElf_Rela *rela, size_t ndx,
struct library_symbol **ret)
{
@@ -712,7 +712,7 @@ arch_elf_destroy(struct ltelf *lte)
}
static void
-dl_plt_update_bp_on_hit(struct breakpoint *bp, struct Process *proc)
+dl_plt_update_bp_on_hit(struct breakpoint *bp, struct process *proc)
{
debug(DEBUG_PROCESS, "pid=%d dl_plt_update_bp_on_hit %s(%p)",
proc->pid, breakpoint_name(bp), bp->addr);
@@ -752,7 +752,7 @@ cb_on_all_stopped(struct process_stopping_handler *self)
static enum callback_status
cb_keep_stepping_p(struct process_stopping_handler *self)
{
- struct Process *proc = self->task_enabling_breakpoint;
+ struct process *proc = self->task_enabling_breakpoint;
struct library_symbol *libsym = self->breakpoint_being_enabled->libsym;
GElf_Addr value;
@@ -799,7 +799,7 @@ cb_keep_stepping_p(struct process_stopping_handler *self)
/* Install breakpoint to the address where the change takes
* place. If we fail, then that just means that we'll have to
* singlestep the next time around as well. */
- struct Process *leader = proc->leader;
+ struct process *leader = proc->leader;
if (leader == NULL || leader->arch.dl_plt_update_bp != NULL)
goto done;
@@ -827,7 +827,7 @@ done:
}
static void
-jump_to_entry_point(struct Process *proc, struct breakpoint *bp)
+jump_to_entry_point(struct process *proc, struct breakpoint *bp)
{
/* XXX The double cast should be removed when
* arch_addr_t becomes integral type. */
@@ -837,10 +837,10 @@ jump_to_entry_point(struct Process *proc, struct breakpoint *bp)
}
static void
-ppc_plt_bp_continue(struct breakpoint *bp, struct Process *proc)
+ppc_plt_bp_continue(struct breakpoint *bp, struct process *proc)
{
switch (bp->libsym->arch.type) {
- struct Process *leader;
+ struct process *leader;
void (*on_all_stopped)(struct process_stopping_handler *);
enum callback_status (*keep_stepping_p)
(struct process_stopping_handler *);
@@ -899,7 +899,7 @@ ppc_plt_bp_continue(struct breakpoint *bp, struct Process *proc)
* detect both cases and do any fix-ups necessary to mend this
* situation. */
static enum callback_status
-detach_task_cb(struct Process *task, void *data)
+detach_task_cb(struct process *task, void *data)
{
struct breakpoint *bp = data;
@@ -919,7 +919,7 @@ detach_task_cb(struct Process *task, void *data)
}
static void
-ppc_plt_bp_retract(struct breakpoint *bp, struct Process *proc)
+ppc_plt_bp_retract(struct breakpoint *bp, struct process *proc)
{
/* On PPC64, we rewrite .plt with PLT entry addresses. This
* needs to be undone. Unfortunately, the program may have
@@ -975,7 +975,7 @@ arch_library_symbol_clone(struct library_symbol *retp,
* don't need PROC here, we can store the data in BP if it is of
* interest to us. */
int
-arch_breakpoint_init(struct Process *proc, struct breakpoint *bp)
+arch_breakpoint_init(struct process *proc, struct breakpoint *bp)
{
/* Artificial and entry-point breakpoints are plain. */
if (bp->libsym == NULL || bp->libsym->plt_type != LS_TOPLT_EXEC)
@@ -1012,7 +1012,7 @@ arch_breakpoint_clone(struct breakpoint *retp, struct breakpoint *sbp)
}
int
-arch_process_init(struct Process *proc)
+arch_process_init(struct process *proc)
{
proc->arch.dl_plt_update_bp = NULL;
proc->arch.handler = NULL;
@@ -1020,19 +1020,19 @@ arch_process_init(struct Process *proc)
}
void
-arch_process_destroy(struct Process *proc)
+arch_process_destroy(struct process *proc)
{
}
int
-arch_process_clone(struct Process *retp, struct Process *proc)
+arch_process_clone(struct process *retp, struct process *proc)
{
retp->arch = proc->arch;
return 0;
}
int
-arch_process_exec(struct Process *proc)
+arch_process_exec(struct process *proc)
{
return arch_process_init(proc);
}
diff --git a/sysdeps/linux-gnu/ppc/regs.c b/sysdeps/linux-gnu/ppc/regs.c
index 37f89a4..ed9b398 100644
--- a/sysdeps/linux-gnu/ppc/regs.c
+++ b/sysdeps/linux-gnu/ppc/regs.c
@@ -40,35 +40,32 @@
#endif
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*PT_NIP, 0);
}
void
-set_instruction_pointer(Process *proc, void *addr)
+set_instruction_pointer(struct process *proc, void *addr)
{
if (ptrace(PTRACE_POKEUSER, proc->pid, sizeof(long)*PT_NIP, addr) != 0)
error(0, errno, "set_instruction_pointer");
}
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*PT_R1, 0);
}
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*PT_LNK, 0);
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, sizeof(long)*PT_LNK, addr);
}
-
-/* Grab the value of CTR registers. */
-void *
-get_count_register (Process *proc) {
- return (void *) ptrace (PTRACE_PEEKUSER, proc->pid,
- sizeof (long) * PT_CTR, 0);
-}
diff --git a/sysdeps/linux-gnu/ppc/trace.c b/sysdeps/linux-gnu/ppc/trace.c
index 4357a1e..d1c28e8 100644
--- a/sysdeps/linux-gnu/ppc/trace.c
+++ b/sysdeps/linux-gnu/ppc/trace.c
@@ -49,7 +49,8 @@
#endif
void
-get_arch_dep(Process *proc) {
+get_arch_dep(struct process *proc)
+{
#ifdef __powerpc64__
proc->mask_32bit = (proc->e_machine == EM_PPC);
#endif
@@ -59,7 +60,8 @@ get_arch_dep(Process *proc) {
/* Returns 1 if syscall, 2 if sysret, 0 otherwise. */
int
-syscall_p(Process *proc, int status, int *sysnum) {
+syscall_p(struct process *proc, int status, int *sysnum)
+{
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
long pc = (long)get_instruction_pointer(proc);
@@ -85,10 +87,10 @@ syscall_p(Process *proc, int status, int *sysnum) {
/* The atomic skip code is mostly taken from GDB. */
/* In plt.h. XXX make this official interface. */
-int read_target_4(struct Process *proc, arch_addr_t addr, uint32_t *lp);
+int read_target_4(struct process *proc, arch_addr_t addr, uint32_t *lp);
int
-arch_atomic_singlestep(struct Process *proc, struct breakpoint *sbp,
+arch_atomic_singlestep(struct process *proc, struct breakpoint *sbp,
int (*add_cb)(void *addr, void *data),
void *add_cb_data)
{
@@ -172,7 +174,7 @@ arch_atomic_singlestep(struct Process *proc, struct breakpoint *sbp,
}
size_t
-arch_type_sizeof(struct Process *proc, struct arg_type_info *info)
+arch_type_sizeof(struct process *proc, struct arg_type_info *info)
{
if (proc == NULL)
return (size_t)-2;
@@ -215,7 +217,7 @@ arch_type_sizeof(struct Process *proc, struct arg_type_info *info)
}
size_t
-arch_type_alignof(struct Process *proc, struct arg_type_info *info)
+arch_type_alignof(struct process *proc, struct arg_type_info *info)
{
if (proc == NULL)
return (size_t)-2;
diff --git a/sysdeps/linux-gnu/proc.c b/sysdeps/linux-gnu/proc.c
index 5adfb16..9f6ef2c 100644
--- a/sysdeps/linux-gnu/proc.c
+++ b/sysdeps/linux-gnu/proc.c
@@ -279,7 +279,7 @@ process_tasks(pid_t pid, pid_t **ret_tasks, size_t *ret_n)
* ABI object, as theorized about somewhere on pmachata/revamp
* branch. */
static void *
-select_32_64(struct Process *proc, void *p32, void *p64)
+select_32_64(struct process *proc, void *p32, void *p64)
{
if (sizeof(long) == 4 || proc->mask_32bit)
return p32;
@@ -288,7 +288,7 @@ select_32_64(struct Process *proc, void *p32, void *p64)
}
static int
-fetch_dyn64(struct Process *proc, arch_addr_t *addr, Elf64_Dyn *ret)
+fetch_dyn64(struct process *proc, arch_addr_t *addr, Elf64_Dyn *ret)
{
if (umovebytes(proc, *addr, ret, sizeof(*ret)) != sizeof(*ret))
return -1;
@@ -297,7 +297,7 @@ fetch_dyn64(struct Process *proc, arch_addr_t *addr, Elf64_Dyn *ret)
}
static int
-fetch_dyn32(struct Process *proc, arch_addr_t *addr, Elf64_Dyn *ret)
+fetch_dyn32(struct process *proc, arch_addr_t *addr, Elf64_Dyn *ret)
{
Elf32_Dyn dyn;
if (umovebytes(proc, *addr, &dyn, sizeof(dyn)) != sizeof(dyn))
@@ -311,14 +311,14 @@ fetch_dyn32(struct Process *proc, arch_addr_t *addr, Elf64_Dyn *ret)
}
static int (*
-dyn_fetcher(struct Process *proc))(struct Process *,
+dyn_fetcher(struct process *proc))(struct process *,
arch_addr_t *, Elf64_Dyn *)
{
return select_32_64(proc, fetch_dyn32, fetch_dyn64);
}
int
-proc_find_dynamic_entry_addr(struct Process *proc, arch_addr_t src_addr,
+proc_find_dynamic_entry_addr(struct process *proc, arch_addr_t src_addr,
int d_tag, arch_addr_t *ret)
{
debug(DEBUG_FUNCTION, "find_dynamic_entry()");
@@ -364,7 +364,7 @@ struct lt_link_map_32 LT_LINK_MAP(32);
struct lt_link_map_64 LT_LINK_MAP(64);
static int
-fetch_lm64(struct Process *proc, arch_addr_t addr,
+fetch_lm64(struct process *proc, arch_addr_t addr,
struct lt_link_map_64 *ret)
{
if (umovebytes(proc, addr, ret, sizeof(*ret)) != sizeof(*ret))
@@ -373,7 +373,7 @@ fetch_lm64(struct Process *proc, arch_addr_t addr,
}
static int
-fetch_lm32(struct Process *proc, arch_addr_t addr,
+fetch_lm32(struct process *proc, arch_addr_t addr,
struct lt_link_map_64 *ret)
{
struct lt_link_map_32 lm;
@@ -390,7 +390,7 @@ fetch_lm32(struct Process *proc, arch_addr_t addr,
}
static int (*
-lm_fetcher(struct Process *proc))(struct Process *,
+lm_fetcher(struct process *proc))(struct process *,
arch_addr_t, struct lt_link_map_64 *)
{
return select_32_64(proc, fetch_lm32, fetch_lm64);
@@ -410,7 +410,7 @@ struct lt_r_debug_32 LT_R_DEBUG(32);
struct lt_r_debug_64 LT_R_DEBUG(64);
static int
-fetch_rd64(struct Process *proc, arch_addr_t addr,
+fetch_rd64(struct process *proc, arch_addr_t addr,
struct lt_r_debug_64 *ret)
{
if (umovebytes(proc, addr, ret, sizeof(*ret)) != sizeof(*ret))
@@ -419,7 +419,7 @@ fetch_rd64(struct Process *proc, arch_addr_t addr,
}
static int
-fetch_rd32(struct Process *proc, arch_addr_t addr,
+fetch_rd32(struct process *proc, arch_addr_t addr,
struct lt_r_debug_64 *ret)
{
struct lt_r_debug_32 rd;
@@ -436,7 +436,7 @@ fetch_rd32(struct Process *proc, arch_addr_t addr,
}
static int (*
-rdebug_fetcher(struct Process *proc))(struct Process *,
+rdebug_fetcher(struct process *proc))(struct process *,
arch_addr_t, struct lt_r_debug_64 *)
{
return select_32_64(proc, fetch_rd32, fetch_rd64);
@@ -463,13 +463,13 @@ fetch_auxv32_entry(int fd, Elf64_auxv_t *ret)
}
static int (*
-auxv_fetcher(struct Process *proc))(int, Elf64_auxv_t *)
+auxv_fetcher(struct process *proc))(int, Elf64_auxv_t *)
{
return select_32_64(proc, fetch_auxv32_entry, fetch_auxv64_entry);
}
static void
-crawl_linkmap(struct Process *proc, struct lt_r_debug_64 *dbg)
+crawl_linkmap(struct process *proc, struct lt_r_debug_64 *dbg)
{
debug (DEBUG_FUNCTION, "crawl_linkmap()");
@@ -551,7 +551,7 @@ crawl_linkmap(struct Process *proc, struct lt_r_debug_64 *dbg)
}
static int
-load_debug_struct(struct Process *proc, struct lt_r_debug_64 *ret)
+load_debug_struct(struct process *proc, struct lt_r_debug_64 *ret)
{
debug(DEBUG_FUNCTION, "load_debug_struct");
@@ -564,7 +564,7 @@ load_debug_struct(struct Process *proc, struct lt_r_debug_64 *ret)
}
static void
-rdebug_bp_on_hit(struct breakpoint *bp, struct Process *proc)
+rdebug_bp_on_hit(struct breakpoint *bp, struct process *proc)
{
debug(DEBUG_FUNCTION, "arch_check_dbg");
@@ -595,7 +595,7 @@ rdebug_bp_on_hit(struct breakpoint *bp, struct Process *proc)
#ifndef ARCH_HAVE_FIND_DL_DEBUG
int
-arch_find_dl_debug(struct Process *proc, arch_addr_t dyn_addr,
+arch_find_dl_debug(struct process *proc, arch_addr_t dyn_addr,
arch_addr_t *ret)
{
return proc_find_dynamic_entry_addr(proc, dyn_addr, DT_DEBUG, ret);
@@ -603,7 +603,7 @@ arch_find_dl_debug(struct Process *proc, arch_addr_t dyn_addr,
#endif
int
-linkmap_init(struct Process *proc, arch_addr_t dyn_addr)
+linkmap_init(struct process *proc, arch_addr_t dyn_addr)
{
debug(DEBUG_FUNCTION, "linkmap_init(%d, dyn_addr=%p)", proc->pid, dyn_addr);
@@ -648,13 +648,13 @@ task_kill (pid_t pid, int sig)
}
void
-process_removed(struct Process *proc)
+process_removed(struct process *proc)
{
delete_events_for(proc);
}
int
-process_get_entry(struct Process *proc,
+process_get_entry(struct process *proc,
arch_addr_t *entryp,
arch_addr_t *interp_biasp)
{
@@ -706,7 +706,7 @@ process_get_entry(struct Process *proc,
}
int
-os_process_init(struct Process *proc)
+os_process_init(struct process *proc)
{
proc->os.debug_addr = 0;
proc->os.debug_state = 0;
@@ -714,19 +714,19 @@ os_process_init(struct Process *proc)
}
void
-os_process_destroy(struct Process *proc)
+os_process_destroy(struct process *proc)
{
}
int
-os_process_clone(struct Process *retp, struct Process *proc)
+os_process_clone(struct process *retp, struct process *proc)
{
retp->os = proc->os;
return 0;
}
int
-os_process_exec(struct Process *proc)
+os_process_exec(struct process *proc)
{
return 0;
}
diff --git a/sysdeps/linux-gnu/s390/fetch.c b/sysdeps/linux-gnu/s390/fetch.c
index fa8f42d..0b68dbc 100644
--- a/sysdeps/linux-gnu/s390/fetch.c
+++ b/sysdeps/linux-gnu/s390/fetch.c
@@ -61,7 +61,7 @@ s390x(struct fetch_context *ctx)
}
static int
-fetch_register_banks(struct Process *proc, struct fetch_context *ctx)
+fetch_register_banks(struct process *proc, struct fetch_context *ctx)
{
ptrace_area parea;
parea.len = sizeof(ctx->regs);
@@ -76,7 +76,7 @@ fetch_register_banks(struct Process *proc, struct fetch_context *ctx)
}
static int
-fetch_context_init(struct Process *proc, struct fetch_context *context)
+fetch_context_init(struct process *proc, struct fetch_context *context)
{
context->greg = 2;
context->freg = 0;
@@ -84,7 +84,7 @@ fetch_context_init(struct Process *proc, struct fetch_context *context)
}
struct fetch_context *
-arch_fetch_arg_init(enum tof type, struct Process *proc,
+arch_fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info)
{
struct fetch_context *context = malloc(sizeof(*context));
@@ -105,7 +105,7 @@ arch_fetch_arg_init(enum tof type, struct Process *proc,
}
struct fetch_context *
-arch_fetch_arg_clone(struct Process *proc,
+arch_fetch_arg_clone(struct process *proc,
struct fetch_context *context)
{
struct fetch_context *clone = malloc(sizeof(*context));
@@ -116,7 +116,7 @@ arch_fetch_arg_clone(struct Process *proc,
}
static int
-allocate_stack_slot(struct fetch_context *ctx, struct Process *proc,
+allocate_stack_slot(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep,
size_t sz)
{
@@ -148,7 +148,7 @@ copy_gpr(struct fetch_context *ctx, struct value *valuep, int regno)
}
static int
-allocate_gpr(struct fetch_context *ctx, struct Process *proc,
+allocate_gpr(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep,
size_t sz)
{
@@ -160,7 +160,7 @@ allocate_gpr(struct fetch_context *ctx, struct Process *proc,
}
static int
-allocate_gpr_pair(struct fetch_context *ctx, struct Process *proc,
+allocate_gpr_pair(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep,
size_t sz)
{
@@ -191,7 +191,7 @@ allocate_gpr_pair(struct fetch_context *ctx, struct Process *proc,
}
static int
-allocate_fpr(struct fetch_context *ctx, struct Process *proc,
+allocate_fpr(struct fetch_context *ctx, struct process *proc,
struct arg_type_info *info, struct value *valuep,
size_t sz)
{
@@ -212,7 +212,7 @@ allocate_fpr(struct fetch_context *ctx, struct Process *proc,
int
arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
- struct Process *proc,
+ struct process *proc,
struct arg_type_info *info, struct value *valuep)
{
size_t sz = type_sizeof(proc, info);
@@ -267,7 +267,7 @@ arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
int
arch_fetch_retval(struct fetch_context *ctx, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
if (info->type == ARGTYPE_STRUCT) {
diff --git a/sysdeps/linux-gnu/s390/plt.c b/sysdeps/linux-gnu/s390/plt.c
index 5f612e5..8893d45 100644
--- a/sysdeps/linux-gnu/s390/plt.c
+++ b/sysdeps/linux-gnu/s390/plt.c
@@ -29,6 +29,7 @@ arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
}
void *
-sym2addr(Process *proc, struct library_symbol *sym) {
+sym2addr(struct process *proc, struct library_symbol *sym)
+{
return sym->enter_addr;
}
diff --git a/sysdeps/linux-gnu/s390/regs.c b/sysdeps/linux-gnu/s390/regs.c
index 0592ccd..44e8f67 100644
--- a/sysdeps/linux-gnu/s390/regs.c
+++ b/sysdeps/linux-gnu/s390/regs.c
@@ -46,7 +46,8 @@
#endif
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_PSWADDR, 0) & PSW_MASK;
#ifdef __s390x__
if (proc->mask_32bit)
@@ -56,7 +57,8 @@ get_instruction_pointer(Process *proc) {
}
void
-set_instruction_pointer(Process *proc, void *addr) {
+set_instruction_pointer(struct process *proc, void *addr)
+{
#ifdef __s390x__
if (proc->mask_32bit)
addr = (void *)((long)addr & PSW_MASK31);
@@ -65,7 +67,8 @@ set_instruction_pointer(Process *proc, void *addr) {
}
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR15, 0) & PSW_MASK;
#ifdef __s390x__
if (proc->mask_32bit)
@@ -75,7 +78,8 @@ get_stack_pointer(Process *proc) {
}
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR14, 0) & PSW_MASK;
#ifdef __s390x__
if (proc->mask_32bit)
@@ -85,7 +89,8 @@ get_return_addr(Process *proc, void *stack_pointer) {
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
#ifdef __s390x__
if (proc->mask_32bit)
addr = (void *)((long)addr & PSW_MASK31);
diff --git a/sysdeps/linux-gnu/s390/trace.c b/sysdeps/linux-gnu/s390/trace.c
index b9e05ff..78b04c3 100644
--- a/sysdeps/linux-gnu/s390/trace.c
+++ b/sysdeps/linux-gnu/s390/trace.c
@@ -43,7 +43,8 @@
#endif
void
-get_arch_dep(Process *proc) {
+get_arch_dep(struct process *proc)
+{
#ifdef __s390x__
unsigned long psw;
@@ -64,7 +65,8 @@ get_arch_dep(Process *proc) {
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
int
-syscall_p(Process *proc, int status, int *sysnum) {
+syscall_p(struct process *proc, int status, int *sysnum)
+{
long pc, opcode, offset_reg, scno, tmp;
void *svc_addr;
int gpr_offset[16] = { PT_GPR0, PT_GPR1, PT_ORIGGPR2, PT_GPR3,
@@ -175,7 +177,7 @@ syscall_p(Process *proc, int status, int *sysnum) {
}
size_t
-arch_type_sizeof(struct Process *proc, struct arg_type_info *info)
+arch_type_sizeof(struct process *proc, struct arg_type_info *info)
{
if (proc == NULL)
return (size_t)-2;
@@ -217,7 +219,7 @@ arch_type_sizeof(struct Process *proc, struct arg_type_info *info)
}
size_t
-arch_type_alignof(struct Process *proc, struct arg_type_info *info)
+arch_type_alignof(struct process *proc, struct arg_type_info *info)
{
if (proc == NULL)
return (size_t)-2;
diff --git a/sysdeps/linux-gnu/sparc/plt.c b/sysdeps/linux-gnu/sparc/plt.c
index 40bbabc..3d2e589 100644
--- a/sysdeps/linux-gnu/sparc/plt.c
+++ b/sysdeps/linux-gnu/sparc/plt.c
@@ -28,6 +28,7 @@ arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
}
void *
-sym2addr(Process *proc, struct library_symbol *sym) {
+sym2addr(struct process *proc, struct library_symbol *sym)
+{
return sym->enter_addr;
}
diff --git a/sysdeps/linux-gnu/sparc/regs.c b/sysdeps/linux-gnu/sparc/regs.c
index 5e5ad20..8431c9b 100644
--- a/sysdeps/linux-gnu/sparc/regs.c
+++ b/sysdeps/linux-gnu/sparc/regs.c
@@ -27,7 +27,8 @@
#include "common.h"
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
if (a->valid)
return (void *)a->regs.pc;
@@ -35,14 +36,16 @@ get_instruction_pointer(Process *proc) {
}
void
-set_instruction_pointer(Process *proc, void *addr) {
+set_instruction_pointer(struct process *proc, void *addr)
+{
proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
if (a->valid)
a->regs.pc = (long)addr;
}
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
if (a->valid)
return (void *)a->regs.u_regs[UREG_I5];
@@ -50,7 +53,8 @@ get_stack_pointer(Process *proc) {
}
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
unsigned int t;
if (!a->valid)
@@ -63,7 +67,8 @@ get_return_addr(Process *proc, void *stack_pointer) {
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
if (!a->valid)
return;
diff --git a/sysdeps/linux-gnu/sparc/trace.c b/sysdeps/linux-gnu/sparc/trace.c
index e1725ff..078d406 100644
--- a/sysdeps/linux-gnu/sparc/trace.c
+++ b/sysdeps/linux-gnu/sparc/trace.c
@@ -31,7 +31,8 @@
#include "common.h"
void
-get_arch_dep(Process *proc) {
+get_arch_dep(struct process *proc)
+{
proc_archdep *a;
if (!proc->arch_ptr)
proc->arch_ptr = (void *)malloc(sizeof(proc_archdep));
@@ -43,7 +44,8 @@ get_arch_dep(Process *proc) {
* Returns -1 otherwise
*/
int
-syscall_p(Process *proc, int status, int *sysnum) {
+syscall_p(struct process *proc, int status, int *sysnum)
+{
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
void *ip = get_instruction_pointer(proc);
@@ -66,7 +68,8 @@ syscall_p(Process *proc, int status, int *sysnum) {
}
long
-gimme_arg(enum tof type, Process *proc, int arg_num, struct arg_type_info *info)
+gimme_arg(enum tof type, struct process *proc, int arg_num,
+ struct arg_type_info *info)
{
proc_archdep *a = (proc_archdep *) proc->arch_ptr;
if (!a->valid) {
diff --git a/sysdeps/linux-gnu/trace.c b/sysdeps/linux-gnu/trace.c
index e13b761..77dfade 100644
--- a/sysdeps/linux-gnu/trace.c
+++ b/sysdeps/linux-gnu/trace.c
@@ -111,7 +111,7 @@ trace_pid(pid_t pid)
}
void
-trace_set_options(struct Process *proc)
+trace_set_options(struct process *proc)
{
if (proc->tracesysgood & 0x80)
return;
@@ -206,7 +206,7 @@ add_task_info(struct pid_set *pids, pid_t pid)
}
static enum callback_status
-task_stopped(struct Process *task, void *data)
+task_stopped(struct process *task, void *data)
{
enum process_status st = process_status(task->pid);
if (data != NULL)
@@ -232,7 +232,7 @@ task_stopped(struct Process *task, void *data)
/* Task is blocked if it's stopped, or if it's a vfork parent. */
static enum callback_status
-task_blocked(struct Process *task, void *data)
+task_blocked(struct process *task, void *data)
{
struct pid_set *pids = data;
struct pid_task *task_info = get_task_info(pids, task->pid);
@@ -246,7 +246,7 @@ task_blocked(struct Process *task, void *data)
static Event *process_vfork_on_event(struct event_handler *super, Event *event);
static enum callback_status
-task_vforked(struct Process *task, void *data)
+task_vforked(struct process *task, void *data)
{
if (task->event_handler != NULL
&& task->event_handler->on_event == &process_vfork_on_event)
@@ -255,15 +255,15 @@ task_vforked(struct Process *task, void *data)
}
static int
-is_vfork_parent(struct Process *task)
+is_vfork_parent(struct process *task)
{
return each_task(task->leader, NULL, &task_vforked, NULL) != NULL;
}
static enum callback_status
-send_sigstop(struct Process *task, void *data)
+send_sigstop(struct process *task, void *data)
{
- struct Process *leader = task->leader;
+ struct process *leader = task->leader;
struct pid_set *pids = data;
/* Look for pre-existing task record, or add new. */
@@ -321,7 +321,7 @@ send_sigstop(struct Process *task, void *data)
breakpoint where IP points and let the process continue. After
this the breakpoint can be retracted and the process detached. */
static void
-ugly_workaround(struct Process *proc)
+ugly_workaround(struct process *proc)
{
void *ip = get_instruction_pointer(proc);
struct breakpoint *sbp = dict_find_entry(proc->leader->breakpoints, ip);
@@ -334,7 +334,7 @@ ugly_workaround(struct Process *proc)
static void
process_stopping_done(struct process_stopping_handler *self,
- struct Process *leader)
+ struct process *leader)
{
debug(DEBUG_PROCESS, "process stopping done %d",
self->task_enabling_breakpoint->pid);
@@ -381,7 +381,7 @@ undo_breakpoint(Event *event, void *data)
}
static enum callback_status
-untrace_task(struct Process *task, void *data)
+untrace_task(struct process *task, void *data)
{
if (task != data)
untrace_pid(task->pid);
@@ -389,7 +389,7 @@ untrace_task(struct Process *task, void *data)
}
static enum callback_status
-remove_task(struct Process *task, void *data)
+remove_task(struct process *task, void *data)
{
/* Don't untrace leader just yet. */
if (task != data)
@@ -398,14 +398,14 @@ remove_task(struct Process *task, void *data)
}
static enum callback_status
-retract_breakpoint_cb(struct Process *proc, struct breakpoint *bp, void *data)
+retract_breakpoint_cb(struct process *proc, struct breakpoint *bp, void *data)
{
breakpoint_on_retract(bp, proc);
return CBS_CONT;
}
static void
-detach_process(struct Process *leader)
+detach_process(struct process *leader)
{
each_qd_event(&undo_breakpoint, leader);
disable_all_breakpoints(leader);
@@ -414,7 +414,7 @@ detach_process(struct Process *leader)
/* Now untrace the process, if it was attached to by -p. */
struct opt_p_t *it;
for (it = opt_p; it != NULL; it = it->next) {
- struct Process *proc = pid2proc(it->pid);
+ struct process *proc = pid2proc(it->pid);
if (proc == NULL)
continue;
if (proc->leader == leader) {
@@ -542,13 +542,13 @@ all_stops_accountable(struct pid_set *pids)
/* The protocol is: 0 for success, negative for failure, positive if
* default singlestep is to be used. */
-int arch_atomic_singlestep(struct Process *proc, struct breakpoint *sbp,
+int arch_atomic_singlestep(struct process *proc, struct breakpoint *sbp,
int (*add_cb)(void *addr, void *data),
void *add_cb_data);
#ifndef ARCH_HAVE_ATOMIC_SINGLESTEP
int
-arch_atomic_singlestep(struct Process *proc, struct breakpoint *sbp,
+arch_atomic_singlestep(struct process *proc, struct breakpoint *sbp,
int (*add_cb)(void *addr, void *data),
void *add_cb_data)
{
@@ -560,7 +560,7 @@ static Event *process_stopping_on_event(struct event_handler *super,
Event *event);
static void
-remove_atomic_breakpoints(struct Process *proc)
+remove_atomic_breakpoints(struct process *proc)
{
struct process_stopping_handler *self
= (void *)proc->leader->event_handler;
@@ -578,7 +578,7 @@ remove_atomic_breakpoints(struct Process *proc)
}
static void
-atomic_singlestep_bp_on_hit(struct breakpoint *bp, struct Process *proc)
+atomic_singlestep_bp_on_hit(struct breakpoint *bp, struct process *proc)
{
remove_atomic_breakpoints(proc);
}
@@ -587,7 +587,7 @@ static int
atomic_singlestep_add_bp(void *addr, void *data)
{
struct process_stopping_handler *self = data;
- struct Process *proc = self->task_enabling_breakpoint;
+ struct process *proc = self->task_enabling_breakpoint;
int ct = sizeof(self->atomic_skip_bp_addrs)
/ sizeof(*self->atomic_skip_bp_addrs);
@@ -611,7 +611,7 @@ atomic_singlestep_add_bp(void *addr, void *data)
static int
singlestep(struct process_stopping_handler *self)
{
- struct Process *proc = self->task_enabling_breakpoint;
+ struct process *proc = self->task_enabling_breakpoint;
int status = arch_atomic_singlestep(self->task_enabling_breakpoint,
self->breakpoint_being_enabled,
@@ -639,7 +639,7 @@ post_singlestep(struct process_stopping_handler *self,
if (*eventp != NULL && (*eventp)->type == EVENT_BREAKPOINT)
*eventp = NULL; // handled
- struct Process *proc = self->task_enabling_breakpoint;
+ struct process *proc = self->task_enabling_breakpoint;
remove_atomic_breakpoints(proc);
self->breakpoint_being_enabled = NULL;
@@ -648,7 +648,7 @@ post_singlestep(struct process_stopping_handler *self,
static void
singlestep_error(struct process_stopping_handler *self)
{
- struct Process *teb = self->task_enabling_breakpoint;
+ struct process *teb = self->task_enabling_breakpoint;
struct breakpoint *sbp = self->breakpoint_being_enabled;
fprintf(stderr, "%d couldn't continue when handling %s (%p) at %p\n",
teb->pid, breakpoint_name(sbp), sbp->addr,
@@ -659,7 +659,7 @@ singlestep_error(struct process_stopping_handler *self)
static void
pt_continue(struct process_stopping_handler *self)
{
- struct Process *teb = self->task_enabling_breakpoint;
+ struct process *teb = self->task_enabling_breakpoint;
debug(1, "PTRACE_CONT");
ptrace(PTRACE_CONT, teb->pid, 0, 0);
}
@@ -675,7 +675,7 @@ static void
disable_and(struct process_stopping_handler *self,
void (*do_this)(struct process_stopping_handler *self))
{
- struct Process *teb = self->task_enabling_breakpoint;
+ struct process *teb = self->task_enabling_breakpoint;
debug(DEBUG_PROCESS, "all stopped, now singlestep/cont %d", teb->pid);
if (self->breakpoint_being_enabled->enabled)
disable_breakpoint(teb, self->breakpoint_being_enabled);
@@ -705,9 +705,9 @@ static Event *
process_stopping_on_event(struct event_handler *super, Event *event)
{
struct process_stopping_handler *self = (void *)super;
- struct Process *task = event->proc;
- struct Process *leader = task->leader;
- struct Process *teb = self->task_enabling_breakpoint;
+ struct process *task = event->proc;
+ struct process *leader = task->leader;
+ struct process *teb = self->task_enabling_breakpoint;
debug(DEBUG_PROCESS,
"process_stopping_on_event: pid %d; event type %d; state %d",
@@ -845,7 +845,7 @@ no(struct process_stopping_handler *self)
}
int
-process_install_stopping_handler(struct Process *proc, struct breakpoint *sbp,
+process_install_stopping_handler(struct process *proc, struct breakpoint *sbp,
void (*as)(struct process_stopping_handler *),
enum callback_status (*ks)
(struct process_stopping_handler *),
@@ -894,7 +894,7 @@ process_install_stopping_handler(struct Process *proc, struct breakpoint *sbp,
}
void
-continue_after_breakpoint(Process *proc, struct breakpoint *sbp)
+continue_after_breakpoint(struct process *proc, struct breakpoint *sbp)
{
debug(DEBUG_PROCESS,
"continue_after_breakpoint: pid=%d, addr=%p",
@@ -937,8 +937,8 @@ static Event *
ltrace_exiting_on_event(struct event_handler *super, Event *event)
{
struct ltrace_exiting_handler *self = (void *)super;
- struct Process *task = event->proc;
- struct Process *leader = task->leader;
+ struct process *task = event->proc;
+ struct process *leader = task->leader;
debug(DEBUG_PROCESS,
"ltrace_exiting_on_event: pid %d; event type %d",
@@ -970,7 +970,7 @@ ltrace_exiting_destroy(struct event_handler *super)
}
static int
-ltrace_exiting_install_handler(struct Process *proc)
+ltrace_exiting_install_handler(struct process *proc)
{
/* Only install to leader. */
if (proc->leader != proc)
@@ -1087,7 +1087,7 @@ process_vfork_on_event(struct event_handler *super, Event *event)
}
void
-continue_after_vfork(struct Process *proc)
+continue_after_vfork(struct process *proc)
{
debug(DEBUG_PROCESS, "continue_after_vfork: pid=%d", proc->pid);
struct process_vfork_handler *handler = calloc(sizeof(*handler), 1);
@@ -1116,7 +1116,7 @@ continue_after_vfork(struct Process *proc)
}
static int
-is_mid_stopping(Process *proc)
+is_mid_stopping(struct process *proc)
{
return proc != NULL
&& proc->event_handler != NULL
@@ -1124,7 +1124,7 @@ is_mid_stopping(Process *proc)
}
void
-continue_after_syscall(struct Process *proc, int sysnum, int ret_p)
+continue_after_syscall(struct process *proc, int sysnum, int ret_p)
{
/* Don't continue if we are mid-stopping. */
if (ret_p && (is_mid_stopping(proc) || is_mid_stopping(proc->leader))) {
@@ -1152,7 +1152,7 @@ os_ltrace_exiting(void)
{
struct opt_p_t *it;
for (it = opt_p; it != NULL; it = it->next) {
- struct Process *proc = pid2proc(it->pid);
+ struct process *proc = pid2proc(it->pid);
if (proc == NULL || proc->leader == NULL)
continue;
if (ltrace_exiting_install_handler(proc->leader) < 0)
@@ -1174,7 +1174,8 @@ os_ltrace_exiting_sighandler(void)
}
size_t
-umovebytes(Process *proc, void *addr, void *laddr, size_t len) {
+umovebytes(struct process *proc, void *addr, void *laddr, size_t len)
+{
union {
long a;
diff --git a/sysdeps/linux-gnu/trace.h b/sysdeps/linux-gnu/trace.h
index 88ac33d..7060af4 100644
--- a/sysdeps/linux-gnu/trace.h
+++ b/sysdeps/linux-gnu/trace.h
@@ -59,7 +59,7 @@ struct process_stopping_handler
struct event_handler super;
/* The task that is doing the re-enablement. */
- struct Process *task_enabling_breakpoint;
+ struct process *task_enabling_breakpoint;
/* The pointer being re-enabled. */
struct breakpoint *breakpoint_being_enabled;
@@ -108,7 +108,7 @@ struct process_stopping_handler
* ON_ALL_STOPPED is LINUX_PTRACE_DISABLE_AND_SINGLESTEP, the default
* for KEEP_STEPPING_P and UGLY_WORKAROUND_P is "no". */
int process_install_stopping_handler
- (struct Process *proc, struct breakpoint *sbp,
+ (struct process *proc, struct breakpoint *sbp,
void (*on_all_stopped)(struct process_stopping_handler *),
enum callback_status (*keep_stepping_p)
(struct process_stopping_handler *),
diff --git a/sysdeps/linux-gnu/x86/fetch.c b/sysdeps/linux-gnu/x86/fetch.c
index 4dab4cc..aa02a0a 100644
--- a/sysdeps/linux-gnu/x86/fetch.c
+++ b/sysdeps/linux-gnu/x86/fetch.c
@@ -323,13 +323,13 @@ allocate_class(enum arg_class cls, struct fetch_context *context,
}
static ssize_t
-classify(struct Process *proc, struct fetch_context *context,
+classify(struct process *proc, struct fetch_context *context,
struct arg_type_info *info, struct value *valuep, enum arg_class classes[],
size_t sz, size_t eightbytes);
/* This classifies one eightbyte part of an array or struct. */
static ssize_t
-classify_eightbyte(struct Process *proc, struct fetch_context *context,
+classify_eightbyte(struct process *proc, struct fetch_context *context,
struct arg_type_info *info, struct value *valuep,
enum arg_class *classp, size_t start, size_t end,
struct arg_type_info *(*getter)(struct arg_type_info *,
@@ -364,7 +364,7 @@ classify_eightbyte(struct Process *proc, struct fetch_context *context,
/* This classifies small arrays and structs. */
static ssize_t
-classify_eightbytes(struct Process *proc, struct fetch_context *context,
+classify_eightbytes(struct process *proc, struct fetch_context *context,
struct arg_type_info *info, struct value *valuep,
enum arg_class classes[], size_t elements,
size_t eightbytes,
@@ -432,7 +432,7 @@ flatten_structure(struct arg_type_info *flattened, struct arg_type_info *info)
}
static ssize_t
-classify(struct Process *proc, struct fetch_context *context,
+classify(struct process *proc, struct fetch_context *context,
struct arg_type_info *info, struct value *valuep, enum arg_class classes[],
size_t sz, size_t eightbytes)
{
@@ -517,7 +517,7 @@ pass_by_reference(struct value *valuep, enum arg_class classes[])
}
static ssize_t
-classify_argument(struct Process *proc, struct fetch_context *context,
+classify_argument(struct process *proc, struct fetch_context *context,
struct arg_type_info *info, struct value *valuep,
enum arg_class classes[], size_t *sizep)
{
@@ -545,7 +545,7 @@ classify_argument(struct Process *proc, struct fetch_context *context,
}
static int
-fetch_register_banks(struct Process *proc, struct fetch_context *context,
+fetch_register_banks(struct process *proc, struct fetch_context *context,
int floating)
{
if (ptrace(PTRACE_GETREGS, proc->pid, 0, &context->iregs) < 0)
@@ -566,7 +566,7 @@ fetch_register_banks(struct Process *proc, struct fetch_context *context,
static int
arch_fetch_arg_next_32(struct fetch_context *context, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
size_t sz = type_sizeof(proc, info);
@@ -580,7 +580,7 @@ arch_fetch_arg_next_32(struct fetch_context *context, enum tof type,
static int
arch_fetch_retval_32(struct fetch_context *context, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
if (fetch_register_banks(proc, context, type == LT_TOF_FUNCTIONR) < 0)
@@ -646,7 +646,7 @@ fetch_stack_pointer(struct fetch_context *context)
struct fetch_context *
arch_fetch_arg_init_32(struct fetch_context *context,
- enum tof type, struct Process *proc,
+ enum tof type, struct process *proc,
struct arg_type_info *ret_info)
{
context->stack_pointer = fetch_stack_pointer(context) + 4;
@@ -673,7 +673,7 @@ arch_fetch_arg_init_32(struct fetch_context *context,
struct fetch_context *
arch_fetch_arg_init_64(struct fetch_context *ctx, enum tof type,
- struct Process *proc, struct arg_type_info *ret_info)
+ struct process *proc, struct arg_type_info *ret_info)
{
/* The first stack slot holds a return address. */
ctx->stack_pointer = fetch_stack_pointer(ctx) + 8;
@@ -698,7 +698,7 @@ arch_fetch_arg_init_64(struct fetch_context *ctx, enum tof type,
}
struct fetch_context *
-arch_fetch_arg_init(enum tof type, struct Process *proc,
+arch_fetch_arg_init(enum tof type, struct process *proc,
struct arg_type_info *ret_info)
{
struct fetch_context *ctx = malloc(sizeof(*ctx));
@@ -724,7 +724,7 @@ arch_fetch_arg_init(enum tof type, struct Process *proc,
}
struct fetch_context *
-arch_fetch_arg_clone(struct Process *proc, struct fetch_context *context)
+arch_fetch_arg_clone(struct process *proc, struct fetch_context *context)
{
struct fetch_context *ret = malloc(sizeof(*ret));
if (ret == NULL)
@@ -734,7 +734,7 @@ arch_fetch_arg_clone(struct Process *proc, struct fetch_context *context)
static int
arch_fetch_pool_arg_next(struct fetch_context *context, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep, enum reg_pool pool)
{
enum arg_class classes[2];
@@ -776,7 +776,7 @@ arch_fetch_pool_arg_next(struct fetch_context *context, enum tof type,
int
arch_fetch_fun_retval(struct fetch_context *context, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
assert(type != LT_TOF_FUNCTION
@@ -808,7 +808,7 @@ arch_fetch_fun_retval(struct fetch_context *context, enum tof type,
int
arch_fetch_arg_next(struct fetch_context *context, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
if (proc->e_machine == EM_386)
@@ -832,7 +832,7 @@ arch_fetch_arg_next(struct fetch_context *context, enum tof type,
int
arch_fetch_retval(struct fetch_context *context, enum tof type,
- struct Process *proc, struct arg_type_info *info,
+ struct process *proc, struct arg_type_info *info,
struct value *valuep)
{
if (proc->e_machine == EM_386)
diff --git a/sysdeps/linux-gnu/x86/plt.c b/sysdeps/linux-gnu/x86/plt.c
index dc6f183..c2a4151 100644
--- a/sysdeps/linux-gnu/x86/plt.c
+++ b/sysdeps/linux-gnu/x86/plt.c
@@ -24,11 +24,13 @@
#include "library.h"
GElf_Addr
-arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
+arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
+{
return lte->plt_addr + (ndx + 1) * 16;
}
void *
-sym2addr(Process *proc, struct library_symbol *sym) {
+sym2addr(struct process *proc, struct library_symbol *sym)
+{
return sym->enter_addr;
}
diff --git a/sysdeps/linux-gnu/x86/regs.c b/sysdeps/linux-gnu/x86/regs.c
index ca6470b..3886e84 100644
--- a/sysdeps/linux-gnu/x86/regs.c
+++ b/sysdeps/linux-gnu/x86/regs.c
@@ -56,7 +56,7 @@ conv_32(arch_addr_t val)
}
void *
-get_instruction_pointer(struct Process *proc)
+get_instruction_pointer(struct process *proc)
{
long int ret = ptrace(PTRACE_PEEKUSER, proc->pid, XIP, 0);
if (proc->e_machine == EM_386)
@@ -65,7 +65,7 @@ get_instruction_pointer(struct Process *proc)
}
void
-set_instruction_pointer(struct Process *proc, arch_addr_t addr)
+set_instruction_pointer(struct process *proc, arch_addr_t addr)
{
if (proc->e_machine == EM_386)
addr = conv_32(addr);
@@ -73,7 +73,7 @@ set_instruction_pointer(struct Process *proc, arch_addr_t addr)
}
void *
-get_stack_pointer(struct Process *proc)
+get_stack_pointer(struct process *proc)
{
long sp = ptrace(PTRACE_PEEKUSER, proc->pid, XSP, 0);
if (sp == -1 && errno) {
@@ -91,7 +91,7 @@ get_stack_pointer(struct Process *proc)
}
void *
-get_return_addr(struct Process *proc, void *sp)
+get_return_addr(struct process *proc, void *sp)
{
long a = ptrace(PTRACE_PEEKTEXT, proc->pid, sp, 0);
if (a == -1 && errno) {
@@ -109,7 +109,8 @@ get_return_addr(struct Process *proc, void *sp)
}
void
-set_return_addr(Process *proc, void *addr) {
+set_return_addr(struct process *proc, void *addr)
+{
if (proc->e_machine == EM_386)
addr = (void *)((long int)addr & 0xffffffff);
ptrace(PTRACE_POKETEXT, proc->pid, proc->stack_pointer, addr);
diff --git a/sysdeps/linux-gnu/x86/trace.c b/sysdeps/linux-gnu/x86/trace.c
index ed8bdb4..6a1a6a5 100644
--- a/sysdeps/linux-gnu/x86/trace.c
+++ b/sysdeps/linux-gnu/x86/trace.c
@@ -55,7 +55,7 @@ static const int x86_64 = 0;
#endif
void
-get_arch_dep(struct Process *proc)
+get_arch_dep(struct process *proc)
{
/* Unfortunately there are still remnants of mask_32bit uses
* around. */
@@ -75,7 +75,7 @@ get_arch_dep(struct Process *proc)
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
int
-syscall_p(struct Process *proc, int status, int *sysnum)
+syscall_p(struct process *proc, int status, int *sysnum)
{
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
@@ -109,7 +109,7 @@ syscall_p(struct Process *proc, int status, int *sysnum)
}
size_t
-arch_type_sizeof(struct Process *proc, struct arg_type_info *info)
+arch_type_sizeof(struct process *proc, struct arg_type_info *info)
{
if (proc == NULL)
return (size_t)-2;
@@ -151,7 +151,7 @@ arch_type_sizeof(struct Process *proc, struct arg_type_info *info)
}
size_t
-arch_type_alignof(struct Process *proc, struct arg_type_info *info)
+arch_type_alignof(struct process *proc, struct arg_type_info *info)
{
if (proc == NULL)
return (size_t)-2;
diff --git a/type.c b/type.c
index 3ce8563..d80550b 100644
--- a/type.c
+++ b/type.c
@@ -123,7 +123,7 @@ type_struct_destroy(struct arg_type_info *info)
}
static int
-layout_struct(struct Process *proc, struct arg_type_info *info,
+layout_struct(struct process *proc, struct arg_type_info *info,
size_t *sizep, size_t *alignmentp, size_t *offsetofp)
{
size_t sz = 0;
@@ -254,10 +254,10 @@ type_destroy(struct arg_type_info *info)
}
#ifdef ARCH_HAVE_SIZEOF
-size_t arch_type_sizeof(struct Process *proc, struct arg_type_info * arg);
+size_t arch_type_sizeof(struct process *proc, struct arg_type_info *arg);
#else
size_t
-arch_type_sizeof(struct Process *proc, struct arg_type_info * arg)
+arch_type_sizeof(struct process *proc, struct arg_type_info *arg)
{
/* Use default value. */
return (size_t)-2;
@@ -265,10 +265,10 @@ arch_type_sizeof(struct Process *proc, struct arg_type_info * arg)
#endif
#ifdef ARCH_HAVE_ALIGNOF
-size_t arch_type_alignof(struct Process *proc, struct arg_type_info * arg);
+size_t arch_type_alignof(struct process *proc, struct arg_type_info *arg);
#else
size_t
-arch_type_alignof(struct Process *proc, struct arg_type_info * arg)
+arch_type_alignof(struct process *proc, struct arg_type_info *arg)
{
/* Use default value. */
return (size_t)-2;
@@ -289,7 +289,7 @@ align(size_t sz, size_t alignment)
}
size_t
-type_sizeof(struct Process *proc, struct arg_type_info *type)
+type_sizeof(struct process *proc, struct arg_type_info *type)
{
size_t arch_size = arch_type_sizeof(proc, type);
if (arch_size != (size_t)-2)
@@ -359,7 +359,7 @@ type_sizeof(struct Process *proc, struct arg_type_info *type)
#define alignof(field,st) ((size_t) ((char*) &st.field - (char*) &st))
size_t
-type_alignof(struct Process *proc, struct arg_type_info *type)
+type_alignof(struct process *proc, struct arg_type_info *type)
{
size_t arch_alignment = arch_type_alignof(proc, type);
if (arch_alignment != (size_t)-2)
@@ -412,7 +412,7 @@ type_alignof(struct Process *proc, struct arg_type_info *type)
}
size_t
-type_offsetof(struct Process *proc, struct arg_type_info *type, size_t emt)
+type_offsetof(struct process *proc, struct arg_type_info *type, size_t emt)
{
assert(type->type == ARGTYPE_STRUCT
|| type->type == ARGTYPE_ARRAY);
diff --git a/type.h b/type.h
index e8dec71..b92c1af 100644
--- a/type.h
+++ b/type.h
@@ -111,11 +111,11 @@ void type_init_pointer(struct arg_type_info *info,
void type_destroy(struct arg_type_info *info);
/* Compute a size of given type. Return (size_t)-1 for error. */
-size_t type_sizeof(struct Process *proc, struct arg_type_info *type);
+size_t type_sizeof(struct process *proc, struct arg_type_info *type);
/* Compute an alignment necessary for elements of this type. Return
* (size_t)-1 for error. */
-size_t type_alignof(struct Process *proc, struct arg_type_info *type);
+size_t type_alignof(struct process *proc, struct arg_type_info *type);
/* Align value SZ to ALIGNMENT and return the result. */
size_t align(size_t sz, size_t alignment);
@@ -126,7 +126,7 @@ struct arg_type_info *type_element(struct arg_type_info *type, size_t elt);
/* Compute an offset of EMT-th element of type TYPE. This works for
* arrays and structures. Return (size_t)-1 for error. */
-size_t type_offsetof(struct Process *proc,
+size_t type_offsetof(struct process *proc,
struct arg_type_info *type, size_t elt);
/* Whether TYPE is an integral type as defined by the C standard. */
diff --git a/value.c b/value.c
index f7950da..d18db17 100644
--- a/value.c
+++ b/value.c
@@ -29,7 +29,7 @@
#include "backend.h"
static void
-value_common_init(struct value *valp, struct Process *inferior,
+value_common_init(struct value *valp, struct process *inferior,
struct value *parent, struct arg_type_info *type,
int own_type)
{
@@ -43,7 +43,7 @@ value_common_init(struct value *valp, struct Process *inferior,
}
void
-value_init(struct value *valp, struct Process *inferior, struct value *parent,
+value_init(struct value *valp, struct process *inferior, struct value *parent,
struct arg_type_info *type, int own_type)
{
assert(inferior != NULL);
diff --git a/value.h b/value.h
index 795573c..f501254 100644
--- a/value.h
+++ b/value.h
@@ -46,7 +46,7 @@ enum value_location_t {
struct value {
struct arg_type_info *type;
- struct Process *inferior;
+ struct process *inferior;
struct value *parent;
size_t size;
union {
@@ -63,7 +63,7 @@ struct value {
* value, in case of compound types. It may be NULL. TYPE is a type
* of the value. It may be NULL if the type is not yet known. If
* OWN_TYPE, the passed-in type is owned and released by value. */
-void value_init(struct value *value, struct Process *inferior,
+void value_init(struct value *value, struct process *inferior,
struct value *parent, struct arg_type_info *type,
int own_type);