GNU Binutils with patches for OS216
修訂 | 00687ffd41edb1fe6a9a95e2829028cb76fe876c (tree) |
---|---|
時間 | 2004-03-24 05:41:49 |
作者 | Elena Zannoni <ezannoni@kwik...> |
Commiter | Elena Zannoni |
merge mainline changes into branch
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* GDB CLI commands. |
2 | 2 | |
3 | - Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | |
3 | + Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | This file is part of GDB. |
6 | 6 |
@@ -20,7 +20,8 @@ | ||
20 | 20 | Boston, MA 02111-1307, USA. */ |
21 | 21 | |
22 | 22 | #include "defs.h" |
23 | -#include <readline/tilde.h> | |
23 | +#include "readline/readline.h" | |
24 | +#include "readline/tilde.h" | |
24 | 25 | #include "completer.h" |
25 | 26 | #include "target.h" /* For baud_rate, remote_debug and remote_timeout */ |
26 | 27 | #include "gdb_wait.h" /* For shell escape implementation */ |
@@ -45,6 +46,10 @@ | ||
45 | 46 | #include "cli/cli-setshow.h" |
46 | 47 | #include "cli/cli-cmds.h" |
47 | 48 | |
49 | +#ifdef TUI | |
50 | +#include "tui/tui.h" /* For tui_active et.al. */ | |
51 | +#endif | |
52 | + | |
48 | 53 | #ifndef GDBINIT_FILENAME |
49 | 54 | #define GDBINIT_FILENAME ".gdbinit" |
50 | 55 | #endif |
@@ -59,8 +64,6 @@ static void pwd_command (char *, int); | ||
59 | 64 | |
60 | 65 | static void show_version (char *, int); |
61 | 66 | |
62 | -static void validate_comname (char *); | |
63 | - | |
64 | 67 | static void help_command (char *, int); |
65 | 68 | |
66 | 69 | static void show_command (char *, int); |
@@ -184,7 +187,6 @@ error_no_arg (char *why) | ||
184 | 187 | /* The "info" command is defined as a prefix, with allow_unknown = 0. |
185 | 188 | Therefore, its own definition is called only for "info" with no args. */ |
186 | 189 | |
187 | -/* ARGSUSED */ | |
188 | 190 | static void |
189 | 191 | info_command (char *arg, int from_tty) |
190 | 192 | { |
@@ -194,7 +196,6 @@ info_command (char *arg, int from_tty) | ||
194 | 196 | |
195 | 197 | /* The "show" command with no arguments shows all the settings. */ |
196 | 198 | |
197 | -/* ARGSUSED */ | |
198 | 199 | static void |
199 | 200 | show_command (char *arg, int from_tty) |
200 | 201 | { |
@@ -204,7 +205,6 @@ show_command (char *arg, int from_tty) | ||
204 | 205 | /* Provide documentation on command or list given by COMMAND. FROM_TTY |
205 | 206 | is ignored. */ |
206 | 207 | |
207 | -/* ARGSUSED */ | |
208 | 208 | static void |
209 | 209 | help_command (char *command, int from_tty) |
210 | 210 | { |
@@ -222,13 +222,12 @@ compare_strings (const void *arg1, const void *arg2) | ||
222 | 222 | |
223 | 223 | /* The "complete" command is used by Emacs to implement completion. */ |
224 | 224 | |
225 | -/* ARGSUSED */ | |
226 | 225 | static void |
227 | 226 | complete_command (char *arg, int from_tty) |
228 | 227 | { |
229 | 228 | int i; |
230 | 229 | int argpoint; |
231 | - char **completions; | |
230 | + char **completions, *point, *arg_prefix; | |
232 | 231 | |
233 | 232 | dont_repeat (); |
234 | 233 |
@@ -236,7 +235,23 @@ complete_command (char *arg, int from_tty) | ||
236 | 235 | arg = ""; |
237 | 236 | argpoint = strlen (arg); |
238 | 237 | |
239 | - completions = complete_line (arg, arg, argpoint); | |
238 | + /* complete_line assumes that its first argument is somewhere within, | |
239 | + and except for filenames at the beginning of, the word to be completed. | |
240 | + The following crude imitation of readline's word-breaking tries to | |
241 | + accomodate this. */ | |
242 | + point = arg + argpoint; | |
243 | + while (point > arg) | |
244 | + { | |
245 | + if (strchr (rl_completer_word_break_characters, point[-1]) != 0) | |
246 | + break; | |
247 | + point--; | |
248 | + } | |
249 | + | |
250 | + arg_prefix = alloca (point - arg + 1); | |
251 | + memcpy (arg_prefix, arg, point - arg); | |
252 | + arg_prefix[point - arg] = 0; | |
253 | + | |
254 | + completions = complete_line (point, arg, argpoint); | |
240 | 255 | |
241 | 256 | if (completions) |
242 | 257 | { |
@@ -252,7 +267,7 @@ complete_command (char *arg, int from_tty) | ||
252 | 267 | while (item < size) |
253 | 268 | { |
254 | 269 | int next_item; |
255 | - printf_unfiltered ("%s\n", completions[item]); | |
270 | + printf_unfiltered ("%s%s\n", arg_prefix, completions[item]); | |
256 | 271 | next_item = item + 1; |
257 | 272 | while (next_item < size |
258 | 273 | && ! strcmp (completions[item], completions[next_item])) |
@@ -275,7 +290,6 @@ is_complete_command (struct cmd_list_element *c) | ||
275 | 290 | return cmd_cfunc_eq (c, complete_command); |
276 | 291 | } |
277 | 292 | |
278 | -/* ARGSUSED */ | |
279 | 293 | static void |
280 | 294 | show_version (char *args, int from_tty) |
281 | 295 | { |
@@ -295,7 +309,6 @@ quit_command (char *args, int from_tty) | ||
295 | 309 | quit_force (args, from_tty); |
296 | 310 | } |
297 | 311 | |
298 | -/* ARGSUSED */ | |
299 | 312 | static void |
300 | 313 | pwd_command (char *args, int from_tty) |
301 | 314 | { |
@@ -303,7 +316,7 @@ pwd_command (char *args, int from_tty) | ||
303 | 316 | error ("The \"pwd\" command does not take an argument: %s", args); |
304 | 317 | getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); |
305 | 318 | |
306 | - if (!STREQ (gdb_dirbuf, current_directory)) | |
319 | + if (strcmp (gdb_dirbuf, current_directory) != 0) | |
307 | 320 | printf_unfiltered ("Working directory %s\n (canonically %s).\n", |
308 | 321 | current_directory, gdb_dirbuf); |
309 | 322 | else |
@@ -439,12 +452,11 @@ source_command (char *args, int from_tty) | ||
439 | 452 | do_cleanups (old_cleanups); |
440 | 453 | } |
441 | 454 | |
442 | -/* ARGSUSED */ | |
443 | 455 | static void |
444 | 456 | echo_command (char *text, int from_tty) |
445 | 457 | { |
446 | 458 | char *p = text; |
447 | - register int c; | |
459 | + int c; | |
448 | 460 | |
449 | 461 | if (text) |
450 | 462 | while ((c = *p++) != '\0') |
@@ -469,7 +481,6 @@ echo_command (char *text, int from_tty) | ||
469 | 481 | gdb_flush (gdb_stdout); |
470 | 482 | } |
471 | 483 | |
472 | -/* ARGSUSED */ | |
473 | 484 | static void |
474 | 485 | shell_escape (char *arg, int from_tty) |
475 | 486 | { |
@@ -514,9 +525,9 @@ shell_escape (char *arg, int from_tty) | ||
514 | 525 | p++; /* Get past '/' */ |
515 | 526 | |
516 | 527 | if (!arg) |
517 | - execl (user_shell, p, 0); | |
528 | + execl (user_shell, p, (char *) 0); | |
518 | 529 | else |
519 | - execl (user_shell, p, "-c", arg, 0); | |
530 | + execl (user_shell, p, "-c", arg, (char *) 0); | |
520 | 531 | |
521 | 532 | fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", user_shell, |
522 | 533 | safe_strerror (errno)); |
@@ -565,7 +576,7 @@ edit_command (char *arg, int from_tty) | ||
565 | 576 | /* Now should only be one argument -- decode it in SAL */ |
566 | 577 | |
567 | 578 | arg1 = arg; |
568 | - sals = decode_line_1 (&arg1, 0, 0, 0, 0); | |
579 | + sals = decode_line_1 (&arg1, 0, 0, 0, 0, 0); | |
569 | 580 | |
570 | 581 | if (! sals.nelts) return; /* C++ */ |
571 | 582 | if (sals.nelts > 1) { |
@@ -659,7 +670,7 @@ list_command (char *arg, int from_tty) | ||
659 | 670 | |
660 | 671 | /* "l" or "l +" lists next ten lines. */ |
661 | 672 | |
662 | - if (arg == 0 || STREQ (arg, "+")) | |
673 | + if (arg == 0 || strcmp (arg, "+") == 0) | |
663 | 674 | { |
664 | 675 | print_source_lines (cursal.symtab, cursal.line, |
665 | 676 | cursal.line + get_lines_to_list (), 0); |
@@ -667,7 +678,7 @@ list_command (char *arg, int from_tty) | ||
667 | 678 | } |
668 | 679 | |
669 | 680 | /* "l -" lists previous ten lines, the ones before the ten just listed. */ |
670 | - if (STREQ (arg, "-")) | |
681 | + if (strcmp (arg, "-") == 0) | |
671 | 682 | { |
672 | 683 | print_source_lines (cursal.symtab, |
673 | 684 | max (get_first_line_listed () - get_lines_to_list (), 1), |
@@ -689,7 +700,7 @@ list_command (char *arg, int from_tty) | ||
689 | 700 | dummy_beg = 1; |
690 | 701 | else |
691 | 702 | { |
692 | - sals = decode_line_1 (&arg1, 0, 0, 0, 0); | |
703 | + sals = decode_line_1 (&arg1, 0, 0, 0, 0, 0); | |
693 | 704 | |
694 | 705 | if (!sals.nelts) |
695 | 706 | return; /* C++ */ |
@@ -722,9 +733,9 @@ list_command (char *arg, int from_tty) | ||
722 | 733 | else |
723 | 734 | { |
724 | 735 | if (dummy_beg) |
725 | - sals_end = decode_line_1 (&arg1, 0, 0, 0, 0); | |
736 | + sals_end = decode_line_1 (&arg1, 0, 0, 0, 0, 0); | |
726 | 737 | else |
727 | - sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0); | |
738 | + sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0, 0); | |
728 | 739 | if (sals_end.nelts == 0) |
729 | 740 | return; |
730 | 741 | if (sals_end.nelts > 1) |
@@ -820,7 +831,6 @@ list_command (char *arg, int from_tty) | ||
820 | 831 | Two arguments are interpeted as bounds within which to dump |
821 | 832 | assembly. */ |
822 | 833 | |
823 | -/* ARGSUSED */ | |
824 | 834 | static void |
825 | 835 | disassemble_command (char *arg, int from_tty) |
826 | 836 | { |
@@ -844,8 +854,9 @@ disassemble_command (char *arg, int from_tty) | ||
844 | 854 | #if defined(TUI) |
845 | 855 | /* NOTE: cagney/2003-02-13 The `tui_active' was previously |
846 | 856 | `tui_version'. */ |
847 | - else if (tui_active) | |
848 | - low = tuiGetLowDisassemblyAddress (low, pc); | |
857 | + if (tui_active) | |
858 | + /* FIXME: cagney/2004-02-07: This should be an observer. */ | |
859 | + low = tui_get_low_disassembly_address (low, pc); | |
849 | 860 | #endif |
850 | 861 | low += FUNCTION_START_OFFSET; |
851 | 862 | } |
@@ -858,8 +869,9 @@ disassemble_command (char *arg, int from_tty) | ||
858 | 869 | #if defined(TUI) |
859 | 870 | /* NOTE: cagney/2003-02-13 The `tui_active' was previously |
860 | 871 | `tui_version'. */ |
861 | - else if (tui_active) | |
862 | - low = tuiGetLowDisassemblyAddress (low, pc); | |
872 | + if (tui_active) | |
873 | + /* FIXME: cagney/2004-02-07: This should be an observer. */ | |
874 | + low = tui_get_low_disassembly_address (low, pc); | |
863 | 875 | #endif |
864 | 876 | low += FUNCTION_START_OFFSET; |
865 | 877 | } |
@@ -920,7 +932,6 @@ make_command (char *arg, int from_tty) | ||
920 | 932 | shell_escape (p, from_tty); |
921 | 933 | } |
922 | 934 | |
923 | -/* ARGSUSED */ | |
924 | 935 | static void |
925 | 936 | show_user (char *args, int from_tty) |
926 | 937 | { |
@@ -29,6 +29,10 @@ | ||
29 | 29 | #include "cli/cli-cmds.h" |
30 | 30 | #include "cli/cli-decode.h" |
31 | 31 | |
32 | +#ifdef TUI | |
33 | +#include "tui/tui.h" /* For tui_active et.al. */ | |
34 | +#endif | |
35 | + | |
32 | 36 | #include "gdb_assert.h" |
33 | 37 | |
34 | 38 | /* Prototypes for local functions */ |
@@ -133,7 +137,7 @@ struct cmd_list_element * | ||
133 | 137 | add_cmd (char *name, enum command_class class, void (*fun) (char *, int), |
134 | 138 | char *doc, struct cmd_list_element **list) |
135 | 139 | { |
136 | - register struct cmd_list_element *c | |
140 | + struct cmd_list_element *c | |
137 | 141 | = (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element)); |
138 | 142 | struct cmd_list_element *p; |
139 | 143 |
@@ -212,8 +216,8 @@ add_alias_cmd (char *name, char *oldname, enum command_class class, | ||
212 | 216 | { |
213 | 217 | /* Must do this since lookup_cmd tries to side-effect its first arg */ |
214 | 218 | char *copied_name; |
215 | - register struct cmd_list_element *old; | |
216 | - register struct cmd_list_element *c; | |
219 | + struct cmd_list_element *old; | |
220 | + struct cmd_list_element *c; | |
217 | 221 | copied_name = (char *) alloca (strlen (oldname) + 1); |
218 | 222 | strcpy (copied_name, oldname); |
219 | 223 | old = lookup_cmd (&copied_name, *list, "", 1, 1); |
@@ -247,7 +251,7 @@ add_prefix_cmd (char *name, enum command_class class, void (*fun) (char *, int), | ||
247 | 251 | char *prefixname, int allow_unknown, |
248 | 252 | struct cmd_list_element **list) |
249 | 253 | { |
250 | - register struct cmd_list_element *c = add_cmd (name, class, fun, doc, list); | |
254 | + struct cmd_list_element *c = add_cmd (name, class, fun, doc, list); | |
251 | 255 | c->prefixlist = prefixlist; |
252 | 256 | c->prefixname = prefixname; |
253 | 257 | c->allow_unknown = allow_unknown; |
@@ -262,7 +266,7 @@ add_abbrev_prefix_cmd (char *name, enum command_class class, | ||
262 | 266 | struct cmd_list_element **prefixlist, char *prefixname, |
263 | 267 | int allow_unknown, struct cmd_list_element **list) |
264 | 268 | { |
265 | - register struct cmd_list_element *c = add_cmd (name, class, fun, doc, list); | |
269 | + struct cmd_list_element *c = add_cmd (name, class, fun, doc, list); | |
266 | 270 | c->prefixlist = prefixlist; |
267 | 271 | c->prefixname = prefixname; |
268 | 272 | c->allow_unknown = allow_unknown; |
@@ -500,10 +504,10 @@ add_show_from_set (struct cmd_list_element *setcmd, | ||
500 | 504 | void |
501 | 505 | delete_cmd (char *name, struct cmd_list_element **list) |
502 | 506 | { |
503 | - register struct cmd_list_element *c; | |
507 | + struct cmd_list_element *c; | |
504 | 508 | struct cmd_list_element *p; |
505 | 509 | |
506 | - while (*list && STREQ ((*list)->name, name)) | |
510 | + while (*list && strcmp ((*list)->name, name) == 0) | |
507 | 511 | { |
508 | 512 | if ((*list)->hookee_pre) |
509 | 513 | (*list)->hookee_pre->hook_pre = 0; /* Hook slips out of its mouth */ |
@@ -517,7 +521,7 @@ delete_cmd (char *name, struct cmd_list_element **list) | ||
517 | 521 | if (*list) |
518 | 522 | for (c = *list; c->next;) |
519 | 523 | { |
520 | - if (STREQ (c->next->name, name)) | |
524 | + if (strcmp (c->next->name, name) == 0) | |
521 | 525 | { |
522 | 526 | if (c->next->hookee_pre) |
523 | 527 | c->next->hookee_pre->hook_pre = 0; /* hooked cmd gets away. */ |
@@ -577,7 +581,7 @@ void | ||
577 | 581 | apropos_cmd (struct ui_file *stream, struct cmd_list_element *commandlist, |
578 | 582 | struct re_pattern_buffer *regex, char *prefix) |
579 | 583 | { |
580 | - register struct cmd_list_element *c; | |
584 | + struct cmd_list_element *c; | |
581 | 585 | int returnvalue=1; /*Needed to avoid double printing*/ |
582 | 586 | /* Walk through the commands */ |
583 | 587 | for (c=commandlist;c;c=c->next) |
@@ -786,7 +790,7 @@ print_doc_line (struct ui_file *stream, char *str) | ||
786 | 790 | { |
787 | 791 | static char *line_buffer = 0; |
788 | 792 | static int line_size; |
789 | - register char *p; | |
793 | + char *p; | |
790 | 794 | |
791 | 795 | if (!line_buffer) |
792 | 796 | { |
@@ -830,7 +834,7 @@ void | ||
830 | 834 | help_cmd_list (struct cmd_list_element *list, enum command_class class, |
831 | 835 | char *prefix, int recurse, struct ui_file *stream) |
832 | 836 | { |
833 | - register struct cmd_list_element *c; | |
837 | + struct cmd_list_element *c; | |
834 | 838 | |
835 | 839 | for (c = list; c; c = c->next) |
836 | 840 | { |
@@ -31,7 +31,7 @@ | ||
31 | 31 | #include "gdb_assert.h" |
32 | 32 | #include <ctype.h> |
33 | 33 | #include "target.h" |
34 | -#include <readline/readline.h> | |
34 | +#include "readline/readline.h" | |
35 | 35 | |
36 | 36 | #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) |
37 | 37 |
@@ -331,36 +331,6 @@ dump_value_command (char *cmd, char *mode) | ||
331 | 331 | } |
332 | 332 | |
333 | 333 | static void |
334 | -dump_filetype (char *cmd, char *mode, char *filetype) | |
335 | -{ | |
336 | - char *suffix = cmd; | |
337 | - | |
338 | - if (cmd == NULL || *cmd == '\0') | |
339 | - error ("Missing subcommand: try 'help %s %s'.", | |
340 | - mode[0] == 'a' ? "append" : "dump", | |
341 | - filetype); | |
342 | - | |
343 | - suffix += strcspn (cmd, " \t"); | |
344 | - | |
345 | - if (suffix != cmd) | |
346 | - { | |
347 | - if (strncmp ("memory", cmd, suffix - cmd) == 0) | |
348 | - { | |
349 | - dump_memory_to_file (suffix, mode, filetype); | |
350 | - return; | |
351 | - } | |
352 | - else if (strncmp ("value", cmd, suffix - cmd) == 0) | |
353 | - { | |
354 | - dump_value_to_file (suffix, mode, filetype); | |
355 | - return; | |
356 | - } | |
357 | - } | |
358 | - | |
359 | - error ("dump %s: unknown subcommand '%s' -- try 'value' or 'memory'.", | |
360 | - filetype, cmd); | |
361 | -} | |
362 | - | |
363 | -static void | |
364 | 334 | dump_srec_memory (char *args, int from_tty) |
365 | 335 | { |
366 | 336 | dump_memory_to_file (args, FOPEN_WB, "srec"); |
@@ -36,9 +36,6 @@ | ||
36 | 36 | |
37 | 37 | /* Prototypes for local functions */ |
38 | 38 | |
39 | -static struct cleanup * | |
40 | - make_cleanup_free_command_lines (struct command_line **arg); | |
41 | - | |
42 | 39 | static enum command_control_type |
43 | 40 | recurse_read_control_structure (struct command_line *current_cmd); |
44 | 41 |
@@ -255,7 +252,7 @@ do_restore_user_call_depth (void * call_depth) | ||
255 | 252 | void |
256 | 253 | execute_user_command (struct cmd_list_element *c, char *args) |
257 | 254 | { |
258 | - register struct command_line *cmdlines; | |
255 | + struct command_line *cmdlines; | |
259 | 256 | struct cleanup *old_chain; |
260 | 257 | enum command_control_type ret; |
261 | 258 | static int user_call_depth = 0; |
@@ -297,21 +294,25 @@ execute_control_command (struct command_line *cmd) | ||
297 | 294 | { |
298 | 295 | struct expression *expr; |
299 | 296 | struct command_line *current; |
300 | - struct cleanup *old_chain = 0; | |
297 | + struct cleanup *old_chain = make_cleanup (null_cleanup, 0); | |
301 | 298 | struct value *val; |
302 | 299 | struct value *val_mark; |
303 | 300 | int loop; |
304 | 301 | enum command_control_type ret; |
305 | 302 | char *new_line; |
306 | 303 | |
304 | + /* Start by assuming failure, if a problem is detected, the code | |
305 | + below will simply "break" out of the switch. */ | |
306 | + ret = invalid_control; | |
307 | + | |
307 | 308 | switch (cmd->control_type) |
308 | 309 | { |
309 | 310 | case simple_control: |
310 | 311 | /* A simple command, execute it and return. */ |
311 | 312 | new_line = insert_args (cmd->line); |
312 | 313 | if (!new_line) |
313 | - return invalid_control; | |
314 | - old_chain = make_cleanup (free_current_contents, &new_line); | |
314 | + break; | |
315 | + make_cleanup (free_current_contents, &new_line); | |
315 | 316 | execute_command (new_line, 0); |
316 | 317 | ret = cmd->control_type; |
317 | 318 | break; |
@@ -328,8 +329,8 @@ execute_control_command (struct command_line *cmd) | ||
328 | 329 | /* Parse the loop control expression for the while statement. */ |
329 | 330 | new_line = insert_args (cmd->line); |
330 | 331 | if (!new_line) |
331 | - return invalid_control; | |
332 | - old_chain = make_cleanup (free_current_contents, &new_line); | |
332 | + break; | |
333 | + make_cleanup (free_current_contents, &new_line); | |
333 | 334 | expr = parse_expression (new_line); |
334 | 335 | make_cleanup (free_current_contents, &expr); |
335 | 336 |
@@ -388,8 +389,8 @@ execute_control_command (struct command_line *cmd) | ||
388 | 389 | { |
389 | 390 | new_line = insert_args (cmd->line); |
390 | 391 | if (!new_line) |
391 | - return invalid_control; | |
392 | - old_chain = make_cleanup (free_current_contents, &new_line); | |
392 | + break; | |
393 | + make_cleanup (free_current_contents, &new_line); | |
393 | 394 | /* Parse the conditional for the if statement. */ |
394 | 395 | expr = parse_expression (new_line); |
395 | 396 | make_cleanup (free_current_contents, &expr); |
@@ -427,11 +428,10 @@ execute_control_command (struct command_line *cmd) | ||
427 | 428 | |
428 | 429 | default: |
429 | 430 | warning ("Invalid control type in command structure."); |
430 | - return invalid_control; | |
431 | + break; | |
431 | 432 | } |
432 | 433 | |
433 | - if (old_chain) | |
434 | - do_cleanups (old_chain); | |
434 | + do_cleanups (old_chain); | |
435 | 435 | |
436 | 436 | return ret; |
437 | 437 | } |
@@ -974,8 +974,8 @@ read_command_lines (char *prompt_arg, int from_tty) | ||
974 | 974 | void |
975 | 975 | free_command_lines (struct command_line **lptr) |
976 | 976 | { |
977 | - register struct command_line *l = *lptr; | |
978 | - register struct command_line *next; | |
977 | + struct command_line *l = *lptr; | |
978 | + struct command_line *next; | |
979 | 979 | struct command_line **blist; |
980 | 980 | int i; |
981 | 981 |
@@ -1001,7 +1001,7 @@ do_free_command_lines_cleanup (void *arg) | ||
1001 | 1001 | free_command_lines (arg); |
1002 | 1002 | } |
1003 | 1003 | |
1004 | -static struct cleanup * | |
1004 | +struct cleanup * | |
1005 | 1005 | make_cleanup_free_command_lines (struct command_line **arg) |
1006 | 1006 | { |
1007 | 1007 | return make_cleanup (do_free_command_lines_cleanup, arg); |
@@ -1040,7 +1040,7 @@ copy_command_lines (struct command_line *cmds) | ||
1040 | 1040 | static void |
1041 | 1041 | validate_comname (char *comname) |
1042 | 1042 | { |
1043 | - register char *p; | |
1043 | + char *p; | |
1044 | 1044 | |
1045 | 1045 | if (comname == 0) |
1046 | 1046 | error_no_arg ("name of command to define"); |
@@ -1070,8 +1070,8 @@ define_command (char *comname, int from_tty) | ||
1070 | 1070 | CMD_PRE_HOOK, |
1071 | 1071 | CMD_POST_HOOK |
1072 | 1072 | }; |
1073 | - register struct command_line *cmds; | |
1074 | - register struct cmd_list_element *c, *newc, *oldc, *hookc = 0; | |
1073 | + struct command_line *cmds; | |
1074 | + struct cmd_list_element *c, *newc, *oldc, *hookc = 0; | |
1075 | 1075 | char *tem = comname; |
1076 | 1076 | char *tem2; |
1077 | 1077 | char tmpbuf[MAX_TMPBUF]; |
@@ -1176,7 +1176,7 @@ void | ||
1176 | 1176 | document_command (char *comname, int from_tty) |
1177 | 1177 | { |
1178 | 1178 | struct command_line *doclines; |
1179 | - register struct cmd_list_element *c; | |
1179 | + struct cmd_list_element *c; | |
1180 | 1180 | char *tem = comname; |
1181 | 1181 | char tmpbuf[128]; |
1182 | 1182 |
@@ -1194,8 +1194,8 @@ document_command (char *comname, int from_tty) | ||
1194 | 1194 | xfree (c->doc); |
1195 | 1195 | |
1196 | 1196 | { |
1197 | - register struct command_line *cl1; | |
1198 | - register int len = 0; | |
1197 | + struct command_line *cl1; | |
1198 | + int len = 0; | |
1199 | 1199 | |
1200 | 1200 | for (cl1 = doclines; cl1; cl1 = cl1->next) |
1201 | 1201 | len += strlen (cl1->line) + 1; |
@@ -1233,7 +1233,6 @@ source_cleanup_lines (void *args) | ||
1233 | 1233 | error_pre_print = p->old_error_pre_print; |
1234 | 1234 | } |
1235 | 1235 | |
1236 | -/* ARGSUSED */ | |
1237 | 1236 | static void |
1238 | 1237 | do_fclose_cleanup (void *stream) |
1239 | 1238 | { |
@@ -1290,7 +1289,7 @@ script_from_file (FILE *stream, char *file) | ||
1290 | 1289 | void |
1291 | 1290 | show_user_1 (struct cmd_list_element *c, struct ui_file *stream) |
1292 | 1291 | { |
1293 | - register struct command_line *cmdlines; | |
1292 | + struct command_line *cmdlines; | |
1294 | 1293 | |
1295 | 1294 | cmdlines = c->user_commands; |
1296 | 1295 | if (!cmdlines) |
@@ -47,6 +47,8 @@ extern void print_command_lines (struct ui_out *, | ||
47 | 47 | |
48 | 48 | extern struct command_line * copy_command_lines (struct command_line *cmds); |
49 | 49 | |
50 | +struct cleanup *make_cleanup_free_command_lines (struct command_line **arg); | |
51 | + | |
50 | 52 | /* Exported to gdb/infrun.c */ |
51 | 53 | |
52 | 54 | extern void execute_user_command (struct cmd_list_element *c, char *args); |
@@ -18,7 +18,7 @@ | ||
18 | 18 | Boston, MA 02111-1307, USA. */ |
19 | 19 | |
20 | 20 | #include "defs.h" |
21 | -#include <readline/tilde.h> | |
21 | +#include "readline/tilde.h" | |
22 | 22 | #include "value.h" |
23 | 23 | #include <ctype.h> |
24 | 24 | #include "gdb_string.h" |