本文整理汇总了C++中VEC_iterate函数的典型用法代码示例。如果您正苦于以下问题:C++ VEC_iterate函数的具体用法?C++ VEC_iterate怎么用?C++ VEC_iterate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VEC_iterate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tfile_write_uploaded_tp
static void
tfile_write_uploaded_tp (struct trace_file_writer *self,
struct uploaded_tp *utp)
{
struct tfile_trace_file_writer *writer
= (struct tfile_trace_file_writer *) self;
int a;
char *act;
char buf[MAX_TRACE_UPLOAD];
fprintf (writer->fp, "tp T%x:%s:%c:%x:%x",
utp->number, phex_nz (utp->addr, sizeof (utp->addr)),
(utp->enabled ? 'E' : 'D'), utp->step, utp->pass);
if (utp->type == bp_fast_tracepoint)
fprintf (writer->fp, ":F%x", utp->orig_size);
if (utp->cond)
fprintf (writer->fp,
":X%x,%s", (unsigned int) strlen (utp->cond) / 2,
utp->cond);
fprintf (writer->fp, "\n");
for (a = 0; VEC_iterate (char_ptr, utp->actions, a, act); ++a)
fprintf (writer->fp, "tp A%x:%s:%s\n",
utp->number, phex_nz (utp->addr, sizeof (utp->addr)), act);
for (a = 0; VEC_iterate (char_ptr, utp->step_actions, a, act); ++a)
fprintf (writer->fp, "tp S%x:%s:%s\n",
utp->number, phex_nz (utp->addr, sizeof (utp->addr)), act);
if (utp->at_string)
{
encode_source_string (utp->number, utp->addr,
"at", utp->at_string, buf, MAX_TRACE_UPLOAD);
fprintf (writer->fp, "tp Z%s\n", buf);
}
if (utp->cond_string)
{
encode_source_string (utp->number, utp->addr,
"cond", utp->cond_string,
buf, MAX_TRACE_UPLOAD);
fprintf (writer->fp, "tp Z%s\n", buf);
}
for (a = 0; VEC_iterate (char_ptr, utp->cmd_strings, a, act); ++a)
{
encode_source_string (utp->number, utp->addr, "cmd", act,
buf, MAX_TRACE_UPLOAD);
fprintf (writer->fp, "tp Z%s\n", buf);
}
fprintf (writer->fp, "tp V%x:%s:%x:%s\n",
utp->number, phex_nz (utp->addr, sizeof (utp->addr)),
utp->hit_count,
phex_nz (utp->traceframe_usage,
sizeof (utp->traceframe_usage)));
}
示例2: unify_scattering_dimensions
int
unify_scattering_dimensions (scop_p scop)
{
int i;
poly_bb_p pbb;
graphite_dim_t max_scattering = 0;
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
max_scattering = MAX (pbb_nb_scattering_transform (pbb), max_scattering);
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
extend_scattering (pbb, max_scattering);
return max_scattering;
}
示例3: mem_disable_command
static void
mem_disable_command (char *args, int from_tty)
{
int num;
struct mem_region *m;
int ix;
require_user_regions (from_tty);
target_dcache_invalidate ();
if (args == NULL || *args == '\0')
{
for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
m->enabled_p = 0;
}
else
{
struct get_number_or_range_state state;
init_number_or_range (&state, args);
while (!state.finished)
{
num = get_number_or_range (&state);
mem_disable (num);
}
}
}
示例4: pbb_remove_duplicate_pdrs
void
pbb_remove_duplicate_pdrs (poly_bb_p pbb)
{
int i, j;
poly_dr_p pdr1, pdr2;
unsigned n = VEC_length (poly_dr_p, PBB_DRS (pbb));
VEC (poly_dr_p, heap) *collapsed = VEC_alloc (poly_dr_p, heap, n);
for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr1); i++)
for (j = 0; VEC_iterate (poly_dr_p, collapsed, j, pdr2); j++)
if (!can_collapse_pdrs (pdr1, pdr2))
VEC_quick_push (poly_dr_p, collapsed, pdr1);
VEC_free (poly_dr_p, heap, collapsed);
PBB_PDR_DUPLICATES_REMOVED (pbb) = true;
}
示例5: require_user_regions
static void
require_user_regions (int from_tty)
{
struct mem_region *m;
int ix, length;
/* If we're already using a user-provided list, nothing to do. */
if (!mem_use_target)
return;
/* Switch to a user-provided list (possibly a copy of the current
one). */
mem_use_target = 0;
/* If we don't have a target-provided region list yet, then
no need to warn. */
if (mem_region_list == NULL)
return;
/* Otherwise, let the user know how to get back. */
if (from_tty)
warning (_("Switching to manual control of memory regions; use "
"\"mem auto\" to fetch regions from the target again."));
/* And create a new list for the user to modify. */
length = VEC_length (mem_region_s, target_mem_region_list);
mem_region_list = VEC_alloc (mem_region_s, length);
for (ix = 0; VEC_iterate (mem_region_s, target_mem_region_list, ix, m); ix++)
VEC_quick_push (mem_region_s, mem_region_list, m);
}
示例6: verify_flow_insensitive_alias_info
static void
verify_flow_insensitive_alias_info (void)
{
tree var;
bitmap visited = BITMAP_ALLOC (NULL);
referenced_var_iterator rvi;
FOR_EACH_REFERENCED_VAR (var, rvi)
{
size_t j;
var_ann_t ann;
VEC(tree,gc) *may_aliases;
tree alias;
ann = var_ann (var);
may_aliases = ann->may_aliases;
for (j = 0; VEC_iterate (tree, may_aliases, j, alias); j++)
{
bitmap_set_bit (visited, DECL_UID (alias));
if (!may_be_aliased (alias))
{
error ("non-addressable variable inside an alias set");
debug_variable (alias);
goto err;
}
}
}
示例7: signal_catchpoint_breakpoint_hit
static int
signal_catchpoint_breakpoint_hit (const struct bp_location *bl,
struct address_space *aspace,
CORE_ADDR bp_addr,
const struct target_waitstatus *ws)
{
const struct signal_catchpoint *c = (void *) bl->owner;
gdb_signal_type signal_number;
if (ws->kind != TARGET_WAITKIND_STOPPED)
return 0;
signal_number = ws->value.sig;
/* If we are catching specific signals in this breakpoint, then we
must guarantee that the called signal is the same signal we are
catching. */
if (c->signals_to_be_caught)
{
int i;
gdb_signal_type iter;
for (i = 0;
VEC_iterate (gdb_signal_type, c->signals_to_be_caught, i, iter);
i++)
if (signal_number == iter)
return 1;
/* Not the same. */
gdb_assert (!iter);
return 0;
}
else
return c->catch_all || !INTERNAL_SIGNAL (signal_number);
}
示例8: signal_catchpoint_print_mention
static void
signal_catchpoint_print_mention (struct breakpoint *b)
{
struct signal_catchpoint *c = (void *) b;
if (c->signals_to_be_caught)
{
int i;
gdb_signal_type iter;
if (VEC_length (gdb_signal_type, c->signals_to_be_caught) > 1)
printf_filtered (_("Catchpoint %d (signals"), b->number);
else
printf_filtered (_("Catchpoint %d (signal"), b->number);
for (i = 0;
VEC_iterate (gdb_signal_type, c->signals_to_be_caught, i, iter);
i++)
{
const char *name = signal_to_name_or_int (iter);
printf_filtered (" %s", name);
}
printf_filtered (")");
}
else if (c->catch_all)
printf_filtered (_("Catchpoint %d (any signal)"), b->number);
else
printf_filtered (_("Catchpoint %d (standard signals)"), b->number);
}
示例9: signal_catchpoint_remove_location
static int
signal_catchpoint_remove_location (struct bp_location *bl)
{
struct signal_catchpoint *c = (void *) bl->owner;
int i;
if (c->signals_to_be_caught != NULL)
{
gdb_signal_type iter;
for (i = 0;
VEC_iterate (gdb_signal_type, c->signals_to_be_caught, i, iter);
i++)
{
gdb_assert (signal_catch_counts[iter] > 0);
--signal_catch_counts[iter];
}
}
else
{
for (i = 0; i < GDB_SIGNAL_LAST; ++i)
{
if (c->catch_all || !INTERNAL_SIGNAL (i))
{
gdb_assert (signal_catch_counts[i] > 0);
--signal_catch_counts[i];
}
}
}
signal_catch_update (signal_catch_counts);
return 0;
}
示例10: print_iteration_domains
void
print_iteration_domains (FILE *file, scop_p scop, int verbosity)
{
int i;
poly_bb_p pbb;
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
print_iteration_domain (file, pbb, verbosity);
}
示例11: signal_catchpoint_print_one
static void
signal_catchpoint_print_one (struct breakpoint *b,
struct bp_location **last_loc)
{
struct signal_catchpoint *c = (void *) b;
struct value_print_options opts;
struct ui_out *uiout = current_uiout;
get_user_print_options (&opts);
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
if (opts.addressprint)
ui_out_field_skip (uiout, "addr");
annotate_field (5);
if (c->signals_to_be_caught
&& VEC_length (gdb_signal_type, c->signals_to_be_caught) > 1)
ui_out_text (uiout, "signals \"");
else
ui_out_text (uiout, "signal \"");
if (c->signals_to_be_caught)
{
int i;
gdb_signal_type iter;
struct obstack text;
struct cleanup *cleanup;
obstack_init (&text);
cleanup = make_cleanup_obstack_free (&text);
for (i = 0;
VEC_iterate (gdb_signal_type, c->signals_to_be_caught, i, iter);
i++)
{
const char *name = signal_to_name_or_int (iter);
if (i > 0)
obstack_grow (&text, " ", 1);
obstack_grow (&text, name, strlen (name));
}
obstack_grow (&text, "", 1);
ui_out_field_string (uiout, "what", obstack_base (&text));
do_cleanups (cleanup);
}
else
ui_out_field_string (uiout, "what",
c->catch_all ? "<any signal>" : "<standard signals>");
ui_out_text (uiout, "\" ");
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "catch-type", "signal");
}
示例12: serial_interface_lookup
static const struct serial_ops *
serial_interface_lookup (const char *name)
{
const struct serial_ops *ops;
int i;
for (i = 0; VEC_iterate (serial_ops_p, serial_ops_list, i, ops); ++i)
if (strcmp (name, ops->name) == 0)
return ops;
return NULL;
}
示例13: mem_disable
static void
mem_disable (int num)
{
struct mem_region *m;
int ix;
for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
if (m->number == num)
{
m->enabled_p = 0;
return;
}
printf_unfiltered (_("No memory region number %d.\n"), num);
}
示例14: thread_db_load_search
static int
thread_db_load_search (void)
{
VEC (char_ptr) *dir_vec;
char *this_dir;
int i, rc = 0;
if (libthread_db_search_path == NULL)
libthread_db_search_path = xstrdup (LIBTHREAD_DB_SEARCH_PATH);
dir_vec = dirnames_to_char_ptr_vec (libthread_db_search_path);
for (i = 0; VEC_iterate (char_ptr, dir_vec, i, this_dir); ++i)
{
const int pdir_len = sizeof ("$pdir") - 1;
size_t this_dir_len;
this_dir_len = strlen (this_dir);
if (strncmp (this_dir, "$pdir", pdir_len) == 0
&& (this_dir[pdir_len] == '\0'
|| this_dir[pdir_len] == '/'))
{
/* We don't maintain a list of loaded libraries so we don't know
where libpthread lives. We *could* fetch the info, but we don't
do that yet. Ignore it. */
}
else if (strcmp (this_dir, "$sdir") == 0)
{
if (try_thread_db_load_from_sdir ())
{
rc = 1;
break;
}
}
else
{
if (try_thread_db_load_from_dir (this_dir, this_dir_len))
{
rc = 1;
break;
}
}
}
free_char_ptr_vec (dir_vec);
if (debug_threads)
debug_printf ("thread_db_load_search returning %d\n", rc);
return rc;
}
示例15: add_block_to_enclosing
static void
add_block_to_enclosing (tree block)
{
unsigned i;
tree enclosing;
gimple bind;
VEC(gimple, heap) *stack = gimple_bind_expr_stack ();
for (i = 0; VEC_iterate (gimple, stack, i, bind); i++)
if (gimple_bind_block (bind))
break;
enclosing = gimple_bind_block (bind);
BLOCK_SUBBLOCKS (enclosing) = chainon (BLOCK_SUBBLOCKS (enclosing), block);
}