aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.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/main.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/main.c')
-rw-r--r--gdb/main.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 86804d2..0833c81 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -400,22 +400,26 @@ catch_command_errors_const (catch_command_errors_const_ftype *command,
return handle_command_errors (e);
}
-/* Arguments of --command option and its counterpart. */
-typedef struct cmdarg {
- /* Type of this option. */
- enum {
- /* Option type -x. */
- CMDARG_FILE,
+/* Type of this option. */
+enum cmdarg_kind
+{
+ /* Option type -x. */
+ CMDARG_FILE,
- /* Option type -ex. */
- CMDARG_COMMAND,
+ /* Option type -ex. */
+ CMDARG_COMMAND,
- /* Option type -ix. */
- CMDARG_INIT_FILE,
+ /* Option type -ix. */
+ CMDARG_INIT_FILE,
- /* Option type -iex. */
- CMDARG_INIT_COMMAND
- } type;
+ /* Option type -iex. */
+ CMDARG_INIT_COMMAND
+};
+
+/* Arguments of --command option and its counterpart. */
+typedef struct cmdarg {
+ /* Type of this option. */
+ enum cmdarg_kind type;
/* Value of this option - filename or the GDB command itself. String memory
is not owned by this structure despite it is 'const'. */