aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@cygnus>1997-11-26 22:38:10 +0000
committerKeith Seitz <keiths@cygnus>1997-11-26 22:38:10 +0000
commit018d76dddba746b8e59770136e5ca167ae72e15b (patch)
treee8293e1b60e5d088247993b4a0f82b5cb585154a /gdb/top.c
parent0fa555ea6267729939ebdbbbe342dd15b23a49db (diff)
downloadfsf-binutils-gdb-018d76dddba746b8e59770136e5ca167ae72e15b.zip
fsf-binutils-gdb-018d76dddba746b8e59770136e5ca167ae72e15b.tar.gz
fsf-binutils-gdb-018d76dddba746b8e59770136e5ca167ae72e15b.tar.bz2
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on
the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * gdbtk.c (gdbtk_call_command): also run idle hooks for class_trace commands (gdbtk_init): add new commands "gdb_get_locals", "gdb_get_args", "gdb_get_function", "gdb_get_line", "gdb_get_file", "gdb_tracepoint_exists", "gdb_get_tracepoint_info", "gdb_actions", and "gdb_prompt" (gdb_get_vars_command): new function (gdb_get_line_command): new function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c65
1 files changed, 50 insertions, 15 deletions
diff --git a/gdb/top.c b/gdb/top.c
index cc1a1da..d8fd7da 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2813,8 +2813,8 @@ print_gdb_version (stream)
fprintf_filtered (stream, "\
GDB is free software, covered by the GNU General Public License, and you are\n\
welcome to change it and/or distribute copies of it under certain conditions.\n\
-Type \"show copying\" to see the conditions.\n\
-There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n");
+Type \"show copying\" to see the conditions. This version of GDB is supported This version of GDB is supported\n\
+for customers of Cygnus Solutions. Type \"show warranty\" for details.\n");
/* After the required info we print the configuration information. */
@@ -2851,9 +2851,41 @@ print_prompt ()
printf_unfiltered ("%s", prompt);
gdb_flush (gdb_stdout);
}
+
+/* This replaces the above for the frontends: it returns a pointer
+ to the prompt. */
+char *
+get_prompt ()
+{
+ return prompt;
+}
+/* If necessary, make the user confirm that we should quit. Return
+ non-zero if we should quit, zero if we shouldn't. */
+
+int
+quit_confirm ()
+{
+ if (inferior_pid != 0 && target_has_execution)
+ {
+ char *s;
+
+ if (attach_flag)
+ s = "The program is running. Quit anyway (and detach it)? ";
+ else
+ s = "The program is running. Exit anyway? ";
+
+ if (! query (s))
+ return 0;
+ }
+
+ return 1;
+}
+
+/* Quit without asking for confirmation. */
+
void
-quit_command (args, from_tty)
+quit_force (args, from_tty)
char *args;
int from_tty;
{
@@ -2871,20 +2903,11 @@ quit_command (args, from_tty)
if (inferior_pid != 0 && target_has_execution)
{
if (attach_flag)
- {
- if (query ("The program is running. Quit anyway (and detach it)? "))
- target_detach (args, from_tty);
- else
- error ("Not confirmed.");
- }
+ target_detach (args, from_tty);
else
- {
- if (query ("The program is running. Quit anyway (and kill it)? "))
- target_kill ();
- else
- error ("Not confirmed.");
- }
+ target_kill ();
}
+
/* UDI wants this, to kill the TIP. */
target_close (1);
@@ -2897,6 +2920,18 @@ quit_command (args, from_tty)
exit (exit_code);
}
+/* Handle the quit command. */
+
+void
+quit_command (args, from_tty)
+ char *args;
+ int from_tty;
+{
+ if (! quit_confirm ())
+ error ("Not confirmed.");
+ quit_force (args, from_tty);
+}
+
/* Returns whether GDB is running on a terminal and whether the user
desires that questions be asked of them on that terminal. */