aboutsummaryrefslogtreecommitdiff
path: root/gdb/m32c-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2015-02-09 14:59:05 +0000
committerPedro Alves <palves@redhat.com>2015-02-27 17:19:15 +0000
commit52059ffd6935427d02ee418be3eceeff6fd5c066 (patch)
tree5ea61d24cc0cc0bebe9493ba00afe8877a330955 /gdb/m32c-tdep.c
parentfe978cb071b460b2d4aed2f9a71d895f84efce0e (diff)
downloadgdb-52059ffd6935427d02ee418be3eceeff6fd5c066.zip
gdb-52059ffd6935427d02ee418be3eceeff6fd5c066.tar.gz
gdb-52059ffd6935427d02ee418be3eceeff6fd5c066.tar.bz2
Fix struct, union, and enum nesting in C++
In C, an enum or structure defined inside other structure has global scope just like it had been defined outside the struct in the first place. However, in C++, such a nested structure is given a name that is nested inside the structure. This patch moves such affected structures/enums out to global scope, so that code using them works the same in C++ as it works today in C. gdb/ChangeLog: 2015-02-27 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> * dwarf2-frame.c (enum cfa_how_kind, struct dwarf2_frame_state_reg_info): Move out of struct dwarf2_frame_state. * dwarf2read.c (struct tu_stats): Move out of struct dwarf2_per_objfile. (struct file_entry): Move out of struct line_header. (struct nextfield, struct nextfnfield, struct fnfieldlist, struct typedef_field_list): Move out of struct field_info. * gdbtypes.h (enum dynamic_prop_kind, union dynamic_prop_data): Move out of struct dynamic_prop. (union type_owner, union field_location, struct field, struct range_bounds, union type_specific): Move out of struct main_type. (struct fn_fieldlist, struct fn_field, struct typedef_field) (VOFFSET_STATIC): Move out of struct cplus_struct_type. (struct call_site_target, union call_site_parameter_u, struct call_site_parameter): Move out of struct call_site. * m32c-tdep.c (enum m32c_prologue_kind): Move out of struct m32c_prologue. (enum srcdest_kind): Move out of struct srcdest. * main.c (enum cmdarg_kind): Move out of struct cmdarg. * prologue-value.h (enum prologue_value_kind): Move out of struct prologue_value. * s390-linux-tdep.c (enum s390_abi_kind): Move out of struct gdbarch_tdep. * stabsread.c (struct nextfield, struct next_fnfieldlist): Move out of struct field_info. * symfile.h (struct other_sections): Move out of struct section_addr_info. * symtab.c (struct symbol_cache_slot): Move out struct block_symbol_cache. * target-descriptions.c (enum tdesc_type_kind): Move out of typedef struct tdesc_type. * tui/tui-data.h (enum tui_line_or_address_kind): Move out of struct tui_line_or_address. * value.c (enum internalvar_kind, union internalvar_data): Move out of struct internalvar. * xtensa-tdep.h (struct ctype_cache): Move out of struct gdbarch_tdep.
Diffstat (limited to 'gdb/m32c-tdep.c')
-rw-r--r--gdb/m32c-tdep.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index f6b8289..60b5cfb 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -1010,6 +1010,19 @@ m32c_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
/* Prologue analysis. */
+enum m32c_prologue_kind
+{
+ /* This function uses a frame pointer. */
+ prologue_with_frame_ptr,
+
+ /* This function has no frame pointer. */
+ prologue_sans_frame_ptr,
+
+ /* This function sets up the stack, so its frame is the first
+ frame on the stack. */
+ prologue_first_frame
+};
+
struct m32c_prologue
{
/* For consistency with the DWARF 2 .debug_frame info generated by
@@ -1019,18 +1032,7 @@ struct m32c_prologue
/* The architecture for which we generated this prologue info. */
struct gdbarch *arch;
- enum {
- /* This function uses a frame pointer. */
- prologue_with_frame_ptr,
-
- /* This function has no frame pointer. */
- prologue_sans_frame_ptr,
-
- /* This function sets up the stack, so its frame is the first
- frame on the stack. */
- prologue_first_frame
-
- } kind;
+ enum m32c_prologue_kind kind;
/* If KIND is prologue_with_frame_ptr, this is the offset from the
CFA to where the frame pointer points. This is always zero or
@@ -1100,6 +1102,13 @@ m32c_pv_push (struct m32c_pv_state *state, pv_t value, int size)
}
+enum srcdest_kind
+{
+ srcdest_reg,
+ srcdest_partial_reg,
+ srcdest_mem
+};
+
/* A source or destination location for an m16c or m32c
instruction. */
struct srcdest
@@ -1108,7 +1117,7 @@ struct srcdest
If srcdest_partial_reg, the location is part of a register pointed
to by REG. We don't try to handle this too well.
If srcdest_mem, the location is memory whose address is ADDR. */
- enum { srcdest_reg, srcdest_partial_reg, srcdest_mem } kind;
+ enum srcdest_kind kind;
pv_t *reg, addr;
};