summaryrefslogtreecommitdiff
path: root/gdb/top.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename "set/show remotebaud" command into "set/show serial baud"Joel Brobecker2013-10-101-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch renames the "set/show remotebaud" commands into "set/show serial baud", and moves its implementation into serial.c. It also moves the "baud_rate" global from top.c to serial.c, where the new code is being added (the alternative was to add an include of target.h). And to facilitate the transition to the new setting name, this patch also preserves the old commands, and marks them as deprecated to alert the users of the change. gdb/ChangeLog: * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as serial_baud_show_cmd. (_initialize_cli_cmds): Delete the code creating the "set/show remotebaud" commands. * serial.c (baud_rate): Move here from top.c. (serial_baud_show_cmd): Move here from cli/cli-cmds.c. (_initialize_serial): Create "set/show serial baud" commands. Add "set/show remotebaud" command aliases. * top.c (baud_rate): Moved to serial.c. * NEWS: Document the new "set/show serial baud" commands, replacing "set/show remotebaud". gdb/doc/ChangeLog: * gdb.texinfo: Replace "set remotebaud" and "show remotebaud" by "set serial baud" and "show serial baud" (resp) throughout.
* Remove use of deprecated_init_ui_hook from quit_confirm.aburgess2013-09-091-12/+3
| | | | | | | | https://sourceware.org/ml/gdb-patches/2013-09/msg00224.html gdb/ChangeLog * top.c (quit_confirm): Remove use of deprecated_init_ui_hook.
* Remove deprecated_command_loop_hook.aburgess2013-09-051-5/+0
| | | | | | | | | | | | | | https://sourceware.org/ml/gdb-patches/2013-09/msg00174.html gdb/ChangeLog * gdb/defs.h (deprecated_command_loop_hook): Remove, including references in comments. * gdb/interps.c (current_interp_command_loop): No longer use deprecated_command_loop_hook. (clear_interpreter_hooks): Remove deprecated_command_loop_hook setup. * gdb/top.c (deprecated_command_loop_hook): Remove.
* 2013-08-29 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-08-291-1/+1
| | | | | | | PR cli/15842 * top.c (print_gdb_version): Remove erroneous newline after help text.
* 2013-08-15 Muhammad Bilal <mbilal@codesourcery.com>mbilal2013-08-151-1/+2
| | | | | | PR cli/15841 * top.c (quit_force): Skip writing history file if input is not from terminal.
* 2013-07-30 Muhammad Bilal <mbilal@codesorcery.com>mbilal2013-07-301-1/+13
| | | | | | | | | | | | | PR gdb/15715 * top.c: Include "filenames.h". (set_history_filename): New function. (init_main): Install it as set hook of the "set history filename" command. 2013-07-30 Muhammad Bilal <mbilal@codesourcery.com> PR gdb/15715 * gdb.base/setshow.exp: Test that relative paths passed to 'set history filename' are converted to absolute paths.
* 2013-07-22 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-07-221-1/+7
| | | | | * top.c (print_gdb_version): Add help, apropos description and url to online documentation.
* top.c (print_gdb_configuration): Explain in output of --configurationEli Zaretskii2013-07-061-0/+6
| | | | what does "relocatable" mean.
* Reimplement DJGPP's .gdbinit -> gdb.ini renaming.Pedro Alves2013-07-011-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies the .gdbinit filename selection logic. We have a GDBINIT_FILENAME define that supposedly configurations would override, but none do so. Instead, the only configuration that wants a different file name instead of ".gdbinit", djgpp, does a strcpy over the gdbinit global array. This means the array needs to be sized, and the code that does that is doing the usual 'PATH_MAX/FILENAME_MAX/fallback constant/etc.' mess. Instead of all that, it's much simpler to have configure specificy the .gdbinit filename. As bonus, we can then make the "gdbinit" global array const. gdb/ 2013-07-01 Pedro Alves <palves@redhat.com> * configure.ac (GDBINIT): Define, depending on host. * go32-nat.c (init_go32_ops): Don't override gdbinit here. * top.c (PATH_MAX): Delete fallback definition. (GDBINIT_FILENAME): Delete. (gdbinit): Reimplement as const char array set to the GDBINIT string constant. * top.h (gdbinit): Make const.
* fix top.cTom Tromey2013-05-301-0/+1
| | | | | | execute_command can leak a cleanup along one return path. * top.c (execute_command): Discard 'cleanup_if_error' cleanups.
* gdb/qiyao2013-04-171-0/+9
| | | | | * top.c (print_gdb_configuration): Print configure-time parameter on using libbabeltrace or not.
* Implement a new command to show GDB build-time configuration parameters.Eli Zaretskii2013-04-121-2/+88
| | | | | | | | | | | | | | | | | | * top.c (print_gdb_configuration): New function, displays the details about GDB configure-time parameters. (print_gdb_version): Mention "show configuration". * cli/cli-cmds.c (show_configuration): New function. (_initialize_cli_cmds): Add the "show configuration" command. * main.c (captured_main) <print_configuration>: New static var. <long_options>: Use it. If --configuration was given, call print_gdb_configuration. * doc/gdb.texinfo (Mode Options): Document '-configuration'. (Help): Document "show configuration". (Bug Reporting): Add requirements to include the configuration details in bug reports.
* Accept "set foo unlimited" in integer/uinteger/zuinteger_unlimited commands.Pedro Alves2013-04-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, several commands take "0" or "-1" to mean "unlimited". "show" knows when to print "unlimited": (gdb) show height Number of lines gdb thinks are in a page is 45. (gdb) set height 0 (gdb) show height Number of lines gdb thinks are in a page is unlimited. However, the user can't herself specify "unlimited" directly: (gdb) set height unlimited No symbol table is loaded. Use the "file" command. (gdb) This patch addresses that, by adjusting the set handler for all integer/uinteger/zuinteger_unlimited commands to accept literal "unlimited". It also installs a completer. Presently, we complete on symbols by default, and at <http://sourceware.org/ml/gdb-patches/2013-03/msg00864.html> I've shown a WIP prototype that tried to keep that half working in these commands. In the end, it turned out to be more complicated than justifiable, IMO. It's super rare to want to pass the value of a variable/symbol in the program to a GDB set/show knob. That'll still work, it's just that we won't assist with completion anymore. This patch just sticks with the simple, and completes on "unlimited", and nothing else. This simplification means that "set he<tab><tab>" is all it takes to get to: "set height unlimited" The patch then goes through all integer/uinteger/zuinteger_unlimited commands in the tree, and updates both the online help and the manual to mention that "unlimited" is accepted in addition to 0/-1. In the cases where the command had no online help text at all, this adds it. I've tried to make the texts read in a way that "unlimited" is suggested before "0" or "-1" is. Tested on x86_64 Fedora 17. gdb/ 2013-04-10 Pedro Alves <palves@redhat.com> * cli/cli-decode.c (integer_unlimited_completer): New function. (add_setshow_integer_cmd, add_setshow_uinteger_cmd) (add_setshow_zuinteger_unlimited_cmd): Install the "unlimited" completer. * cli/cli-setshow.c: Include "cli/cli-utils.h". (is_unlimited_literal): New function. (do_set_command): Handle literal "unlimited" arguments. * frame.c (_initialize_frame) <set backtrace limit>: Document "unlimited". * printcmd.c (_initialize_printcmd) <set print max-symbolic-offset>: Add help text. * record-full.c (_initialize_record_full) <set record full insn-number-max>: Likewise. * record.c (_initialize_record) <set record instruction-history-size, set record function-call-history-size>: Add help text. * ser-tcp.c (_initialize_ser_tcp) <set tcp connect-timeout>: Add help text. * tracepoint.c (_initialize_tracepoint) <set trace-buffer-size>: Likewise. * source.c (_initialize_source) <set listsize>: Add help text. * utils.c (initialize_utils) <set height, set width>: Likewise. <set pagination>: Mention "set height unlimited". * valprint.c (_initialize_valprint) <set print elements, set print repeats>: Document "unlimited". gdb/doc/ 2013-04-10 Pedro Alves <palves@redhat.com> * gdb.texinfo (Process Record and Replay): Document that "set record full insn-number-max", "set record instruction-history-size" and "set record function-call-history-size" accept "unlimited". (Backtrace): Document that "set backtrace limit" accepts "unlimited". (List): Document that "set listsize" accepts "unlimited". (Print Settings)" Document that "set print max-symbolic-offset", "set print elements" and "set print repeats" accept "unlimited". (Starting and Stopping Trace Experiments): Document that "set trace-buffer-size" accepts "unlimited". (Remote Configuration): Document that "set tcp connect-timeout" accepts "unlimited". (Command History): Document that "set history size" accepts "unlimited". (Screen Size): Document that "set height" and "set width" accepts "unlimited". Adjust "set pagination"'s description to suggest "set height unlimited" instead of "set height 0". gdb/testsuite/ 2013-04-10 Pedro Alves <palves@redhat.com> * gdb.base/completion.exp: Test "set height", "set listsize" and "set trace-buffer-size" completion. * gdb.base/setshow.exp: Test "set height unlimited". * gdb.trace/trace-buffer-size.exp: Test "set trace-buffer-size unlimited".
* make -gdb-exit call disconnect_tracing too, and don't lose history if the ↵Pedro Alves2013-04-101-25/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | target errors on "quit" Gareth mentions in PR gdb/15275: "The MI '-gdb-exit' command mi_cmd_gdb_exit() never calls disconnect_tracing() and therefore exits correctly." It should, so to get out of tfind mode, as quit may detach instead of kill, and we don't want to confuse the memory/register accesses etc. of the detach process. So we should push down the disconnect tracing bits at least to quit_force. But we can't as is, as that would swallow the error thrown by answering "no" to: Trace is running but will stop on detach; detach anyway? (y or n) So to address that, we split disconnect_tracing in two. One part that does the query, and another part that does the rest, and we make quit_force call the latter. Looking at quit_force, it does several things, some of which are a bit independent of the others. It first kills/detaches, and then writes history, and then runs the final cleanups. It seems better to me to do each of these things even if the previous thing throws. E.g., as is, if something throws while detaching, then we skip writing history. Tested on x86_64 Fedora 17. gdb/ 2013-04-10 Pedro Alves <palves@redhat.com> * cli/cli-cmds.c (quit_command): Call query_if_trace_running instead of disconnect_tracing. * infcmd.c (detach_command, disconnect_command): Call query_if_trace_running. Adjust. * top.c: Include "tracepoint.h". (quit_target): Delete. Contents moved ... (quit_force): ... here. Wrap each stage of teardown in TRY_CATCH. Call disconnect_tracing before detaching.
* Forbid "set history size (INT_MAX..UINT_MAX)"Pedro Alves2013-03-271-31/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The whole readline interface is signed, and works with the 0..INT_MAX range. We don't allow setting the size to UINT_MAX directly. The documented user visible interface is "use 0 for unlimited". The UINT_MAX representation is an implementation detail we could change, e.g., by keeping a separate flag for "unlimited", which is actually what the readline interface does (stifled vs non stifled). Generically speaking, exposing this detail to clients of the interface may make our lives complicated when we find the need to extend the range of some command in the future, and it's better if users (frontends/scripts) aren't relying on anything but what we tell them to use for "unlimited". Making values other than 0 error out is the way to prevent users from using those ranges inappropriately. Quite related, note: (gdb) set history size 0xffffffff integer 4294967295 out of range But, (gdb) set history size 0xfffffffe (gdb) show history size The size of the command history is unlimited. (gdb) set history size 0x100000000 integer 4294967296 out of range If values over INT_MAX are accepted as unlimited, then there's no good argument for only accepting [INT_MAX..UINT_MAX) as valid "unlimited" magic numbers, while not accepting [UINT_MAX..inf). Making the setting's control variable of different type (unsigned int) of the rest of the related code (int) adds the need to recall that one variable among all these is unsigned, and that one need to think about whether these comparisons are signed or unsigned, along with the promotion/conversion rules. Since this is an easy to forget detail, this patch renames the variable to at least make it more obvious that this variable is not one of GNU history's public int variables, which are all signed. We don't actually need the only code that presently is affected by this, though, the code that is computing the current history's length. We can just use GNU history's history_length instead: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Variable: int history_length The number of entries currently stored in the history list. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* Return the history entry which is logically at OFFSET in the history array. OFFSET is relative to history_base. */ HIST_ENTRY * history_get (offset) int offset; { int local_index; local_index = offset - history_base; return (local_index >= history_length || local_index < 0 || the_history == 0) ? (HIST_ENTRY *)NULL : the_history[local_index]; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ At the time this code was added (gdb 4.13 ~1994), 'history_length' was extern, but not documented in readline's GNU history documents, so I guess it wasn't considered public then and the loop was the workaround. One of the warts of GDB choosing 0 to mean unlimited is that "set history size 0" behaves differently from 'HISTSIZE=0 gdb'. The latter leaves GDB with no history, while the former means "unlimited"... $ HISTSIZE=0 ./gdb ... (gdb) show history size The size of the command history is 0. We shouldn't really change what HISTSIZE=0 means, as bash, etc. also handle 0 as real zero, and zero it's what really makes sense. gdb/ 2013-03-27 Pedro Alves <palves@redhat.com> * top.c (history_size): Rename to ... (history_size_setshow_var): ... this. Add comment. (show_commands): Use readline's 'history_length' instead of computing the history length by calling history_get in a loop. (set_history_size_command): Error out for sizes over INT_MAX. Restore previous history size on invalid size. (init_history): If HISTSIZE is negative, leave the history size as zero. Add comments. (init_main): Adjust.
* Use readline's 'history_max_entries' instead of the old 'max_input_history'.Pedro Alves2013-03-261-7/+2
| | | | | | | | | | | | | | | Ref: http://www.sourceware.org/ml/gdb-patches/2002-08/msg00486.html We've long since imported a newer readline, no need to use the old compatibility variable anymore. Tested on x86_64 Fedora 17. gdb/ 2013-03-26 Pedro Alves <palves@redhat.com> * top.c (gdb_rl_operate_and_get_next): Replace max_input_history use with history_max_entries use. Remove FIXME note.
* New commands "mt set per-command {space,time,symtab} {on,off}".Doug Evans2013-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Add entry. * event-top.c: #include "maint.h". * main.c: #include "maint.h". * maint.c: #include <sys/time.h>, <time.h>, block.h, top.h, timeval-utils.h, maint.h, cli/cli-setshow.h. (per_command_time, per_command_space): New static globals. (per_command_symtab): New static global. (per_command_setlist, per_command_showlist): New static globals. (struct cmd_stats): Move here from utils.c. (set_per_command_time): Renamed from set_display_time in utils.c and moved here. All callers updated. (set_per_command_space): Renamed from set_display_space in utils.c and moved here. All callers updated. (count_symtabs_and_blocks): New function. (report_command_stats): Moved here from utils.c. Add support for printing symtab stats. Only print data if enabled before command executed. (make_command_stats_cleanup): Ditto. (sert_per_command_cmd, show_per_command_cmd): New functions. (_initialize_maint_cmds): Add new commands mt set per-command {space,time,symtab} {on,off}. * maint.h: New file. * top.c: #include "maint.h". * utils.c (reset_prompt_for_continue_wait_time): New function. (get_prompt_for_continue_wait_time): New function. * utils.h (reset_prompt_for_continue_wait_time): Declare (get_prompt_for_continue_wait_time): Declare. (make_command_stats_cleanup): Moved to maint.h. (set_display_time, set_display_space): Moved to maint.h and renamed to set_per_command_time, set_per_command_space. * cli/cli-setshow.c (parse_cli_boolean_value): Renamed from parse_binary_operation and made non-static. Don't call error, just return an error marker. All callers updated. * cli/cli-setshow.h (parse_cli_boolean_value): Declare. doc/ * gdb.texinfo (Maintenance Commands): Add docs for "mt set per-command {space,time,symtab} {on,off}". testsuite/ * gdb.base/maint.exp: Update tests for per-command stats.
* gdb/Jan Kratochvil2013-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code cleanup. * bfd-target.c (target_bfd_xclose): Remove parameter quitting. * bsd-kvm.c (bsd_kvm_close): Likewise. * bsd-uthread.c (bsd_uthread_close): Likewise. * corelow.c (core_close): Likewise. (core_close_cleanup): Remove parameter quitting from a caller. * event-top.c (async_disconnect): Likewise. * exec.c (exec_close_1): Remove parameter quitting. * go32-nat.c (go32_close): Likewise. * linux-nat.c (linux_nat_close): Remove parameter quitting. Remove parameter quitting from a caller. * mips-linux-nat.c (super_close): Remove parameter quitting from the variable. (mips_linux_close): Remove parameter quitting. Remove parameter quitting from a caller. * monitor.c (monitor_close): Remove parameter quitting. * monitor.h (monitor_close): Likewise. * record-btrace.c (record_btrace_close): Likewise. * record-full.c (record_full_close): Likewise. * remote-m32r-sdi.c (m32r_close): Remove parameter quitting and remove it also from fprintf_unfiltered. * remote-mips.c (mips_close): Remove parameter quitting. (mips_detach): Remove parameter quitting from a caller. * remote-sim.c (gdbsim_close): Remove parameter quitting. (gdbsim_close): Remove duplicate function comment. Remove parameter quitting and remove it also from printf_filtered. * remote.c (remote_close): Remove parameter quitting. * solib-svr4.c (enable_break): Remove parameter quitting from a caller. * target.c (update_current_target): Remove parameter int from to_close de_fault. (push_target, unpush_target, pop_target): Remove parameter quitting from a caller. (pop_all_targets_above, pop_all_targets): Remove parameter quitting. Remove parameter quitting from a caller. (target_preopen): Remove parameter quitting from a caller. (target_close): Remove parameter quitting. Remove parameter quitting from a caller two times. Remove parameter quitting also from fprintf_unfiltered. * target.h (struct target_ops): Remove parameter quitting and as int from fields to_xclose and to_close. (extern struct target_ops current_target): (target_close, pop_all_targets): Remove parameter quitting. Update the comment. (pop_all_targets_above): Remove parameter quitting. * top.c (quit_target): Remove parameter quitting from a caller. * tracepoint.c (tfile_close): Remove parameter quitting. * windows-nat.c (windows_close): Remove parameter quitting.
* Constify strings in tracepoint.c, lookup_cmd and the completers.Pedro Alves2013-03-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is sort of a continuation of Keith's parse_exp_1 constification patch. It started out by undoing these bits: @@ -754,9 +754,12 @@ validate_actionline (char **line, struct tmp_p = p; for (loc = t->base.loc; loc; loc = loc->next) { - p = tmp_p; - exp = parse_exp_1 (&p, loc->address, + const char *q; + + q = tmp_p; + exp = parse_exp_1 (&q, loc->address, block_for_pc (loc->address), 1); + p = (char *) q; and progressively making more things const upwards, fixing fallout, rinse repeat, until GDB built again (--enable-targets=all). That ended up constifying lookup_cmd/add_cmd and (lots of) friends, and the completers. I didn't try to constify the command hooks themselves, because I know upfront there are commands that write to the command string argument, and I think I managed to stop at a nice non-hacky split point already. I think the only non-really-super-obvious changes are tracepoint.c:validate_actionline, and tracepoint.c:trace_dump_actions. The rest is just mostly about 'char *' => 'const char *', 'char **'=> 'const char **', and the occasional (e.g., deprecated_cmd_warning) case of 'char **'=> 'const char *', where/when I noticed that nothing actually cares about the pointer to pointer output. Tested on x86_64 Fedora 17, native and gdbserver. gdb/ 2013-03-13 Pedro Alves <palves@redhat.com> * ada-lang.c (struct add_partial_datum) <text, text0, word>: Make fields const. (ada_make_symbol_completion_list): Make "text0" parameter const. * ax-gdb.c (agent_eval_command_one): Make "exp" parameter const. * breakpoint.c (condition_completer): Make "text" and "word" parameters const. Adjust. (check_tracepoint_command): Adjust to validate_actionline prototype change. (catch_syscall_completer): Make "text" and "word" parameters const. * cli/cli-cmds.c (show_user): Make "comname" local const. (valid_command_p): Make "command" parameter const. (alias_command): Make "alias_prefix" and "command_prefix" locals const. * cli/cli-decode.c (add_cmd): Make "name" parameter const. (add_alias_cmd): Make "name" and "oldname" parameters const. Adjust. No longer make copy of OLDNAME. (add_prefix_cmd, add_abbrev_prefix_cmd, add_set_or_show_cmd) (add_setshow_cmd_full, add_setshow_enum_cmd) (add_setshow_auto_boolean_cmd, add_setshow_boolean_cmd) (add_setshow_filename_cmd, add_setshow_string_cmd) (add_setshow_string_noescape_cmd) (add_setshow_optional_filename_cmd, add_setshow_integer_cmd) (add_setshow_uinteger_cmd, add_setshow_zinteger_cmd) (add_setshow_zuinteger_unlimited_cmd, add_setshow_zuinteger_cmd) (delete_cmd, add_info, add_info_alias, add_com, add_com_alias): Make "name" parameter const. (help_cmd): Rename "command" parameter to "arg". New const local "command". (find_cmd): Make "command" parameter const. (lookup_cmd_1): Make "text" parameter pointer to const. Adjust to deprecated_cmd_warning prototype change. (undef_cmd_error): Make "cmdtype" parameter const. (lookup_cmd): Make "line" parameter const. (deprecated_cmd_warning): Change type of "text" parameter to pointer to const char, from pointer to pointer to char. Adjust. (lookup_cmd_composition): Make "text" parameter const. (complete_on_cmdlist, complete_on_enum): Make "text" and "word" parameters const. * cli/cli-decode.h (struct cmd_list_element) <name>: Make field const. * cli/cli-script.c (validate_comname): Make "tem" local const. (define_command): New const local "tem_c". Use it in calls to lookup_cmd. (document_command): Make "tem" and "comfull" locals const. (show_user_1): Make "prefix" and "name" parameters const. * cli-script.h (show_user_1): Make "prefix" and "name" parameters const. * command.h (add_cmd, add_alias_cmd, add_prefix_cmd) (add_abbrev_prefix_cmd, completer_ftype, lookup_cmd, lookup_cmd_1) (deprecated_cmd_warning, lookup_cmd_composition, add_com) (add_com_alias, add_info, add_info_alias, complete_on_cmdlist) (complete_on_enum, add_setshow_enum_cmd) (add_setshow_auto_boolean_cmd, add_setshow_boolean_cmd) (add_setshow_filename_cmd, add_setshow_string_cmd) (add_setshow_string_noescape_cmd) (add_setshow_optional_filename_cmd, add_setshow_integer_cmd) (add_setshow_uinteger_cmd, add_setshow_zinteger_cmd) (add_setshow_zuinteger_cmd, add_setshow_zuinteger_unlimited_cmd): Change prototypes, constifying strings. * completer.c (noop_completer, filename_completer): Make "text" and "prefix" parameters const. (location_completer, expression_completer) (complete_line_internal): Make "text" and "prefix" parameters const and adjust. (command_completer, signal_completer): Make "text" and "prefix" parameters const. * completer.h (noop_completer, filename_completer) (expression_completer, location_completer, command_completer) (signal_completer): Change prototypes. * corefile.c (complete_set_gnutarget): Make "text" and "word" parameters const. * cp-abi.c (cp_abi_completer): Likewise. * expression.h (parse_expression_for_completion): Change prototype. * f-lang.c (f_make_symbol_completion_list): Make "text" and "word" parameters const. * infcmd.c (_initialize_infcmd): Make "cmd_name" local const. * infrun.c (handle_completer): Make "text" and "word" parameters const. * interps.c (interpreter_completer): Make "text" and "word" parameters const. * language.h (struct language_defn) <la_make_symbol_completion_list>: Make "text" and "word" parameters const. * parse.c (parse_exp_1): Move const hack to parse_exp_in_context. (parse_exp_in_context): Rename to ... (parse_exp_in_context_1): ... this. (parse_exp_in_context): Reimplement, with const hack from parse_exp_1. (parse_expression_for_completion): Make "string" parameter const. * printcmd.c (decode_format): Make "string_ptr" parameter pointer to pointer to const char. Adjust. (print_command_1): Make "exp" parameter const. (output_command): Rename to ... (output_command_const): ... this. Make "exp" parameter const. (output_command): Reimplement. (x_command): Adjust. (display_command): Rename "exp" parameter to "arg". New "exp" local, const version of "arg". * python/py-auto-load.c (gdbpy_initialize_auto_load): Make "cmd_name" local const. * python/py-cmd.c (cmdpy_destroyer): Cast const away in xfree call. (cmdpy_completer): Make "text" and "word" parameters const. (gdbpy_parse_command_name): Make "prefix_text2" local const. * python/py-param.c (add_setshow_generic): Make "tmp_name" local const. * remote.c (_initialize_remote): Make "cmd_name" local const. * symtab.c (language_search_unquoted_string): Make "text" and "p" parameters const. Adjust. (completion_list_add_fields): Make "sym_text", "text" and "word" parameters const. (struct add_name_data) <sym_text, text, word>: Make fields const. (default_make_symbol_completion_list_break_on): Make "text" and "word" parameters const. Adjust locals. (default_make_symbol_completion_list) (make_symbol_completion_list, make_symbol_completion_type) (make_symbol_completion_list_fn): Make "text" and "word" parameters const. (make_file_symbol_completion_list): Make "text", "word" and "srcfile" parameters const. Adjust locals. (add_filename_to_list): Make "text" and "word" parameters const. (struct add_partial_filename_data) <text, word>: Make fields const. (make_source_files_completion_list): Make "text" and "word" parameters const. * symtab.h (default_make_symbol_completion_list_break_on) (default_make_symbol_completion_list, make_symbol_completion_list) (make_symbol_completion_type enum type_code) (make_symbol_completion_list_fn make_file_symbol_completion_list) (make_source_files_completion_list): Change prototype. * top.c (execute_command): Adjust to pass pointer to pointer to const char to lookup_cmd, and to deprecated_cmd_warning prototype change. (set_verbose): Make "cmdname" local const. * tracepoint.c (decode_agent_options): Make "exp" parameter const, and adjust. (validate_actionline): Make "line" parameter a pointer to const char, and adjust. (encode_actions_1): Make "action_exp" local const, and adjust. (encode_actions): Adjust. (replace_comma): Delete. (trace_dump_actions): Make "action_exp" and "next_comma" locals const, and adjust. Don't frob the action string while splitting it at commas. Instead, make a copy of each split substring in turn. (trace_dump_command): Adjust to validate_actionline prototype change. * tracepoint.h (decode_agent_options, decode_agent_options) (encode_actions, validate_actionline): Change prototypes. * valprint.h (output_command): Delete declaration. (output_command_const): Declare. * value.c (function_destroyer): Cast const away in xfree call.
* gdb/qiyao2013-01-251-0/+1
| | | | | | | | | | | | | | | | | | * event-loop.c: Include "queue.h". (gdb_event_p): New typedef. (DECLARE_QUEUE_P): Use. (DEFINE_QUEUE_P): Use. (async_queue_event): Remove. (gdb_event_xfree): New. (initialize_event_loop): New. (process_event): Use QUEUE macros. (event_queue): Remove. (gdb_wait_for_event): Caller update. (check_async_event_handlers): Likewise. (poll_timers): Likewise. * event-loop.h (initialize_event_loop): Declare. * event-loop.c (gdb_event_xfree): New. * top.c (gdb_init): Call initialize_event_loop.
* PR cli/7719:Tom Tromey2013-01-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Update. * ada-valprint.c (printstr, print_field_values): Remove "inspect_it" code. * cp-valprint.c (cp_print_value_fields): Remove "inspect_it" code. * jv-valprint.c (java_print_value_fields): Remove "inspect_it" code. * m2-lang.c (m2_printstr): Remove "inspect_it" code. * main.c (captured_main): Remove "epoch" argument. * objc-lang.c (objc_printstr): Remove "inspect_it" code. * p-lang.c (pascal_printstr): Remove "inspect_it" code. * p-valprint.c (pascal_object_print_value_fields): Remove "inspect_it" code. * printcmd.c (print_command_1): Remove 'inspect' argument. (print_command, call_command): Update. (inspect_command): Remove. (_initialize_printcmd): Make "inspect" an alias for "print". * top.c (epoch_interface): Remove. * top.h (epoch_interface): Remove. * valprint.c (user_print_options): Update. (print_converted_chars_to_obstack): Remove "inspect_it" code. * valprint.h (struct value_print_options) <inspect_it>: Remove field. doc * gdb.texinfo (Mode Options): Don't mention -epoch. (Data, Emacs): Remove obsolete comments.
* Update years in copyright notice for the GDB files.Joel Brobecker2013-01-011-1/+1
| | | | | | | Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
* Update copyright year in gdb/gdbserver/gdbreplay version output.Joel Brobecker2013-01-011-1/+1
| | | | | | | | | | | gdb/ChangeLog: * top.c (print_gdb_version): Update copyright year. gdb/gdbserver/ChangeLog: * gdbreplay.c (gdbreplay_version): Update copyright year. * server.c (gdbserver_version): Likewise.
* * Makefile.in (init.c): Declare initialize_all_files;Tom Tromey2012-12-181-1/+2
| | | | | | | | don't include call-cmds.h. * call-cmds.h: Remove. * symtab.c: Don't include call-cmds.h. * top.c: Don't include call-cmds.h. Declare initialize_all_files.
* * top.c (xgdb_verbose): Remove.Tom Tromey2012-12-171-1/+0
|
* gdb/qiyao2012-08-281-13/+14
| | | | | | | | | | | | | | | | | | | | | * cli/cli-cmds.c (max_user_call_depth): Add 'unsigned'. (init_cmds): Call add_setshow_uinteger_cmd for command 'max-user-call-depth'. * cli/cli-script.c (execute_user_command): Add 'unsigned' to the declaration of 'max_user_call_depth'. * frame.c (backtrace_limit): Add 'unsigned'. (_initialize_frame): Call add_setshow_uinteger_cmd for command 'limit'. * remote.c (remoteaddresssize): Add 'unsigned'. (remote_address_masked): Change local var 'address_size' to 'unsigned'. (_initialize_remote): Call add_setshow_uinteger_cmd for 'remoteaddresssize'. * top.c (history_size): Add 'unsigned'. (show_commands): Change local variables to 'unsigned'. (set_history_size_command): Don't check history_size is negative. Adjust the condition to call unstifle_history and set history_size to UNIT_MAX.
* * defs.h (quit_flag): Don't declare.Tom Tromey2012-08-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (clear_quit_flag, check_quit_flag, set_quit_flag): Declare. (QUIT): Use new functions. * event-top.c (command_handler): Use clear_quit_flag. (handle_sigint): Use set_quit_flag. (async_request_quit): Use check_quit_flag. Don't check immediate_quit. * exceptions.c (throw_exception): Use clear_quit_flag. * main.c (captured_main): Use clear_quit_flag. * python/python.c (clear_quit_flag, set_quit_flag) (check_quit_flag): New functions. * remote-sim.c (gdb_os_poll_quit): Use check_quit_flag, clear_quit_flag. * remote.c (remote_wait_as): Use check_quit_flag, clear_quit_flag. (remote_start_remote): Call QUIT. * symfile.c (load_progress): Use check_quit_flag. * top.c (command_loop): Use clear_quit_flag. (command_line_input): Call QUIT. * utils.c (quit_flag): Conditionally define. (clear_quit_flag, check_quit_flag, set_quit_flag): New functions. (prompt_for_continue): Call QUIT. Use quit, not async_request_quit. * remote-mips.c (mips_expect_timeout): Call QUIT. * monitor.c (monitor_expect): Call QUIT.
* gdb/qiyao2012-08-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cli/cli-decode.c (set_cmd_prefix): New. (lookup_cmd_for_prefixlist): New. (add_prefix_cmd): Call set_cmd_prefix and update field 'prefix' of each cmd_list_element in *prefixlist. (add_setshow_cmd_full): set_cmd_prefix. (add_alias_cmd): Likewise. * cli/cli-decode.h (struct cmd_list_element) <prefix>: New field. Declare 'auto_boolean_enums'. * cli/cli-setshow.c: Include "observer.h". (notify_command_param_changed_p): New. (add_setshow_auto_boolean_cmd): Move auto_boolean_enums out. Remove 'static'. (do_setshow_command): Split it to ... (do_set_command, do_show_command): ... them. New. (do_set_command): Call observer_notify_command_param_changed if notify_command_param_changed_p returns true. (cmd_show_list): Caller update. * auto-load.c (set_auto_load_cmd): Likewise. * remote.c (show_remote_cmd): Likewise. * cli/cli-setshow.h: Update declarations. * top.c (execute_command): Call do_set_command and do_show_command. * NEWS: Mention new MI notification. * mi/mi-interp.c: Declare mi_command_param_changed. (mi_interpreter_init): Attach mi_command_param_changed to observer command_param_changed. (mi_command_param_changed): New. Remove mi_suppress_breakpoint_notifications. Define global variable mi_suppress_notification. (mi_breakpoint_created): Update. (mi_breakpoint_deleted): Likewise. (mi_breakpoint_modified): Likewise. * mi/mi-main.c (mi_cmd_execute): Likewise. Check command 'gdb-set' and set mi_suppress_notification. * mi/mi-main.h: (mi_suppress_notification): New struct. gdb/doc/ * observer.texi: New observer command_param_changed. * gdb.texinfo (GDB/MI Async Records): Doc for '=cmd-param-changed'. gdb/testsuite/ * gdb.mi/mi-cmd-param-changed.exp: New. * gdb.mi/mi-cli.exp: Update for MI notification "=cmd-param-changed". * gdb.mi/mi-var-rtti.exp, gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi2-prompt.exp: Likewise.
* gdb/qiyao2012-07-311-1/+1
| | | | | | * go32-nat.c: Declare _initialize_go32_nat. * ser-go32.c: Declare _initialize_ser_dos. * top.c (do_chdir_cleanup): Add 'static'.
* gdb/Jan Kratochvil2012-05-111-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide $ddir substitution for --with-auto-load-safe-path. * NEWS (--with-auto-load-safe-path, --without-auto-load-safe-path): New entries. * auto-load.c: Include observer.h. (auto_load_safe_path_vec_update): Call substitute_path_component for each component. New variable ddir_subst. (auto_load_gdb_datadir_changed): New function. (set_auto_load_safe_path): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to AUTO_LOAD_SAFE_PATH. New comment. (_initialize_auto_load): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to AUTO_LOAD_SAFE_PATH. Install auto_load_gdb_datadir_changed. * config.in: Regenerate. * configure: Regenerate. * configure.ac (--auto-load-safe-path): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to AUTO_LOAD_SAFE_PATH. Default to GDB_DATADIR/auto-load. * defs.h (substitute_path_component): New declaration. * top.c: Include observer.h. (set_gdb_datadir): New function. (init_main): Install it for "set data-directory". * utils.c (substitute_path_component): New function. gdb/doc/ Provide $ddir substitution for --with-auto-load-safe-path. * gdb.texinfo (Auto-loading): Replace /usr/local by $ddir/auto-load. (Auto-loading safe path): Likewise. Mention the default value, $ddir substitution, --with-auto-load-safe-path and --without-auto-load-safe-path. * observer.texi (gdb_datadir_changed): New.
* * top.c (quit_target): Use all_cleanups.Tom Tromey2012-04-191-2/+2
| | | | | * main.c (captured_command_loop): Use all_cleanups. * exceptions.c (throw_exception): Use all_cleanups.
* * NEWS: Mention new python command class gdb.COMMAND_USER.Doug Evans2012-03-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * cli/cli-cmds.c (show_user): Print error when used on a python command. (init_cli_cmds): Update documentation strings for "show user" and "set/show max-user-call-depth" to clarify that it does not apply to python commands. * python/py-cmd.c (cmdpy_init): Treat class_user as a valid class in error check. (gdbpy_initialize_commands): Add COMMAND_USER as a constant in gdb python api. * top.c (execute_command): Only execute a user-defined command as a legacy macro if c->user_commands is set. doc/ * gdb.texinfo (Commands In Python): Put example python macro in COMMAND_USER category rather than COMMAND_OBSCURE. Document gdb.COMMAND_USER. (User-defined Commands): Update documentation to clarify "set/show max-user-call-depth" and "show user" don't apply to python commands. Update documentation to clarify "help user-defined" may also include python commands defined as COMMAND_USER. testsuite/ * gdb.python/py-cmd.exp: Add test to verify that python commands can be put in the user-defined category and that the commands appear in "help user-defined".
* 2012-01-23 Pedro Alves <palves@redhat.com>Pedro Alves2012-01-231-7/+7
| | | | | | | | | | | | * top.c (caution): Rename to ... (confirm): ... this. (show_caution): Rename to ... (show_confirm): ... this. (quit_cover): Adjust. (init_main): Adjust. * top.h (caution): Rename to ... (confirm): ... this. * utils.c (internal_vproblem, defaulted_query): Adjust.
* gdb/Pedro Alves2012-01-231-5/+7
| | | | | | | | | | | | 2012-01-23 Pedro Alves <palves@redhat.com> * top.c (caution): Update comment. (execute_command): Don't consider the current value of `caution'. gdb/testsuite/ 2012-01-23 Pedro Alves <palves@redhat.com> * gdb.base/call-signal-resume.exp: Allow output after "return".
* Copyright year update in most files of the GDB Project.Joel Brobecker2012-01-041-3/+1
| | | | | | gdb/ChangeLog: Copyright year update in most files of the GDB Project.
* gdb/gdbserver/gdbreplay: Update copyright year in version outJoel Brobecker2012-01-021-1/+1
| | | | | | | | | | | gdb/ChangeLog: * top.c (print_gdb_version): Update copyright year. gdb/gdbserver/ChangeLog: * server.c (gdbserver_version): Update copyright year. * gdbreplay.c (gdbreplay_version): Likewise.
* 2011-12-16 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-12-161-32/+42
| | | | | | | | * inf-loop.c: Include top.h. (inferior_event_handler): Call check_frame_language. * top.c (check_frame_language_change): New, factored out from ... (execute_command): ... this. Use check_frame_language_change. * top.h (check_frame_language_change): Declare.
* * event-top.c (async_disconnect): If an exception is thrown fromJoseph Myers2011-09-211-3/+2
| | | | | | | quit_cover, call pop_all_targets. Use TRY_CATCH instead of catch_errors. * top.c (quit_cover): Return void and take no arguments. * top.h (quit_cover): Update prototype.
* 2011-09-06 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-09-061-101/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * event-top.h (MAXPROMPTS, struct prompts): Delete. (set_async_annotation_level, set_async_prompt, pop_prompt) (push_prompt, new_async_prompt): Delete declarations. * top.h (get_prompt, set_prompt): Change prototype. (get_prefix, set_prefix, get_suffix, set_suffix): Delete declarations. * top.c (command_loop): (top_prompt): New global. (get_prefix, set_prefix, get_suffix, ): Delete. (get_prompt, set_prompt): Rewrite. (show_new_async_prompt): Rename to ... (show_prompt): ... this. (init_main): Adjust. Don't handle --annotate=2 here. * event-top.c (new_async_prompt): Delete. (the_prompts): Delete. (more_to_come): Make static. (display_gdb_prompt): Use top_level_prompt() to compute the top level prompt, and don't notify the before_prompt observers directly here. Always trick readline into not trying to display the prompt if sync_execution and displaying the primary prompt. If displaying a local/secondary prompt, always show it, even if sync_execution is set. (change_annotation_level): Delete. (top_level_prompt): New, based on change_annotation_level. (push_prompt, pop_prompt): Delete. (async_disable_stdin): No longer pushes prompt. (command_line_handler): No longer pushes or pops prompt. If more input is expected, call display_gdb_prompt with an explicit empty prompt. (async_stop_sig): Adjust. (set_async_annotation_level, set_async_prompt): Delete. * python/python.c (before_prompt_hook): Adjust.
* 2011-09-05 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-09-051-1/+1
| | | | | | | | | | * inf-loop.c (execute_command): Don't check if the current thread if running before synchronously waiting for command completion. * infrun.c (fetch_inferior_event): Handle "set exec-done-display" here. (normal_stop): Call async_enable_stdin here. * inf-loop.c (inferior_event_handler): Don't call async_enable_stdin, nor handle "set exec-done-display" here.
* 2011-09-02 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-09-021-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | * top.c: Include interps.h. (execute_command): If the target can async, but the interpreter is in sync mode, synchronously wait for the command to finish before returning. (execute_command_to_string): Force the interpreter to sync mode. * infrun.c: Include interps.h. (fetch_inferior_event): Don't restore the prompt yet if the interpreter is in sync mode. * interps.c (interpreter_async): New global. * interps.h (interpreter_async): Declare. * inf-loop.c: Include interps.h. (inferior_event_handler): Don't print the language change or run breakpoint commands yet if the interpreter in is sync mode. * main.c (captured_command_loop): Flip the interpreter to async mode. * cli/cli-script.c: Include interps.h. (execute_user_command, while_command, if_command): Force the interpreter to sync mode. * python/python.c: Include interps.h. (python_command, execute_gdb_command): Force the interpreter to sync mode.
* gdb/Jan Kratochvil2011-08-261-2/+4
| | | | | | | | | | | | | | | | | | | | * breakpoint.c (bpstat_do_actions): New variable cleanup_if_error, call make_bpstat_clear_actions_cleanup and discard_cleanups for it. * defs.h (make_bpstat_clear_actions_cleanup): New declaration. * exceptions.c (throw_exception): Remove the bpstat_clear_actions call. * inf-loop.c (inferior_event_handler): New variable cleanup_if_error, call make_bpstat_clear_actions_cleanup and discard_cleanups for it. Call bpstat_clear_actions for failed fetch_inferior_event_wrapper. * infrun.c (fetch_inferior_event): Call make_bpstat_clear_actions_cleanup. * top.c (execute_command): New variable cleanup_if_error, call make_bpstat_clear_actions_cleanup and discard_cleanups for it. * utils.c (do_bpstat_clear_actions_cleanup) (make_bpstat_clear_actions_cleanup): New functions. gdb/testsuite/ * gdb.base/commands.exp (error_clears_commands_left): New function. (): Call it.
* 2011-08-04 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-08-041-2/+1
| | | | | | | | | * event-loop.c (gdb_do_one_event): Remove `data' parameter. (start_event_loop): Use TRY_CATCH instead of catch_errors. * event-loop.h (gdb_do_one_event): Remove `data' parameter. * top.c (gdb_readline_wrapper): Adjust. * tui/tui-interp.c (tui_command_loop): (_initialize_tui_interp): Don't install it.
* 2011-08-04 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-08-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ui-out.h (uiout): Rename to ... (current_uiout): ... this. * ui-out.c (uiout): Rename to ... (current_uiout): ... this. * ada-lang.c (print_it_exception, print_one_exception) (print_mention_exception): Adjust. * breakpoint.c (watchpoint_check): Adjust. (print_breakpoint_location, print_one_breakpoint, breakpoint_1) (default_collect_info, watchpoints_info, print_one_catch_fork) (print_one_catch_vfork, print_one_catch_syscall) (print_one_catch_exec, mention, print_it_ranged_breakpoint) (print_one_ranged_breakpoint, print_mention_ranged_breakpoint) (print_it_watchpoint, print_mention_watchpoint) (print_it_masked_watchpoint, print_mention_masked_watchpoint) (print_it_exception_catchpoint, print_one_exception_catchpoint) (print_mention_exception_catchpoint, say_where, bkpt_print_it) (bkpt_print_mention, momentary_bkpt_print_it) (tracepoint_print_mention, update_static_tracepoint) (tracepoints_info, save_breakpoints): Adjust. * cli-out.c (field_separator): Adjust. * cp-abi.c (list_cp_abis, show_cp_abi_cmd): Adjust. * exceptions.c (catch_exceptions_with_msg, catch_errors): Adjust. * frame.c (get_current_frame): Adjust. * infcmd.c (run_command_1, print_return_value): Adjust. * inferior.c (inferior_command, info_inferiors_command): Adjust. * infrun.c (print_end_stepping_range_reason): Adjust. (print_signal_exited_reason, print_exited_reason): Adjust. (print_signal_received_reason, print_no_history_reason): Adjust. * interps.c (interp_set): Adjust. * osdata.c (info_osdata_command): Adjust. * progspace.c (maintenance_info_program_spaces_command): Adjust. * remote-fileio.c (remote_fileio_request): Adjust. * remote.c (show_remote_cmd): Adjust. * solib.c (info_sharedlibrary_command): Adjust. * source.c (print_source_lines_base): Adjust. * stack.c (print_stack_frame): Adjust. (do_gdb_disassembly, print_frame_info, print_frame): Adjust. * symfile-mem.c (add_vsyscall_page): Adjust. * symfile.c (load_progress, generic_load) (print_transfer_performance): Adjust. * thread.c (info_threads_command, restore_selected_frame) (thread_command): Adjust. * top.c (make_cleanup_restore_ui_file): Adjust. * tracepoint.c (tvariables_info_1, trace_status_mi, tfind_1) (print_one_static_tracepoint_marker): Adjust. * cli/cli-cmds.c (print_disassembly): Adjust. * cli/cli-decode.c (print_doc_line): Adjust. * cli/cli-interp.c (safe_execute_command): Adjust. * cli/cli-logging.c (set_logging_redirect, pop_output_files) (handle_redirections): Adjust. * cli/cli-script.c (show_user_1): Adjust. * cli/cli-setshow.c (do_setshow_command, cmd_show_list): Adjust. * mi/mi-cmd-break.c (breakpoint_notify): Adjust. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Adjust. * mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_path) (mi_cmd_env_dir): Adjust. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file) (print_partial_file_name, mi_cmd_file_list_exec_source_files): Adjust. * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames) (mi_cmd_stack_info_depth, mi_cmd_stack_list_args) (list_args_or_locals): Adjust. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create) (mi_cmd_var_delete, mi_cmd_var_set_format, mi_cmd_var_set_frozen) (mi_cmd_var_show_format, mi_cmd_var_info_num_children) (mi_cmd_var_list_children, mi_cmd_var_info_type) (mi_cmd_var_info_path_expression, mi_cmd_var_info_expression) (mi_cmd_var_show_attributes, mi_cmd_var_evaluate_expression) (mi_cmd_var_assign, mi_cmd_var_update, varobj_update_one): Adjust. * mi/mi-interp.c (mi_on_normal_stop): Adjust. * mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_thread_select) (mi_cmd_thread_list_ids, mi_cmd_thread_info, print_one_inferior) (list_available_thread_groups, mi_cmd_list_thread_groups) (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers) (mi_cmd_data_list_register_values, get_register) (mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory) (mi_cmd_data_read_memory_bytes, mi_cmd_list_features) (mi_cmd_list_target_features, mi_cmd_add_inferior) (mi_execute_command, mi_load_progress): Adjust. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Adjust. * python/py-auto-load.c (print_script, info_auto_load_scripts): Adjust. * python/py-breakpoint.c (bppy_get_commands): Adjust. * tui/tui-interp.c (tui_command_loop): Adjust. * tui/tui-io.c (tui_setup_io, tui_initialize_io): Adjust.
* 2011-07-22 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2011-07-221-16/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | * event-top.c (cli_command_loop): Use get_prompt, get_suffix, get_prefix. (display_gdb_prompt): Likewise. (change_annotation_level): Likewise. (push_prompt): Likewise. (pop_prompt): Likewise. (handle_stop_sig): Use get_prompt with a level. * top.c (command_loop): Use get_prompt with a level. (set_async_annotation_level): Use set_prompt with a level. (get_prefix): New function. (set_prefix): Ditto. (set_suffix): Ditto. (get_suffix): Ditto. (get_prompt): Accept a level argument. (set_prompt): Accept a level argument. Free old prompts. Set new_async_prompt if level is 0. (init_main): Use set_prompt with a level. Do not set new_async_prompt. * event-top.h (PROMPT, SUFFIX, PREFIX): Move to top.c * top.h: Declare set_suffix, get_suffix, set_prefix, get_prefix. Modify set_prompt, get_prompt to account for levels. * tui/tui-interp.c (tui_command_loop): Use get_prompt with a level * python/python.c (before_prompt_hook): Use set_prompt.
* 2011-07-21 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2011-07-211-7/+10
| | | | | | | | | | | | | | | | | | | | Tom Tromey <tromey@redhat.com> * top.c (set_prompt): Rewrite to free previous prompt, free asynch_new_prompt and set both on new prompts. * event-top.c (display_gdb_prompt): Add prompt substitution logic. * python/python.c (before_prompt_hook): New function. 2011-07-21 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/python.exp: Add prompt substitution tests. 2011-07-21 Phil Muldoon <pmuldoon@redhat.com> * observer.texi (GDB Observers): Add before_prompt observer. * gdb.texinfo (Basic Python): Add documentation for prompt substitution.
* * valops.c (find_overload_match): Call do_cleanups before earlyTom Tromey2011-06-271-2/+8
| | | | | | | | | | | | | | | | | | | return. * top.c (execute_command): Call do_cleanups before early return. (command_loop): Likewise. * stack.c (backtrace_command): Make a null cleanup early. Don't conditionally call do_cleanups. * python/py-value.c (TRY_CATCH): Move cleanup handling into TRY_CATCH. * python/py-breakpoint.c (gdbpy_breakpoint_has_py_cond): Rearrange so cleanups are always run. * mi/mi-cmd-var.c (mi_cmd_var_delete): Reset old_cleanups. * findcmd.c (parse_find_args): Call do_cleanups on early return path. * dbxread.c (elfstab_build_psymtabs): Make a null cleanup early. Don't conditionally call do_cleanups. * cli/cli-script.c (execute_user_command): Initialize 'old_chain' later.
* 2011-06-13 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-06-131-12/+13
| | | | | | | | | | | | | | | gdb/ * top.h (line): Rename to ... (saved_command_line): ... this. (linesize): Rename to ... (saved_command_line_size): ... this. * top.c (line): Rename to ... (saved_command_line): ... this. (linesize): Rename to ... (saved_command_line_size): ... this. (dont_repeat, command_line_input, dont_repeat_command): Adjust. * event-top.c (command_line_handler): Adjust. * main.c (captured_main): Adjust.
* gdb/Thiago Jung Bauermann2011-05-131-3/+12
| | | | | | | | | | | | | | | | | * mi/mi-main.c (mi_cmd_execute): Use cleanup from prepare_execute_command. * top.c (prepare_execute_command): Return cleanup. (execute_command): Use cleanup from prepare_execute_command. * top.h (prepare_execute_command): Change prototype to return cleanup. * defs.h (struct value): Add opaque declaration. (make_cleanup_value_free_to_mark): Add prototype. * utils.c (do_value_free_to_mark): New function. (make_cleanup_value_free_to_mark): Likewise. gdb/testsuite/ * gdb.python/py-function.exp: Test setting a value from a function which executes a command.
* gdbTom Tromey2011-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * windows-tdep.c (windows_xfer_shared_library): * windows-nat.c (get_module_name, windows_make_so): * v850-tdep.c (v850_handle_pushm): * utils.c (null_cleanup, gdb_realpath): * ui-out.c (get_next_header): * tracepoint.c (clear_traceframe_info): * symtab.c (lookup_symtab): * serial.h (struct serial_ops): * mipsread.c (read_alphacoff_dynamic_symtab): * infcmd.c (print_return_value): * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): * f-exp.y (parse_number): * exceptions.c (catch_exceptions): * dummy-frame.c (dummy_frame_this_id): * defs.h (struct cleanup): * breakpoint.c (disable_breakpoints_in_unloaded_shlib): * arm-tdep.c (arm_push_dummy_call): * amd64-tdep.h (amd64_collect_xsave): * amd64-tdep.c (amd64_collect_xsave): * alpha-tdep.c (alpha_heuristic_frame_unwind_cache): * README (typing): Remove duplicate words. * cli/cli-decode.c (lookup_cmd_composition): Add comma. * infrun.c (siginfo_value_read): Fix typo. * solib-frv.c (frv_fdpic_find_global_pointer): Likewise. * top.c (source_line_number): Add comma. gdb/doc * gdbint.texinfo (Register Information Functions): Remove duplicate "the". * gdb.texinfo (Emacs): Remove duplicate "to". (GDB/MI Variable Objects): Remove duplicate "the". (General Query Packets): Likewise. gdb/testsuite * gdb.mi/mi-nsmoribund.exp: * gdb.hp/gdb.objdbg/objdbg01.exp: * gdb.base/structs.exp (test_struct_returns): * gdb.base/call-sc.exp (test_scalar_returns): * gdb.base/bigcore.exp: Remove duplicate words. gdb/gdbserver * win32-low.c (handle_load_dll): Remove duplicate "the".