From 49c7e3387b20434852f72ff1a53ec87e82426eab Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 2 Mar 2003 01:22:18 +0000 Subject: [PATCH] 2003-03-01 Andrew Cagney * main.c (captured_main): Replace magic option characters with an enum. --- gdb/ChangeLog | 5 +++++ gdb/main.c | 27 +++++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 546fd8cffce..e717c2685b9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-03-01 Andrew Cagney + + * main.c (captured_main): Replace magic option characters with an + enum. + 2003-03-01 Andrew Cagney * gdbarch.sh (DEPRECATED_INIT_EXTRA_FRAME_INFO): Rename diff --git a/gdb/main.c b/gdb/main.c index 74208de753a..fa976ea14a5 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"); -- 2.30.2