diff options
author | Peter Schauer <Peter.Schauer@mytum.de> | 2000-10-16 17:19:47 +0000 |
---|---|---|
committer | Peter Schauer <Peter.Schauer@mytum.de> | 2000-10-16 17:19:47 +0000 |
commit | 9e36d949c4d3450cec8b3979d547e36dd73408c1 (patch) | |
tree | 42bb79de8166b4a1f825ac41574a2fdde6a79fbe /gdb | |
parent | 96c405b3f019201b231d08bc63e3dfa132871de6 (diff) | |
download | gdb-9e36d949c4d3450cec8b3979d547e36dd73408c1.zip gdb-9e36d949c4d3450cec8b3979d547e36dd73408c1.tar.gz gdb-9e36d949c4d3450cec8b3979d547e36dd73408c1.tar.bz2 |
* sparc-tdep.c (sparc_fix_call_dummy): Improve comments.
Adjust call_dummy_breakpoint_offset, so that `finish' after a stop
in a call dummy works.
(sparc_gdbarch_init): Fix setting of pc_in_call_dummy, it depends
on SPARC32/64_CALL_DUMMY_ON_STACK, not DO_CALL_DUMMY_ON_STACK.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/sparc-tdep.c | 37 |
2 files changed, 33 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5bb4f4a..2673342 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2000-10-16 Peter Schauer <pes@regent.e-technik.tu-muenchen.de> + + * sparc-tdep.c (sparc_fix_call_dummy): Improve comments. + Adjust call_dummy_breakpoint_offset, so that `finish' after a stop + in a call dummy works. + (sparc_gdbarch_init): Fix setting of pc_in_call_dummy, it depends + on SPARC32/64_CALL_DUMMY_ON_STACK, not DO_CALL_DUMMY_ON_STACK. + 2000-10-15 Kevin Buettner <kevinb@redhat.com> * remote-st.c (st2000_xfer_inferior_memory): Protoize. diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index d6e0456..cce7cc1 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -2136,13 +2136,27 @@ sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, | (((fun - (pc + CALL_DUMMY_CALL_OFFSET)) >> 2) & 0x3fffffff))); - /* Comply with strange Sun cc calling convention for struct-returning - functions. */ - if (!using_gcc - && (TYPE_CODE (value_type) == TYPE_CODE_STRUCT - || TYPE_CODE (value_type) == TYPE_CODE_UNION)) - store_unsigned_integer (dummy + CALL_DUMMY_CALL_OFFSET + 8, 4, - TYPE_LENGTH (value_type) & 0x1fff); + /* If the called function returns an aggregate value, fill in the UNIMP + instruction containing the size of the returned aggregate return value, + which follows the call instruction. + For details see the SPARC Architecture Manual Version 8, Appendix D.3. + + Adjust the call_dummy_breakpoint_offset for the bp_call_dummy breakpoint + to the proper address in the call dummy, so that `finish' after a stop + in a call dummy works. + Tweeking current_gdbarch is not an optimal solution, but the call to + sparc_fix_call_dummy is immediately followed by a call to run_stack_dummy, + which is the only function where dummy_breakpoint_offset is actually + used, if it is non-zero. */ + if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT + || TYPE_CODE (value_type) == TYPE_CODE_UNION) + { + store_unsigned_integer (dummy + CALL_DUMMY_CALL_OFFSET + 8, 4, + TYPE_LENGTH (value_type) & 0x1fff); + set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x30); + } + else + set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x2c); if (!(GDB_TARGET_IS_SPARC64)) { @@ -2961,11 +2975,6 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_max_register_raw_size (gdbarch, 8); set_gdbarch_max_register_virtual_size (gdbarch, 8); -#ifdef DO_CALL_DUMMY_ON_STACK - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); -#else - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); -#endif set_gdbarch_pop_frame (gdbarch, sparc_pop_frame); set_gdbarch_push_return_address (gdbarch, sparc_push_return_address); set_gdbarch_push_dummy_frame (gdbarch, sparc_push_dummy_frame); @@ -2999,12 +3008,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* 32-bit machine types: */ #ifdef SPARC32_CALL_DUMMY_ON_STACK + set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0x30); set_gdbarch_call_dummy_length (gdbarch, 0x38); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_call_dummy_words (gdbarch, call_dummy_32); #else + set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); @@ -3053,6 +3064,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) default: /* Any new machine type is likely to be 64-bit. */ #ifdef SPARC64_CALL_DUMMY_ON_STACK + set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 8 * 4); set_gdbarch_call_dummy_length (gdbarch, 192); @@ -3060,6 +3072,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 148); set_gdbarch_call_dummy_words (gdbarch, call_dummy_64); #else + set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); |