aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2001-06-11 16:05:25 +0000
committerEli Zaretskii <eliz@gnu.org>2001-06-11 16:05:25 +0000
commitc94fdfd0a8821bf0bfa3518f5f65b58f1aa629c2 (patch)
treef35d443db6e865ab5deace1055b78f820bad39fc /gdb/printcmd.c
parent6439fc285d589cd53d00e1eb105f060ec406f4d6 (diff)
downloadgdb-c94fdfd0a8821bf0bfa3518f5f65b58f1aa629c2.zip
gdb-c94fdfd0a8821bf0bfa3518f5f65b58f1aa629c2.tar.gz
gdb-c94fdfd0a8821bf0bfa3518f5f65b58f1aa629c2.tar.bz2
* completer.c (gdb_completer_loc_break_characters): New variable.
(line_completion_function): If we are completing on locations, back up the start of word pointer past all characters which can appear in a location spec. (location_completer): New function. * completer.h: Add prototype for location_completer. * symtab.c (make_source_files_completion_list) (add_filename_to_list, not_interesting_fname): New functions. (filename_seen): New function, body extracted from output_source_filename. (output_source_filename): Call filename_seen to check if the file was already printed. (make_symbol_completion_list): If TEXT includes a double-quoted string, return an empty list, not NULL. (make_file_symbol_completion_list): New function, similar to make_symbol_completion_list but with an additional argument SRCFILE. * symtab.h (make_file_symbol_completion_list) (make_source_files_completion_list): Add prototypes. * breakpoint.c (_initialize_breakpoint): Make location_completer be the completion function for all commands which set breakpoints and watchpoints. (top-level): #include "completer.h". * tracepoint.c (_initialize_tracepoint): Make location_completer be the completion function for the "trace" command. (top-level): #include "completer.h". * printcmd.c (_initialize_printcmd): Make location_completer be the completion function for the "print", "inspect", "call", and "disassemble" commands. (top-level): #include "completer.h". * infcmd.c (_initialize_infcmd): Make location_completer be the completion function for the "go", "jump", and "until" commands. (top-level): #include "completer.h".
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 66dc512..746a064 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -37,6 +37,7 @@
#include "annotate.h"
#include "symfile.h" /* for overlay functions */
#include "objfiles.h" /* ditto */
+#include "completer.h" /* for completion functions */
#ifdef UI_OUT
#include "ui-out.h"
#endif
@@ -2451,6 +2452,8 @@ print_insn (CORE_ADDR memaddr, struct ui_file *stream)
void
_initialize_printcmd (void)
{
+ struct cmd_list_element *c;
+
current_display_number = -1;
add_info ("address", address_info,
@@ -2473,11 +2476,12 @@ Defaults for format and size letters are those previously used.\n\
Default count is 1. Default address is following last thing printed\n\
with this command or \"print\".", NULL));
- add_com ("disassemble", class_vars, disassemble_command,
- "Disassemble a specified section of memory.\n\
+ c = add_com ("disassemble", class_vars, disassemble_command,
+ "Disassemble a specified section of memory.\n\
Default is the function surrounding the pc of the selected frame.\n\
With a single argument, the function surrounding that address is dumped.\n\
Two arguments are taken as a range of memory to dump.");
+ c->completer = location_completer;
if (xdb_commands)
add_com_alias ("va", "disassemble", class_xdb, 0);
@@ -2555,11 +2559,12 @@ variable in the program being debugged. EXP is any valid expression.\n",
You can see these environment settings with the \"show\" command.", NULL));
/* "call" is the same as "set", but handy for dbx users to call fns. */
- add_com ("call", class_vars, call_command,
- "Call a function in the program.\n\
+ c = add_com ("call", class_vars, call_command,
+ "Call a function in the program.\n\
The argument is the function name and arguments, in the notation of the\n\
current working language. The result is printed and saved in the value\n\
history, if it is not void.");
+ c->completer = location_completer;
add_cmd ("variable", class_vars, set_command,
"Evaluate expression EXP and assign result to variable VAR, using assignment\n\
@@ -2570,7 +2575,7 @@ variable in the program being debugged. EXP is any valid expression.\n\
This may usually be abbreviated to simply \"set\".",
&setlist);
- add_com ("print", class_vars, print_command,
+ c = add_com ("print", class_vars, print_command,
concat ("Print value of expression EXP.\n\
Variables accessible are those of the lexical environment of the selected\n\
stack frame, plus all those whose scope is global or an entire file.\n\
@@ -2592,11 +2597,13 @@ resides in memory.\n",
"\n\
EXP may be preceded with /FMT, where FMT is a format letter\n\
but no count or size letter (see \"x\" command).", NULL));
+ c->completer = location_completer;
add_com_alias ("p", "print", class_vars, 1);
- add_com ("inspect", class_vars, inspect_command,
+ c = add_com ("inspect", class_vars, inspect_command,
"Same as \"print\" command, except that if you are running in the epoch\n\
environment, the value is printed in its own window.");
+ c->completer = location_completer;
add_show_from_set (
add_set_cmd ("max-symbolic-offset", no_class, var_uinteger,