summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2014-06-05 14:49:17 -0600
committerTom Tromey <tromey@redhat.com>2014-06-05 14:49:17 -0600
commit29a9a977cd2af83a0b00914623ba28e14bdb4945 (patch)
treefebde7fec76f497795a6eedfad74f9f28d573011
parent3d726a2413720e3433608d416ece31f20918197a (diff)
downloadbinutils-gdb-29a9a977cd2af83a0b00914623ba28e14bdb4945.tar.gz
more random enum fixes
-rw-r--r--gdb/ax-general.c2
-rw-r--r--gdb/corefile.c6
-rw-r--r--gdb/dwarf2expr.c2
-rw-r--r--gdb/dwarf2read.c24
-rw-r--r--gdb/gnu-v2-abi.c4
-rw-r--r--gdb/mi/mi-cmd-stack.c4
-rw-r--r--gdb/mi/mi-main.c4
-rw-r--r--gdb/python/py-symbol.c5
-rw-r--r--gdb/record-full.c6
-rw-r--r--gdb/reverse.c2
-rw-r--r--gdb/utils.c2
11 files changed, 34 insertions, 27 deletions
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 5bdcb2eafec..e64001d9c01 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -392,7 +392,7 @@ ax_print (struct ui_file *f, struct agent_expr *x)
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)
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 6b9fd1e7ab5..739bcb3c793 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -278,7 +278,7 @@ read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
status = target_read_stack (memaddr, myaddr, len);
if (status != 0)
- memory_error (status, memaddr);
+ memory_error ((enum target_xfer_status) status, memaddr);
}
/* Same as target_read_code, but report an error if can't read. */
@@ -290,7 +290,7 @@ read_code (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
status = target_read_code (memaddr, myaddr, len);
if (status != 0)
- memory_error (status, memaddr);
+ memory_error ((enum target_xfer_status) status, memaddr);
}
/* Argument / return result struct for use with
@@ -437,7 +437,7 @@ write_memory (CORE_ADDR memaddr,
status = target_write_memory (memaddr, myaddr, len);
if (status != 0)
- memory_error (status, memaddr);
+ memory_error ((enum target_xfer_status) status, memaddr);
}
/* Same as write_memory, but notify 'memory_changed' observers. */
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index cadce98a876..def47d68faa 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -654,7 +654,7 @@ execute_stack_op (struct dwarf_expr_context *ctx,
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.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index eb3bf89aec4..bc7d4bf44d5 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12612,7 +12612,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
/* 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)
@@ -13511,7 +13511,7 @@ read_array_order (struct die_info *die, struct dwarf2_cu *cu)
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
@@ -14972,7 +14972,8 @@ abbrev_table_read_table (struct dwarf2_section_info *section,
/* 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;
@@ -14992,8 +14993,10 @@ abbrev_table_read_table (struct dwarf2_section_info *section,
* 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);
@@ -15831,7 +15834,7 @@ read_attribute_value (const struct die_reader_specs *reader,
unsigned int bytes_read;
struct dwarf_block *blk;
- attr->form = form;
+ attr->form = (enum dwarf_form) form;
switch (form)
{
case DW_FORM_ref_addr:
@@ -20456,7 +20459,8 @@ skip_unknown_opcode (unsigned int opcode,
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)
{
@@ -20715,7 +20719,9 @@ dwarf_decode_macro_bytes (bfd *abfd,
/* 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 "
@@ -20893,7 +20899,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
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
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index 4a488be2087..acb03c56858 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -43,7 +43,7 @@ gnuv2_is_destructor_name (const char *name)
|| strncmp (name, "__dt__", 6) == 0)
return complete_object_dtor;
else
- return 0;
+ return (enum dtor_kinds) 0;
}
static enum ctor_kinds
@@ -54,7 +54,7 @@ gnuv2_is_constructor_name (const char *name)
|| strncmp (name, "__ct__", 6) == 0)
return complete_object_ctor;
else
- return 0;
+ return (enum ctor_kinds) 0;
}
static int
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 7bc81145d48..481ea7024d4 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -201,7 +201,7 @@ mi_cmd_stack_list_locals (char *command, char **argv, int argc)
struct frame_info *frame;
int raw_arg = 0;
enum ext_lang_bt_status result = EXT_LANG_BT_ERROR;
- int print_value;
+ enum print_values print_value;
int oind = 0;
int skip_unavailable = 0;
int i;
@@ -398,7 +398,7 @@ mi_cmd_stack_list_variables (char *command, char **argv, int argc)
struct frame_info *frame;
int raw_arg = 0;
enum ext_lang_bt_status result = EXT_LANG_BT_ERROR;
- int print_value;
+ enum print_values print_value;
int oind = 0;
int skip_unavailable = 0;
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 487e5e4f115..09c23d2f2cb 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -2699,8 +2699,8 @@ mi_cmd_trace_frame_collected (char *command, char **argv, int argc)
struct collection_list tracepoint_list, stepping_list;
struct traceframe_info *tinfo;
int oind = 0;
- int var_print_values = PRINT_ALL_VALUES;
- int comp_print_values = PRINT_ALL_VALUES;
+ enum print_values var_print_values = PRINT_ALL_VALUES;
+ enum print_values comp_print_values = PRINT_ALL_VALUES;
int registers_format = 'x';
int memory_contents = 0;
struct ui_out *uiout = current_uiout;
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index 19f44c964ac..24edfde64ef 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -384,7 +384,8 @@ gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
TRY_CATCH (except, RETURN_MASK_ALL)
{
- symbol = lookup_symbol (name, block, domain, &is_a_field_of_this);
+ symbol = lookup_symbol (name, block, (enum domain_enum) domain,
+ &is_a_field_of_this);
}
GDB_PY_HANDLE_EXCEPTION (except);
@@ -434,7 +435,7 @@ gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
TRY_CATCH (except, RETURN_MASK_ALL)
{
- symbol = lookup_symbol_global (name, NULL, domain);
+ symbol = lookup_symbol_global (name, NULL, (enum domain_enum) domain);
}
GDB_PY_HANDLE_EXCEPTION (except);
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 154331ac321..98b0eada6f9 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -941,7 +941,7 @@ record_full_resume (struct target_ops *ops, ptid_t ptid, int step,
{
record_full_resume_step = step;
record_full_resumed = 1;
- record_full_execution_dir = execution_direction;
+ record_full_execution_dir = (enum exec_direction_kind) execution_direction;
if (!RECORD_FULL_IS_REPLAY)
{
@@ -1932,7 +1932,7 @@ record_full_core_resume (struct target_ops *ops, ptid_t ptid, int step,
{
record_full_resume_step = step;
record_full_resumed = 1;
- record_full_execution_dir = execution_direction;
+ record_full_execution_dir = (enum exec_direction_kind) execution_direction;
/* We are about to start executing the inferior (or simulate it),
let's register it with the event loop. */
@@ -2378,7 +2378,7 @@ record_full_restore (void)
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,
diff --git a/gdb/reverse.c b/gdb/reverse.c
index 26986fe2850..ee4bb9ee672 100644
--- a/gdb/reverse.c
+++ b/gdb/reverse.c
@@ -46,7 +46,7 @@ static void
exec_reverse_once (char *cmd, char *args, int from_tty)
{
char *reverse_command;
- enum exec_direction_kind dir = execution_direction;
+ enum exec_direction_kind dir = (enum exec_direction_kind) execution_direction;
struct cleanup *old_chain;
if (dir == EXEC_REVERSE)
diff --git a/gdb/utils.c b/gdb/utils.c
index 2266ee6f0e5..de90e2e176d 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -448,7 +448,7 @@ make_cleanup_free_so (struct so_list *so)
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);
}