diff options
author | Pierre Muller <muller@sourceware.org> | 2008-06-11 22:03:49 +0000 |
---|---|---|
committer | Pierre Muller <muller@sourceware.org> | 2008-06-11 22:03:49 +0000 |
commit | 4309257cda01fce18971fd5a5ea28ed6aaf552cc (patch) | |
tree | 3207f06e4a8f03ae972c6da4a37a795ec78cfeda /gdb/gdbarch.c | |
parent | a4e2ee12f0631722c380973c0336dd165fd0137d (diff) | |
download | ppe42-binutils-4309257cda01fce18971fd5a5ea28ed6aaf552cc.tar.gz ppe42-binutils-4309257cda01fce18971fd5a5ea28ed6aaf552cc.zip |
* gdbarch.sh (gdbarch_skip_main_prologue): New.
* gdbarch.h, gdbarch.c: Regenerate.
* i386-tdep.h (i386_skip_main_prologue): Declare.
* i386-tdep.c (i386_skip_main_prologue): New.
* i386-cygwin-tdep.c (i386_cygwin_init_abi): Register
i386_skip_main_prologue as gdbarch_skip_main_prologue gdbarch callback.
* symtab.c (find_function_start_sal): When pc points at the "main"
function, call gdbarch_skip_main_prologue.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 6594b35436..3a967a9b77 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -183,6 +183,7 @@ struct gdbarch gdbarch_integer_to_address_ftype *integer_to_address; gdbarch_return_value_ftype *return_value; gdbarch_skip_prologue_ftype *skip_prologue; + gdbarch_skip_main_prologue_ftype *skip_main_prologue; gdbarch_inner_than_ftype *inner_than; gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address; @@ -313,6 +314,7 @@ struct gdbarch startup_gdbarch = 0, /* integer_to_address */ 0, /* return_value */ 0, /* skip_prologue */ + 0, /* skip_main_prologue */ 0, /* inner_than */ 0, /* breakpoint_from_pc */ 0, /* adjust_breakpoint_address */ @@ -561,6 +563,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of return_value, has predicate */ if (gdbarch->skip_prologue == 0) fprintf_unfiltered (log, "\n\tskip_prologue"); + /* Skip verify of skip_main_prologue, has predicate */ if (gdbarch->inner_than == 0) fprintf_unfiltered (log, "\n\tinner_than"); if (gdbarch->breakpoint_from_pc == 0) @@ -999,6 +1002,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: single_step_through_delay = <0x%lx>\n", (long) gdbarch->single_step_through_delay); fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n", + gdbarch_skip_main_prologue_p (gdbarch)); + fprintf_unfiltered (file, + "gdbarch_dump: skip_main_prologue = <0x%lx>\n", + (long) gdbarch->skip_main_prologue); + fprintf_unfiltered (file, "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n", gdbarch_skip_permanent_breakpoint_p (gdbarch)); fprintf_unfiltered (file, @@ -2123,6 +2132,30 @@ set_gdbarch_skip_prologue (struct gdbarch *gdbarch, } int +gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->skip_main_prologue != NULL; +} + +CORE_ADDR +gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->skip_main_prologue != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n"); + return gdbarch->skip_main_prologue (gdbarch, ip); +} + +void +set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch, + gdbarch_skip_main_prologue_ftype skip_main_prologue) +{ + gdbarch->skip_main_prologue = skip_main_prologue; +} + +int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) { gdb_assert (gdbarch != NULL); |