+2015-08-06 Simon Marchi <simon.marchi@ericsson.com>
+ Pedro Alves <palves@redhat.com>
+
+ * arm-tdep.c (set_fp_model_sfunc): Add cast from integer to enum.
+ (arm_set_abi): Likewise.
+ * ax-general.c (ax_print): Likewise.
+ * c-exp.y (exp : string_exp): Likewise.
+ * compile/compile-loc2c.c (compute_stack_depth_worker): Likewise.
+ (do_compile_dwarf_expr_to_c): Likewise.
+ * cp-name-parser.y (demangler_special : DEMANGLER_SPECIAL start):
+ Likewise.
+ * dwarf2expr.c (execute_stack_op): Likewise.
+ * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise.
+ (disassemble_dwarf_expression): Likewise.
+ * dwarf2read.c (dwarf2_add_member_fn): Likewise.
+ (read_array_order): Likewise.
+ (abbrev_table_read_table): Likewise.
+ (read_attribute_value): Likewise.
+ (skip_unknown_opcode): Likewise.
+ (dwarf_decode_macro_bytes): Likewise.
+ (dwarf_decode_macros): Likewise.
+ * eval.c (value_f90_subarray): Likewise.
+ * guile/scm-param.c (gdbscm_make_parameter): Likewise.
+ * i386-linux-tdep.c (i386_canonicalize_syscall): Likewise.
+ * infrun.c (handle_command): Likewise.
+ * memory-map.c (memory_map_start_memory): Likewise.
+ * osabi.c (set_osabi): Likewise.
+ * parse.c (operator_length_standard): Likewise.
+ * ppc-linux-tdep.c (ppc_canonicalize_syscall): Likewise, and use
+ single return point.
+ * python/py-frame.c (gdbpy_frame_stop_reason_string): Likewise.
+ * python/py-symbol.c (gdbpy_lookup_symbol): Likewise.
+ (gdbpy_lookup_global_symbol): Likewise.
+ * record-full.c (record_full_restore): Likewise.
+ * regcache.c (regcache_register_status): Likewise.
+ (regcache_raw_read): Likewise.
+ (regcache_cooked_read): Likewise.
+ * rs6000-tdep.c (powerpc_set_vector_abi): Likewise.
+ * symtab.c (initialize_ordinary_address_classes): Likewise.
+ * target-debug.h (target_debug_print_signals): Likewise.
+ * utils.c (do_restore_current_language): Likewise.
+
2015-08-06 Clem Dickey <clemd@acm.org>
PR python/17136
for (fp_model = ARM_FLOAT_AUTO; fp_model != ARM_FLOAT_LAST; fp_model++)
if (strcmp (current_fp_model, fp_model_strings[fp_model]) == 0)
{
- arm_fp_model = fp_model;
+ arm_fp_model = (enum arm_float_model) fp_model;
break;
}
for (arm_abi = ARM_ABI_AUTO; arm_abi != ARM_ABI_LAST; arm_abi++)
if (strcmp (arm_abi_string, arm_abi_strings[arm_abi]) == 0)
{
- arm_abi_global = arm_abi;
+ arm_abi_global = (enum arm_abi_kind) arm_abi;
break;
}
for (i = 0; i < x->len;)
{
- enum agent_op op = x->buf[i];
+ enum agent_op op = (enum agent_op) x->buf[i];
if (op >= (sizeof (aop_map) / sizeof (aop_map[0]))
|| !aop_map[op].name)
if (type != C_STRING
&& type != $1.tokens[i].type)
error (_("Undefined string concatenation."));
- type = $1.tokens[i].type;
+ type = (enum c_string_type) $1.tokens[i].type;
break;
default:
/* internal error */
while (op_ptr < op_end)
{
- enum dwarf_location_atom op = *op_ptr;
+ enum dwarf_location_atom op = (enum dwarf_location_atom) *op_ptr;
uint64_t reg;
int64_t offset;
int ndx = op_ptr - base;
while (op_ptr < op_end)
{
- enum dwarf_location_atom op = *op_ptr;
+ enum dwarf_location_atom op = (enum dwarf_location_atom) *op_ptr;
uint64_t uoffset, reg;
int64_t offset;
demangler_special
: DEMANGLER_SPECIAL start
- { $$ = make_empty ($1);
+ { $$ = make_empty ((enum demangle_component_type) $1);
d_left ($$) = $2;
d_right ($$) = NULL; }
| CONSTRUCTION_VTABLE start CONSTRUCTION_IN start
while (op_ptr < op_end)
{
- enum dwarf_location_atom op = *op_ptr++;
+ enum dwarf_location_atom op = (enum dwarf_location_atom) *op_ptr++;
ULONGEST result;
/* Assume the value is not in stack memory.
Code that knows otherwise sets this to 1.
while (op_ptr < op_end)
{
- enum dwarf_location_atom op = *op_ptr;
+ enum dwarf_location_atom op = (enum dwarf_location_atom) *op_ptr;
uint64_t uoffset, reg;
int64_t offset;
int i;
&& (all
|| (data[0] != DW_OP_piece && data[0] != DW_OP_bit_piece)))
{
- enum dwarf_location_atom op = *data++;
+ enum dwarf_location_atom op = (enum dwarf_location_atom) *data++;
uint64_t ul;
int64_t l;
const char *name;
/* Get accessibility. */
attr = dwarf2_attr (die, DW_AT_accessibility, cu);
if (attr)
- accessibility = DW_UNSND (attr);
+ accessibility = (enum dwarf_access_attribute) DW_UNSND (attr);
else
accessibility = dwarf2_default_access_attribute (die, cu);
switch (accessibility)
attr = dwarf2_attr (die, DW_AT_ordering, cu);
- if (attr) return DW_SND (attr);
+ if (attr)
+ return (enum dwarf_array_dim_ordering) DW_SND (attr);
/* GNU F77 is a special case, as at 08/2004 array type info is the
opposite order to the dwarf2 specification, but data is still
/* read in abbrev header */
cur_abbrev->number = abbrev_number;
- cur_abbrev->tag = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ cur_abbrev->tag
+ = (enum dwarf_tag) read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
abbrev_ptr += bytes_read;
cur_abbrev->has_children = read_1_byte (abfd, abbrev_ptr);
abbrev_ptr += 1;
* sizeof (struct attr_abbrev)));
}
- cur_attrs[cur_abbrev->num_attrs].name = abbrev_name;
- cur_attrs[cur_abbrev->num_attrs++].form = abbrev_form;
+ cur_attrs[cur_abbrev->num_attrs].name
+ = (enum dwarf_attribute) abbrev_name;
+ cur_attrs[cur_abbrev->num_attrs++].form
+ = (enum dwarf_form) abbrev_form;
abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
abbrev_ptr += bytes_read;
abbrev_form = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
unsigned int bytes_read;
struct dwarf_block *blk;
- attr->form = form;
+ attr->form = (enum dwarf_form) form;
switch (form)
{
case DW_FORM_ref_addr:
for (i = 0; i < arg; ++i)
{
- mac_ptr = skip_form_bytes (abfd, mac_ptr, mac_end, defn[i], offset_size,
+ mac_ptr = skip_form_bytes (abfd, mac_ptr, mac_end,
+ (enum dwarf_form) defn[i], offset_size,
section);
if (mac_ptr == NULL)
{
break;
}
- macinfo_type = read_1_byte (abfd, mac_ptr);
+ macinfo_type = (enum dwarf_macro_record_type) read_1_byte (abfd, mac_ptr);
mac_ptr++;
/* Note that we rely on the fact that the corresponding GNU and
/* We don't increment mac_ptr here, so this is just
a look-ahead. */
- next_type = read_1_byte (abfd, mac_ptr);
+ next_type
+ = (enum dwarf_macro_record_type) read_1_byte (abfd,
+ mac_ptr);
if (next_type != 0)
complaint (&symfile_complaints,
_("no terminating 0-type entry for "
break;
}
- macinfo_type = read_1_byte (abfd, mac_ptr);
+ macinfo_type = (enum dwarf_macro_record_type) read_1_byte (abfd, mac_ptr);
mac_ptr++;
/* Note that we rely on the fact that the corresponding GNU and
int pc = (*pos) + 1;
LONGEST low_bound, high_bound;
struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
- enum f90_range_type range_type = longest_to_int (exp->elts[pc].longconst);
+ enum f90_range_type range_type
+ = (enum f90_range_type) longest_to_int (exp->elts[pc].longconst);
*pos += 3;
/* These are all stored in GC space so that we don't have to worry about
freeing them if we throw an exception. */
p_smob->name = name;
- p_smob->cmd_class = cmd_class;
+ p_smob->cmd_class = (enum command_class) cmd_class;
p_smob->type = (enum var_types) param_type;
p_smob->doc = doc;
p_smob->set_doc = set_doc;
enum { i386_syscall_max = 499 };
if (syscall <= i386_syscall_max)
- return syscall;
+ return (enum gdb_syscall) syscall;
else
return gdb_sys_no_syscall;
}
sig_print_header ();
for (; signum < nsigs; signum++)
if (sigs[signum])
- sig_print_info (signum);
+ sig_print_info ((enum gdb_signal) signum);
}
break;
mem_region_init (r);
r->lo = *start_p;
r->hi = r->lo + *length_p;
- r->attrib.mode = *type_p;
+ r->attrib.mode = (enum mem_access_mode) *type_p;
r->attrib.blocksize = -1;
}
int i;
for (i = 1; i < GDB_OSABI_INVALID; i++)
- if (strcmp (set_osabi_string, gdbarch_osabi_name (i)) == 0)
- {
- user_selected_osabi = i;
- user_osabi_state = osabi_user;
- break;
- }
+ {
+ enum gdb_osabi osabi = (enum gdb_osabi) i;
+
+ if (strcmp (set_osabi_string, gdbarch_osabi_name (osabi)) == 0)
+ {
+ user_selected_osabi = osabi;
+ user_osabi_state = osabi_user;
+ break;
+ }
+ }
if (i == GDB_OSABI_INVALID)
internal_error (__FILE__, __LINE__,
_("Invalid OS ABI \"%s\" passed to command handler."),
case OP_F90_RANGE:
oplen = 3;
+ range_type = (enum f90_range_type)
+ longest_to_int (expr->elts[endpos - 2].longconst);
- range_type = longest_to_int (expr->elts[endpos - 2].longconst);
switch (range_type)
{
case LOW_BOUND_DEFAULT:
static enum gdb_syscall
ppc_canonicalize_syscall (int syscall)
{
+ int result = -1;
+
if (syscall <= 165)
- return syscall;
+ result = syscall;
else if (syscall >= 167 && syscall <= 190) /* Skip query_module 166 */
- return syscall + 1;
+ result = syscall + 1;
else if (syscall >= 192 && syscall <= 197) /* mmap2 */
- return syscall;
+ result = syscall;
else if (syscall == 208) /* tkill */
- return gdb_sys_tkill;
+ result = gdb_sys_tkill;
else if (syscall >= 207 && syscall <= 220) /* gettid */
- return syscall + 224 - 207;
+ result = syscall + 224 - 207;
else if (syscall >= 234 && syscall <= 239) /* exit_group */
- return syscall + 252 - 234;
- else if (syscall >= 240 && syscall <=248) /* timer_create */
- return syscall += 259 - 240;
- else if (syscall >= 250 && syscall <=251) /* tgkill */
- return syscall + 270 - 250;
+ result = syscall + 252 - 234;
+ else if (syscall >= 240 && syscall <= 248) /* timer_create */
+ result = syscall += 259 - 240;
+ else if (syscall >= 250 && syscall <= 251) /* tgkill */
+ result = syscall + 270 - 250;
else if (syscall == 336)
- return gdb_sys_recv;
+ result = gdb_sys_recv;
else if (syscall == 337)
- return gdb_sys_recvfrom;
+ result = gdb_sys_recvfrom;
else if (syscall == 342)
- return gdb_sys_recvmsg;
- return -1;
+ result = gdb_sys_recvmsg;
+
+ return (enum gdb_syscall) result;
}
/* Record registers which might be clobbered during system call.
return NULL;
}
- str = unwind_stop_reason_to_string (reason);
+ str = unwind_stop_reason_to_string ((enum unwind_stop_reason) reason);
return PyUnicode_Decode (str, strlen (str), host_charset (), NULL);
}
TRY
{
- symbol = lookup_symbol (name, block, domain, &is_a_field_of_this).symbol;
+ symbol = lookup_symbol (name, block, (domain_enum) domain,
+ &is_a_field_of_this).symbol;
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
- symbol = lookup_global_symbol (name, NULL, domain).symbol;
+ symbol = lookup_global_symbol (name, NULL, (domain_enum) domain).symbol;
}
CATCH (except, RETURN_MASK_ALL)
{
bfdcore_read (core_bfd, osec, &signal,
sizeof (signal), &bfd_offset);
signal = netorder32 (signal);
- rec->u.end.sigval = signal;
+ rec->u.end.sigval = (enum gdb_signal) signal;
/* Get insn count. */
bfdcore_read (core_bfd, osec, &count,
else
gdb_assert (regnum < regcache->descr->nr_raw_registers);
- return regcache->register_status[regnum];
+ return (enum register_status) regcache->register_status[regnum];
}
void
memcpy (buf, register_buffer (regcache, regnum),
regcache->descr->sizeof_register[regnum]);
- return regcache->register_status[regnum];
+ return (enum register_status) regcache->register_status[regnum];
}
enum register_status
else
memset (buf, 0, regcache->descr->sizeof_register[regnum]);
- return regcache->register_status[regnum];
+ return (enum register_status) regcache->register_status[regnum];
}
else if (gdbarch_pseudo_register_read_value_p (regcache->descr->gdbarch))
{
if (strcmp (powerpc_vector_abi_string,
powerpc_vector_strings[vector_abi]) == 0)
{
- powerpc_vector_abi_global = vector_abi;
+ powerpc_vector_abi_global = (enum powerpc_vector_abi) vector_abi;
break;
}
int i;
for (i = 0; i < LOC_FINAL_VALUE; ++i)
- symbol_impl[i].aclass = i;
+ symbol_impl[i].aclass = (enum address_class) i;
}
\f
for (i = 0; i < GDB_SIGNAL_LAST; i++)
if (sigs[i])
- fprintf_unfiltered (gdb_stdlog, " %s", gdb_signal_to_name (i));
+ {
+ fprintf_unfiltered (gdb_stdlog, " %s",
+ gdb_signal_to_name ((enum gdb_signal) i));
+ }
}
fputs_unfiltered (" }", gdb_stdlog);
}
static void
do_restore_current_language (void *p)
{
- enum language saved_lang = (uintptr_t) p;
+ enum language saved_lang = (enum language) (uintptr_t) p;
set_language (saved_lang);
}