aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 74208de..fa976ea 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -237,12 +237,19 @@ captured_main (void *data)
/* When var field is 0, use flag field to record the equivalent
short option (or arbitrary numbers starting at 10 for those
with no equivalent). */
+ enum {
+ OPT_SE = 10,
+ OPT_CD,
+ OPT_ANNOTATE,
+ OPT_STATISTICS,
+ OPT_TUI
+ };
static struct option long_options[] =
{
{"async", no_argument, &event_loop_p, 1},
{"noasync", no_argument, &event_loop_p, 0},
#if defined(TUI)
- {"tui", no_argument, 0, 14},
+ {"tui", no_argument, 0, OPT_TUI},
#endif
{"xdb", no_argument, &xdb_commands, 1},
{"dbx", no_argument, &dbx_commands, 1},
@@ -264,9 +271,9 @@ captured_main (void *data)
{"fullname", no_argument, 0, 'f'},
{"f", no_argument, 0, 'f'},
- {"annotate", required_argument, 0, 12},
+ {"annotate", required_argument, 0, OPT_ANNOTATE},
{"help", no_argument, &print_help, 1},
- {"se", required_argument, 0, 10},
+ {"se", required_argument, 0, OPT_SE},
{"symbols", required_argument, 0, 's'},
{"s", required_argument, 0, 's'},
{"exec", required_argument, 0, 'e'},
@@ -288,7 +295,7 @@ captured_main (void *data)
{"i", required_argument, 0, 'i'},
{"directory", required_argument, 0, 'd'},
{"d", required_argument, 0, 'd'},
- {"cd", required_argument, 0, 11},
+ {"cd", required_argument, 0, OPT_CD},
{"tty", required_argument, 0, 't'},
{"baud", required_argument, 0, 'b'},
{"b", required_argument, 0, 'b'},
@@ -296,7 +303,7 @@ captured_main (void *data)
{"nowindows", no_argument, &use_windows, 0},
{"w", no_argument, &use_windows, 1},
{"windows", no_argument, &use_windows, 1},
- {"statistics", no_argument, 0, 13},
+ {"statistics", no_argument, 0, OPT_STATISTICS},
{"write", no_argument, &write_files, 1},
{"args", no_argument, &set_args, 1},
{0, no_argument, 0, 0}
@@ -320,23 +327,23 @@ captured_main (void *data)
case 0:
/* Long option that just sets a flag. */
break;
- case 10:
+ case OPT_SE:
symarg = optarg;
execarg = optarg;
break;
- case 11:
+ case OPT_CD:
cdarg = optarg;
break;
- case 12:
+ case OPT_ANNOTATE:
/* FIXME: what if the syntax is wrong (e.g. not digits)? */
annotation_level = atoi (optarg);
break;
- case 13:
+ case OPT_STATISTICS:
/* Enable the display of both time and space usage. */
display_time = 1;
display_space = 1;
break;
- case 14:
+ case OPT_TUI:
/* --tui is equivalent to -i=tui. */
xfree (interpreter_p);
interpreter_p = xstrdup ("tui");