From 9fecbed0c03ddad63c27f1622e2002fdfc2f45e4 Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Mon, 7 May 2012 12:07:48 +0800 Subject: target-i386: Add API to write elf notes to core file The core file contains register's value. These APIs write registers to core file, and them will be called in the following patch. Signed-off-by: Wen Congyang Signed-off-by: Luiz Capitulino --- cpu-all.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'cpu-all.h') diff --git a/cpu-all.h b/cpu-all.h index 76439b4..a71e887 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -541,4 +541,26 @@ static inline bool cpu_paging_enabled(CPUArchState *env) } #endif +typedef int (*write_core_dump_function)(void *buf, size_t size, void *opaque); +#if defined(CONFIG_HAVE_CORE_DUMP) +int cpu_write_elf64_note(write_core_dump_function f, CPUArchState *env, + int cpuid, void *opaque); +int cpu_write_elf32_note(write_core_dump_function f, CPUArchState *env, + int cpuid, void *opaque); +#else +static inline int cpu_write_elf64_note(write_core_dump_function f, + CPUArchState *env, int cpuid, + void *opaque) +{ + return -1; +} + +static inline int cpu_write_elf32_note(write_core_dump_function f, + CPUArchState *env, int cpuid, + void *opaque) +{ + return -1; +} +#endif + #endif /* CPU_ALL_H */ -- cgit v1.1