+2018-03-01 Simon Marchi <simon.marchi@ericsson.com>
+
+ * record.c (get_call_history_modifiers): Return a
+ record_print_flags.
+ (cmd_record_call_history): Adjust.
+ * record-btrace.c (record_btrace_call_history): Adjust.
+ (record_btrace_call_history_range): Adjust.
+ (record_btrace_call_history_from): Adjust.
+ * target-debug.h (target_debug_print_record_print_flags): New.
+ * target-delegates.c: Re-generate.
+ * target.c (target_call_history): Change flags type.
+ (target_call_history_from): Likewise.
+ (target_call_history_range): Likewise.
+ * target.h (struct target_ops) <target_call_history>: Likewise.
+ (target_call_history_from): Likewise.
+ (target_call_history_range): Likewise.
+
2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com>
Simon Marchi <simon.marchi@polymtl.ca>
/* The to_call_history method of target record-btrace. */
static void
-record_btrace_call_history (struct target_ops *self, int size, int int_flags)
+record_btrace_call_history (struct target_ops *self, int size,
+ record_print_flags flags)
{
struct btrace_thread_info *btinfo;
struct btrace_call_history *history;
struct btrace_call_iterator begin, end;
struct ui_out *uiout;
unsigned int context, covered;
- record_print_flags flags = (enum record_print_flag) int_flags;
uiout = current_uiout;
ui_out_emit_tuple tuple_emitter (uiout, "insn history");
{
struct btrace_insn_iterator *replay;
- DEBUG ("call-history (0x%x): %d", int_flags, size);
+ DEBUG ("call-history (0x%x): %d", (int) flags, size);
/* If we're replaying, we start at the replay position. Otherwise, we
start at the tail of the trace. */
begin = history->begin;
end = history->end;
- DEBUG ("call-history (0x%x): %d, prev: [%u; %u)", int_flags, size,
+ DEBUG ("call-history (0x%x): %d, prev: [%u; %u)", (int) flags, size,
btrace_call_number (&begin), btrace_call_number (&end));
if (size < 0)
static void
record_btrace_call_history_range (struct target_ops *self,
ULONGEST from, ULONGEST to,
- int int_flags)
+ record_print_flags flags)
{
struct btrace_thread_info *btinfo;
struct btrace_call_iterator begin, end;
struct ui_out *uiout;
unsigned int low, high;
int found;
- record_print_flags flags = (enum record_print_flag) int_flags;
uiout = current_uiout;
ui_out_emit_tuple tuple_emitter (uiout, "func history");
low = from;
high = to;
- DEBUG ("call-history (0x%x): [%u; %u)", int_flags, low, high);
+ DEBUG ("call-history (0x%x): [%u; %u)", (int) flags, low, high);
/* Check for wrap-arounds. */
if (low != from || high != to)
static void
record_btrace_call_history_from (struct target_ops *self,
ULONGEST from, int size,
- int int_flags)
+ record_print_flags flags)
{
ULONGEST begin, end, context;
- record_print_flags flags = (enum record_print_flag) int_flags;
context = abs (size);
if (context == 0)
/* Read function-call-history modifiers from an argument string. */
-static int
+static record_print_flags
get_call_history_modifiers (const char **arg)
{
- int modifiers;
- const char *args;
-
- modifiers = 0;
- args = *arg;
+ record_print_flags modifiers = 0;
+ const char *args = *arg;
if (args == NULL)
return modifiers;
static void
cmd_record_call_history (const char *arg, int from_tty)
{
- int flags, size;
-
require_record_target ();
- flags = get_call_history_modifiers (&arg);
+ record_print_flags flags = get_call_history_modifiers (&arg);
- size = command_size_to_target_size (record_call_history_size);
+ int size = command_size_to_target_size (record_call_history_size);
if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
target_call_history (size, flags);
target_debug_do_print (host_address_to_string (X.data ()))
#define target_debug_print_inferior_p(inf) \
target_debug_do_print (host_address_to_string (inf))
+#define target_debug_print_record_print_flags(X) \
+ target_debug_do_print (plongest (X))
static void
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
}
static void
-delegate_call_history (struct target_ops *self, int arg1, int arg2)
+delegate_call_history (struct target_ops *self, int arg1, record_print_flags arg2)
{
self = self->beneath;
self->to_call_history (self, arg1, arg2);
}
static void
-tdefault_call_history (struct target_ops *self, int arg1, int arg2)
+tdefault_call_history (struct target_ops *self, int arg1, record_print_flags arg2)
{
tcomplain ();
}
static void
-debug_call_history (struct target_ops *self, int arg1, int arg2)
+debug_call_history (struct target_ops *self, int arg1, record_print_flags arg2)
{
fprintf_unfiltered (gdb_stdlog, "-> %s->to_call_history (...)\n", debug_target.to_shortname);
debug_target.to_call_history (&debug_target, arg1, arg2);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg1);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg2);
+ target_debug_print_record_print_flags (arg2);
fputs_unfiltered (")\n", gdb_stdlog);
}
static void
-delegate_call_history_from (struct target_ops *self, ULONGEST arg1, int arg2, int arg3)
+delegate_call_history_from (struct target_ops *self, ULONGEST arg1, int arg2, record_print_flags arg3)
{
self = self->beneath;
self->to_call_history_from (self, arg1, arg2, arg3);
}
static void
-tdefault_call_history_from (struct target_ops *self, ULONGEST arg1, int arg2, int arg3)
+tdefault_call_history_from (struct target_ops *self, ULONGEST arg1, int arg2, record_print_flags arg3)
{
tcomplain ();
}
static void
-debug_call_history_from (struct target_ops *self, ULONGEST arg1, int arg2, int arg3)
+debug_call_history_from (struct target_ops *self, ULONGEST arg1, int arg2, record_print_flags arg3)
{
fprintf_unfiltered (gdb_stdlog, "-> %s->to_call_history_from (...)\n", debug_target.to_shortname);
debug_target.to_call_history_from (&debug_target, arg1, arg2, arg3);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg2);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg3);
+ target_debug_print_record_print_flags (arg3);
fputs_unfiltered (")\n", gdb_stdlog);
}
static void
-delegate_call_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, int arg3)
+delegate_call_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, record_print_flags arg3)
{
self = self->beneath;
self->to_call_history_range (self, arg1, arg2, arg3);
}
static void
-tdefault_call_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, int arg3)
+tdefault_call_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, record_print_flags arg3)
{
tcomplain ();
}
static void
-debug_call_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, int arg3)
+debug_call_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, record_print_flags arg3)
{
fprintf_unfiltered (gdb_stdlog, "-> %s->to_call_history_range (...)\n", debug_target.to_shortname);
debug_target.to_call_history_range (&debug_target, arg1, arg2, arg3);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_ULONGEST (arg2);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg3);
+ target_debug_print_record_print_flags (arg3);
fputs_unfiltered (")\n", gdb_stdlog);
}
/* See target.h. */
void
-target_call_history (int size, int flags)
+target_call_history (int size, record_print_flags flags)
{
current_target.to_call_history (¤t_target, size, flags);
}
/* See target.h. */
void
-target_call_history_from (ULONGEST begin, int size, int flags)
+target_call_history_from (ULONGEST begin, int size, record_print_flags flags)
{
current_target.to_call_history_from (¤t_target, begin, size, flags);
}
/* See target.h. */
void
-target_call_history_range (ULONGEST begin, ULONGEST end, int flags)
+target_call_history_range (ULONGEST begin, ULONGEST end, record_print_flags flags)
{
current_target.to_call_history_range (¤t_target, begin, end, flags);
}
/* Print a function trace of the recorded execution trace.
If SIZE < 0, print abs (SIZE) preceding functions; otherwise, print SIZE
succeeding functions. */
- void (*to_call_history) (struct target_ops *, int size, int flags)
+ void (*to_call_history) (struct target_ops *, int size, record_print_flags flags)
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Print a function trace of the recorded execution trace starting
If SIZE < 0, print abs (SIZE) functions before FROM; otherwise, print
SIZE functions after FROM. */
void (*to_call_history_from) (struct target_ops *,
- ULONGEST begin, int size, int flags)
+ ULONGEST begin, int size, record_print_flags flags)
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Print a function trace of an execution trace section from function BEGIN
(inclusive) to function END (inclusive). */
void (*to_call_history_range) (struct target_ops *,
- ULONGEST begin, ULONGEST end, int flags)
+ ULONGEST begin, ULONGEST end, record_print_flags flags)
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Nonzero if TARGET_OBJECT_LIBRARIES_SVR4 may be read with a
gdb_disassembly_flags flags);
/* See to_call_history. */
-extern void target_call_history (int size, int flags);
+extern void target_call_history (int size, record_print_flags flags);
/* See to_call_history_from. */
-extern void target_call_history_from (ULONGEST begin, int size, int flags);
+extern void target_call_history_from (ULONGEST begin, int size,
+ record_print_flags flags);
/* See to_call_history_range. */
-extern void target_call_history_range (ULONGEST begin, ULONGEST end, int flags);
+extern void target_call_history_range (ULONGEST begin, ULONGEST end,
+ record_print_flags flags);
/* See to_prepare_to_generate_core. */
extern void target_prepare_to_generate_core (void);