#include "ctf.h"
#include "tracepoint.h"
#include "regcache.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "exec.h"
#include "completer.h"
struct ctf_trace_file_writer *writer
= (struct ctf_trace_file_writer *) self;
int i;
- mode_t hmode = S_IRUSR | S_IWUSR | S_IXUSR
-#ifdef S_IRGRP
- | S_IRGRP
-#endif
-#ifdef S_IXGRP
- | S_IXGRP
-#endif
- | S_IROTH /* Defined in common/gdb_stat.h if not defined. */
-#ifdef S_IXOTH
- | S_IXOTH
-#endif
- ;
+ mode_t hmode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH;
/* Create DIRNAME. */
if (mkdir (dirname, hmode) && errno != EEXIST)
/* name */
if (tsv->name != NULL)
- ctf_save_write (&writer->tcs, tsv->name, strlen (tsv->name));
+ ctf_save_write (&writer->tcs, (gdb_byte *) tsv->name,
+ strlen (tsv->name));
ctf_save_write (&writer->tcs, &zero, 1);
}
/* condition */
if (tp->cond != NULL)
- ctf_save_write (&writer->tcs, tp->cond, strlen (tp->cond));
+ ctf_save_write (&writer->tcs, (gdb_byte *) tp->cond, strlen (tp->cond));
ctf_save_write (&writer->tcs, &zero, 1);
/* actions */
u32 = VEC_length (char_ptr, tp->actions);
ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
for (a = 0; VEC_iterate (char_ptr, tp->actions, a, act); ++a)
- ctf_save_write (&writer->tcs, act, strlen (act) + 1);
+ ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
/* step_actions */
u32 = VEC_length (char_ptr, tp->step_actions);
ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
for (a = 0; VEC_iterate (char_ptr, tp->step_actions, a, act); ++a)
- ctf_save_write (&writer->tcs, act, strlen (act) + 1);
+ ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
/* at_string */
if (tp->at_string != NULL)
- ctf_save_write (&writer->tcs, tp->at_string,
+ ctf_save_write (&writer->tcs, (gdb_byte *) tp->at_string,
strlen (tp->at_string));
ctf_save_write (&writer->tcs, &zero, 1);
/* cond_string */
if (tp->cond_string != NULL)
- ctf_save_write (&writer->tcs, tp->cond_string,
+ ctf_save_write (&writer->tcs, (gdb_byte *) tp->cond_string,
strlen (tp->cond_string));
ctf_save_write (&writer->tcs, &zero, 1);
u32 = VEC_length (char_ptr, tp->cmd_strings);
ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
for (a = 0; VEC_iterate (char_ptr, tp->cmd_strings, a, act); ++a)
- ctf_save_write (&writer->tcs, act, strlen (act) + 1);
+ ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
}
ctf_destroy ();
xfree (trace_dirname);
trace_dirname = NULL;
+
+ trace_reset_local_state ();
}
/* This is the implementation of target_ops method to_files_info.
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
int offset, regn, regsize, pc_regno;
- char *regs = NULL;
+ gdb_byte *regs = NULL;
struct bt_ctf_event *event = NULL;
struct bt_iter_pos *pos;
const struct bt_definition *array
= bt_ctf_get_field (event, scope, "contents");
- regs = bt_ctf_get_char_array (array);
+ regs = (gdb_byte *) bt_ctf_get_char_array (array);
/* Assume the block is laid out in GDB register number order,
each register with the size that it has in GDB. */
offset = 0;
def = bt_ctf_get_field (event, scope, "length");
r->length = (uint16_t) bt_ctf_get_uint64 (def);
}
+ else if (strcmp (name, "tsv") == 0)
+ {
+ int vnum;
+ const struct bt_definition *scope
+ = bt_ctf_get_top_level_scope (event,
+ BT_EVENT_FIELDS);
+ const struct bt_definition *def;
+
+ def = bt_ctf_get_field (event, scope, "num");
+ vnum = (int) bt_ctf_get_int64 (def);
+ VEC_safe_push (int, info->tvars, vnum);
+ }
else
{
warning (_("Unhandled trace block type (%s) "