#include "ada-lang.h"
#include "gdbthread.h"
#include "event-top.h"
-#include "observer.h"
+#include "observable.h"
#include "top.h"
#include "interps.h"
#include "thread-fsm.h"
+#include <algorithm>
/* If we can't find a function's name from its address,
we print this instead. */
/* 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. */
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);
struct type *ftype = check_typedef (value_type (function));
CORE_ADDR bp_addr;
struct frame_id dummy_id;
- struct cleanup *args_cleanup;
struct frame_info *frame;
struct gdbarch *gdbarch;
struct cleanup *terminate_bp_cleanup;
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));
target_values_type = values_type;
}
- observer_notify_inferior_call_pre (inferior_ptid, funaddr);
+ gdb::observers::inferior_call_pre.notify (inferior_ptid, funaddr);
/* Determine the location of the breakpoint (and possibly other
stuff) that the called function will return to. The SPARC, for a
}
}
+ std::vector<struct value *> new_args;
if (hidden_first_param_p)
{
- struct value **new_args;
-
/* Add the new argument to the front of the argument list. */
- new_args = XNEWVEC (struct value *, nargs + 1);
- new_args[0] = value_from_pointer (lookup_pointer_type (values_type),
- struct_addr);
- memcpy (&new_args[1], &args[0], sizeof (struct value *) * nargs);
- args = new_args;
+ new_args.push_back
+ (value_from_pointer (lookup_pointer_type (values_type), struct_addr));
+ std::copy (&args[0], &args[nargs], std::back_inserter (new_args));
+ args = new_args.data ();
nargs++;
- args_cleanup = make_cleanup (xfree, args);
}
- else
- args_cleanup = make_cleanup (null_cleanup, NULL);
/* Create the dummy stack frame. Pass in the call dummy address as,
presumably, the ABI code knows where, in the call dummy, the
bp_addr, nargs, args,
sp, struct_return, struct_addr);
- do_cleanups (args_cleanup);
-
/* Set up a frame ID for the dummy frame so we can pass it to
set_momentary_breakpoint. We need to give the breakpoint a frame
ID so that the breakpoint code can correctly re-identify the
e = run_inferior_call (sm, tp, real_pc);
- observer_notify_inferior_call_post (call_thread_ptid, funaddr);
+ gdb::observers::inferior_call_post.notify (call_thread_ptid, funaddr);
tp = find_thread_ptid (call_thread_ptid);
if (tp != NULL)