diff options
author | Doug Evans <dje@google.com> | 2008-12-04 21:41:00 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2008-12-04 21:41:00 +0000 |
commit | 3b676233580b7e047388e8c9ba3ad8b6b8eaeabb (patch) | |
tree | 919a696a6e6709ce628544b6495941be0a5db0da | |
parent | 2d476de17835e31b0b1dc2ef35eabd1e8102c1ec (diff) | |
download | gdb-3b676233580b7e047388e8c9ba3ad8b6b8eaeabb.zip gdb-3b676233580b7e047388e8c9ba3ad8b6b8eaeabb.tar.gz gdb-3b676233580b7e047388e8c9ba3ad8b6b8eaeabb.tar.bz2 |
* infcall.c (call_function_by_hand): Clean up use of local dummy_addr.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/infcall.c | 43 |
2 files changed, 21 insertions, 26 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8d06e3f..3bff920 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2008-12-04 Doug Evans <dje@google.com> + + * infcall.c (call_function_by_hand): Clean up use of local dummy_addr. + 2008-12-02 Doug Evans <dje@google.com> * infrun.c (handle_inferior_event): Remove redundant resetting of diff --git a/gdb/infcall.c b/gdb/infcall.c index b2ca485..d50bcca 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -310,7 +310,6 @@ struct value * call_function_by_hand (struct value *function, int nargs, struct value **args) { CORE_ADDR sp; - CORE_ADDR dummy_addr; struct type *values_type, *target_values_type; unsigned char struct_return = 0, lang_struct_return = 0; CORE_ADDR struct_addr = 0; @@ -471,35 +470,26 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) switch (gdbarch_call_dummy_location (gdbarch)) { case ON_STACK: - /* "dummy_addr" is here just to keep old targets happy. New - targets return that same information via "sp" and "bp_addr". */ - if (gdbarch_inner_than (gdbarch, 1, 2)) - { - sp = push_dummy_code (gdbarch, sp, funaddr, + sp = push_dummy_code (gdbarch, sp, funaddr, args, nargs, target_values_type, &real_pc, &bp_addr, get_current_regcache ()); - dummy_addr = sp; - } - else - { - dummy_addr = sp; - sp = push_dummy_code (gdbarch, sp, funaddr, - args, nargs, target_values_type, - &real_pc, &bp_addr, get_current_regcache ()); - } break; case AT_ENTRY_POINT: - real_pc = funaddr; - dummy_addr = entry_point_address (); - /* Make certain that the address points at real code, and not a - function descriptor. */ - dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch, - dummy_addr, - ¤t_target); - /* A call dummy always consists of just a single breakpoint, so - it's address is the same as the address of the dummy. */ - bp_addr = dummy_addr; - break; + { + CORE_ADDR dummy_addr; + + real_pc = funaddr; + dummy_addr = entry_point_address (); + /* Make certain that the address points at real code, and not a + function descriptor. */ + dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch, + dummy_addr, + ¤t_target); + /* A call dummy always consists of just a single breakpoint, so + its address is the same as the address of the dummy. */ + bp_addr = dummy_addr; + break; + } case AT_SYMBOL: /* Some executables define a symbol __CALL_DUMMY_ADDRESS whose address is the location where the breakpoint should be @@ -507,6 +497,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) this can be deleted - ON_STACK is a better option. */ { struct minimal_symbol *sym; + CORE_ADDR dummy_addr; sym = lookup_minimal_symbol ("__CALL_DUMMY_ADDRESS", NULL, NULL); real_pc = funaddr; |