diff options
author | Tom Tromey <tom@tromey.com> | 2018-03-07 15:55:01 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-03-08 21:57:14 -0700 |
commit | fdf07f3aeba5906fec462fba33801c173862f241 (patch) | |
tree | fd68e3d0ab16ad5ce80e87f998f4f5db71d8d845 /gdb/infcall.c | |
parent | 0089daceaba4338046932e65a1b5882065416633 (diff) | |
download | gdb-fdf07f3aeba5906fec462fba33801c173862f241.zip gdb-fdf07f3aeba5906fec462fba33801c173862f241.tar.gz gdb-fdf07f3aeba5906fec462fba33801c173862f241.tar.bz2 |
Change enable_thread_stack_temporaries to an RAII class
This started as a patch to change enable_thread_stack_temporaries to
be an RAII class, but then I noticed that this code used a VEC, so I
went ahead and did a bit more C++-ification, changing
stack_temporaries_enabled to a bool and changing stack_temporaries to
a std::vector.
Regression tested by the buildbot.
gdb/ChangeLog
2018-03-08 Tom Tromey <tom@tromey.com>
* infcall.c (struct call_return_meta_info)
<stack_temporaries_enabled>: Remove.
(get_call_return_value, call_function_by_hand_dummy): Update.
* thread.c (disable_thread_stack_temporaries): Remove.
(enable_thread_stack_temporaries): Remove.
(thread_stack_temporaries_enabled_p): Return bool.
(push_thread_stack_temporary, value_in_thread_stack_temporaries)
(get_last_thread_stack_temporary): Update.
* eval.c (evaluate_subexp): Update.
* gdbthread.h (class enable_thread_stack_temporaries): Now a
class, not a function.
(value_ptr, value_vec): Remove typedefs.
(class thread_info) <stack_temporaries_enabled>: Now bool.
<stack_temporaries>: Now a std::vector.
(thread_stack_temporaries_enabled_p)
(value_in_thread_stack_temporaries): Return bool.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r-- | gdb/infcall.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c index b7f4a17..54f82ba 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -409,9 +409,6 @@ struct call_return_meta_info /* If using a structure return, this is the structure's address. */ CORE_ADDR struct_addr; - - /* Whether stack temporaries are enabled. */ - int stack_temporaries_enabled; }; /* Extract the called function's return value. */ @@ -420,7 +417,7 @@ static struct value * get_call_return_value (struct call_return_meta_info *ri) { struct value *retval = NULL; - int stack_temporaries = thread_stack_temporaries_enabled_p (inferior_ptid); + bool stack_temporaries = thread_stack_temporaries_enabled_p (inferior_ptid); if (TYPE_CODE (ri->value_type) == TYPE_CODE_VOID) retval = allocate_value (ri->value_type); @@ -739,7 +736,7 @@ call_function_by_hand_dummy (struct value *function, ptid_t call_thread_ptid; struct gdb_exception e; char name_buf[RAW_FUNCTION_ADDRESS_SIZE]; - int stack_temporaries = thread_stack_temporaries_enabled_p (inferior_ptid); + bool stack_temporaries = thread_stack_temporaries_enabled_p (inferior_ptid); if (TYPE_CODE (ftype) == TYPE_CODE_PTR) ftype = check_typedef (TYPE_TARGET_TYPE (ftype)); |