diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2014-05-14 14:08:57 -0600 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2014-12-12 22:25:37 +0100 |
commit | f208eee0f3a4f42a0bf20ab900eb36fbba8e4b9e (patch) | |
tree | 8984185ee57c14d23c39794558eda58f36659887 /gdb/gdbarch.h | |
parent | 233a8fb382c88d7faa6da1cd93a7e21b77e36df4 (diff) | |
download | gdb-f208eee0f3a4f42a0bf20ab900eb36fbba8e4b9e.zip gdb-f208eee0f3a4f42a0bf20ab900eb36fbba8e4b9e.tar.gz gdb-f208eee0f3a4f42a0bf20ab900eb36fbba8e4b9e.tar.bz2 |
add infcall_mmap and gcc_target_options gdbarch methods
The compiler needed two new gdbarch methods.
The infcall_mmap method allocates memory in the inferior.
This is used when inserting the object code.
The gcc_target_options method computes some arch-specific gcc options
to pass to the compiler. This is used to ensure that gcc generates
object code for the correct architecture.
gdb/ChangeLog
2014-12-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* arch-utils.c (default_infcall_mmap)
(default_gcc_target_options): New functions.
* arch-utils.h (GDB_MMAP_PROT_READ, GDB_MMAP_PROT_WRITE)
(GDB_MMAP_PROT_EXEC): Define.
(default_infcall_mmap, default_gcc_target_options): Declare.
* gdbarch.h: Rebuild.
* gdbarch.c: Rebuild.
* gdbarch.sh (infcall_mmap, gcc_target_options): New methods.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r-- | gdb/gdbarch.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index ba4fe62..d086553 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -1390,6 +1390,23 @@ typedef int (gdbarch_vsyscall_range_ftype) (struct gdbarch *gdbarch, struct mem_ extern int gdbarch_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range); extern void set_gdbarch_vsyscall_range (struct gdbarch *gdbarch, gdbarch_vsyscall_range_ftype *vsyscall_range); +/* Allocate SIZE bytes of PROT protected page aligned memory in inferior. + PROT has GDB_MMAP_PROT_* bitmask format. + Throw an error if it is not possible. Returned address is always valid. */ + +typedef CORE_ADDR (gdbarch_infcall_mmap_ftype) (CORE_ADDR size, unsigned prot); +extern CORE_ADDR gdbarch_infcall_mmap (struct gdbarch *gdbarch, CORE_ADDR size, unsigned prot); +extern void set_gdbarch_infcall_mmap (struct gdbarch *gdbarch, gdbarch_infcall_mmap_ftype *infcall_mmap); + +/* Return string (caller has to use xfree for it) with options for GCC + to produce code for this target, typically "-m64", "-m32" or "-m31". + These options are put before CU's DW_AT_producer compilation options so that + they can override it. Method may also return NULL. */ + +typedef char * (gdbarch_gcc_target_options_ftype) (struct gdbarch *gdbarch); +extern char * gdbarch_gcc_target_options (struct gdbarch *gdbarch); +extern void set_gdbarch_gcc_target_options (struct gdbarch *gdbarch, gdbarch_gcc_target_options_ftype *gcc_target_options); + /* Definition for an unknown syscall, used basically in error-cases. */ #define UNKNOWN_SYSCALL (-1) |