2001-07-24 22:40:39 +02:00
|
|
|
/* GDB hooks for TUI.
|
2002-03-01 07:19:28 +01:00
|
|
|
|
2010-01-01 08:32:07 +01:00
|
|
|
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
2006-03-30 00:53:33 +02:00
|
|
|
Free Software Foundation, Inc.
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-23 20:08:50 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2001-07-24 22:40:39 +02:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 20:08:50 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "symtab.h"
|
|
|
|
#include "inferior.h"
|
|
|
|
#include "command.h"
|
|
|
|
#include "bfd.h"
|
|
|
|
#include "symfile.h"
|
|
|
|
#include "objfiles.h"
|
|
|
|
#include "target.h"
|
|
|
|
#include "gdbcore.h"
|
|
|
|
#include "event-loop.h"
|
2002-09-10 21:59:31 +02:00
|
|
|
#include "event-top.h"
|
2001-07-24 22:40:39 +02:00
|
|
|
#include "frame.h"
|
|
|
|
#include "breakpoint.h"
|
2002-09-10 21:59:31 +02:00
|
|
|
#include "ui-out.h"
|
|
|
|
#include "top.h"
|
2007-05-11 21:55:20 +02:00
|
|
|
#include "observer.h"
|
2001-07-24 22:40:39 +02:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
2004-01-19 05:31:53 +01:00
|
|
|
#include "tui/tui.h"
|
2004-02-10 Andrew Cagney <cagney@redhat.com>
* defs.h: Do not include "tui.h".
* gdb_curses.h: New file.
* tui/tui-hooks.h: New file.
* tui/tui.h (tui_update_all_exec_infos): Delete declaration.
(tui_install_hooks, tui_remove_hooks): Delete declarations.
(tui_initialize_io): Delete declaration.
(tui_initialize_readline: Delete redundant declaration.
(struct tui_point): Delete definition.
* tui/tui-data.h (struct tui_point): Define.
* cli/cli-decode.c [TUI]: Include "tui/tui.h".
* utils.c: Include "tui/tui.h".
* tui/tui-data.h: Include "tui/tui.h" and "gdb_curses.h".
* printcmd.c [TUI]: Include "tui/tui.h".
* cli/cli-cmds.c [TUI]: Include "tui/tui.h".
* tui/tui-command.c: Include "gdb_curses.h".
* tui/tui.c, tui/tui-winsource.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-windata.c, tui/tui-win.c, tui/tui-stack.c: Ditto.
* tui/tui-source.c, tui/tui-regs.c, tui/tui-layout.c: Ditto.
* tui/tui-io.c, tui/tui-disasm.c, tui/tui-data.c: : Ditto.
* tui/tui-hooks.c: Include "tui-hooks.h" and "gdb_curses.h".
* Makefile.in: Update all dependencies.
(tui_hooks_h, gdb_curses_h): Define.
(SUBDIR_TUI_CFLAGS): Remove -I${srcdir}/tui.
2004-02-10 20:08:19 +01:00
|
|
|
#include "tui/tui-hooks.h"
|
2004-01-19 05:31:53 +01:00
|
|
|
#include "tui/tui-data.h"
|
|
|
|
#include "tui/tui-layout.h"
|
|
|
|
#include "tui/tui-io.h"
|
|
|
|
#include "tui/tui-regs.h"
|
|
|
|
#include "tui/tui-win.h"
|
|
|
|
#include "tui/tui-stack.h"
|
|
|
|
#include "tui/tui-windata.h"
|
|
|
|
#include "tui/tui-winsource.h"
|
2001-07-24 22:40:39 +02:00
|
|
|
|
2004-02-10 Andrew Cagney <cagney@redhat.com>
* defs.h: Do not include "tui.h".
* gdb_curses.h: New file.
* tui/tui-hooks.h: New file.
* tui/tui.h (tui_update_all_exec_infos): Delete declaration.
(tui_install_hooks, tui_remove_hooks): Delete declarations.
(tui_initialize_io): Delete declaration.
(tui_initialize_readline: Delete redundant declaration.
(struct tui_point): Delete definition.
* tui/tui-data.h (struct tui_point): Define.
* cli/cli-decode.c [TUI]: Include "tui/tui.h".
* utils.c: Include "tui/tui.h".
* tui/tui-data.h: Include "tui/tui.h" and "gdb_curses.h".
* printcmd.c [TUI]: Include "tui/tui.h".
* cli/cli-cmds.c [TUI]: Include "tui/tui.h".
* tui/tui-command.c: Include "gdb_curses.h".
* tui/tui.c, tui/tui-winsource.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-windata.c, tui/tui-win.c, tui/tui-stack.c: Ditto.
* tui/tui-source.c, tui/tui-regs.c, tui/tui-layout.c: Ditto.
* tui/tui-io.c, tui/tui-disasm.c, tui/tui-data.c: : Ditto.
* tui/tui-hooks.c: Include "tui-hooks.h" and "gdb_curses.h".
* Makefile.in: Update all dependencies.
(tui_hooks_h, gdb_curses_h): Define.
(SUBDIR_TUI_CFLAGS): Remove -I${srcdir}/tui.
2004-02-10 20:08:19 +01:00
|
|
|
#include "gdb_curses.h"
|
2003-06-22 17:21:39 +02:00
|
|
|
|
2004-04-09 15:54:34 +02:00
|
|
|
/* This redefines CTRL if it is not already defined, so it must come
|
|
|
|
after terminal state releated include files like <term.h> and
|
|
|
|
"gdb_curses.h". */
|
|
|
|
#include "readline/readline.h"
|
|
|
|
|
2001-07-24 22:40:39 +02:00
|
|
|
int tui_target_has_run = 0;
|
|
|
|
|
|
|
|
static void
|
|
|
|
tui_new_objfile_hook (struct objfile* objfile)
|
|
|
|
{
|
|
|
|
if (tui_active)
|
2002-08-25 21:19:50 +02:00
|
|
|
tui_display_main ();
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|
|
|
|
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 22:56:26 +02:00
|
|
|
static int ATTR_FORMAT (printf, 1, 0)
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-hooks.c, tui-layout.c,
tui-regs.c, tui-source.c, tui-stack.c, tui-win.c, tui-windata.c,
tui-wingeneral.c, tui-wingeneral.h, tui-winsource.c, tui.c,
tui-winsource.h: Whitespace changes, fix pointer declarations
to be consistant.
2007-08-14 22:23:29 +02:00
|
|
|
tui_query_hook (const char *msg, va_list argp)
|
2001-07-24 22:40:39 +02:00
|
|
|
{
|
|
|
|
int retval;
|
|
|
|
int ans2;
|
|
|
|
int answer;
|
|
|
|
|
|
|
|
echo ();
|
|
|
|
while (1)
|
|
|
|
{
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
wrap_here (""); /* Flush any buffered output. */
|
2001-07-24 22:40:39 +02:00
|
|
|
gdb_flush (gdb_stdout);
|
|
|
|
|
|
|
|
vfprintf_filtered (gdb_stdout, msg, argp);
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up some of printf_filtered and printf_unfiltered.
* ada-lang.c, annotate.c, arch-utils.c, breakpoint.c: Update.
* corelow.c, cp-namespace.c, cp-support.c, dcache.c: Update.
* demangle.c, dsrec.c, dwarf2read.c, dwarfread.c: Update.
* event-loop.c, event-top.c, exec.c, f-valprint.c: Update.
* gdbtypes.c, inf-loop.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcmd.c, inflow.c, infrun.c, inftarg.c, language.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, maint.c: Update.
* mdebugread.c, memattr.c, monitor.c, objc-lang.c: Update.
* ocd.c, osabi.c, printcmd.c, procfs.c, regcache.c: Update.
* remote.c, solib-som.c, solib.c, somsolib.c, source.c: Update.
* stack.c, symfile.c, symmisc.c, target.c, thread.c: Update.
* top.c, utils.c, valprint.c, value.c, cli/cli-cmds.c: Update.
* cli/cli-dump.c, cli/cli-logging.c, tui/tui-hooks.c: Update.
* tui/tui-regs.c, tui/tui-win.c: Update.
2005-02-12 01:39:24 +01:00
|
|
|
printf_filtered (_("(y or n) "));
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
wrap_here ("");
|
|
|
|
gdb_flush (gdb_stdout);
|
|
|
|
|
|
|
|
answer = tui_getc (stdin);
|
|
|
|
clearerr (stdin); /* in case of C-d */
|
|
|
|
if (answer == EOF) /* C-d */
|
|
|
|
{
|
|
|
|
retval = 1;
|
|
|
|
break;
|
|
|
|
}
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Eat rest of input line, to EOF or newline. */
|
2001-07-24 22:40:39 +02:00
|
|
|
if (answer != '\n')
|
|
|
|
do
|
|
|
|
{
|
|
|
|
ans2 = tui_getc (stdin);
|
|
|
|
clearerr (stdin);
|
|
|
|
}
|
|
|
|
while (ans2 != EOF && ans2 != '\n' && ans2 != '\r');
|
|
|
|
|
|
|
|
if (answer >= 'a')
|
|
|
|
answer -= 040;
|
|
|
|
if (answer == 'Y')
|
|
|
|
{
|
|
|
|
retval = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (answer == 'N')
|
|
|
|
{
|
|
|
|
retval = 0;
|
|
|
|
break;
|
|
|
|
}
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up some of printf_filtered and printf_unfiltered.
* ada-lang.c, annotate.c, arch-utils.c, breakpoint.c: Update.
* corelow.c, cp-namespace.c, cp-support.c, dcache.c: Update.
* demangle.c, dsrec.c, dwarf2read.c, dwarfread.c: Update.
* event-loop.c, event-top.c, exec.c, f-valprint.c: Update.
* gdbtypes.c, inf-loop.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcmd.c, inflow.c, infrun.c, inftarg.c, language.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, maint.c: Update.
* mdebugread.c, memattr.c, monitor.c, objc-lang.c: Update.
* ocd.c, osabi.c, printcmd.c, procfs.c, regcache.c: Update.
* remote.c, solib-som.c, solib.c, somsolib.c, source.c: Update.
* stack.c, symfile.c, symmisc.c, target.c, thread.c: Update.
* top.c, utils.c, valprint.c, value.c, cli/cli-cmds.c: Update.
* cli/cli-dump.c, cli/cli-logging.c, tui/tui-hooks.c: Update.
* tui/tui-regs.c, tui/tui-win.c: Update.
2005-02-12 01:39:24 +01:00
|
|
|
printf_filtered (_("Please answer y or n.\n"));
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|
|
|
|
noecho ();
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2007-03-29 20:55:01 +02:00
|
|
|
/* Prevent recursion of deprecated_register_changed_hook(). */
|
2001-07-24 22:40:39 +02:00
|
|
|
static int tui_refreshing_registers = 0;
|
|
|
|
|
|
|
|
static void
|
|
|
|
tui_register_changed_hook (int regno)
|
|
|
|
{
|
|
|
|
struct frame_info *fi;
|
|
|
|
|
* frame.c (deprecated_selected_frame): Rename to...
(selected_frame): ...this. Make static.
(get_selected_frame, select_frame): Update.
* frame.h (deprected_select_frame): Delete.
(deprecated_safe_get_selected_frame): Update comments.
* breakpoint.c, cli/cli-cmds.c, f-valprint.c, infcmd.c, inflow.c,
infrun.c, stack.c, tui/tui-disasm.c, tui/tui-source.c,
tui/tui-winsource.c, valops.c, varobj.c, findvar.c, macroscope.c,
parse.c, regcache.h, sh64-tdep.c, tui/tui-hooks.c, tui/tui-win.c,
tui/tui.c: Replace references to deprecated_selected_frame.
2007-02-27 20:46:04 +01:00
|
|
|
fi = get_selected_frame (NULL);
|
|
|
|
if (tui_refreshing_registers == 0)
|
2001-07-24 22:40:39 +02:00
|
|
|
{
|
|
|
|
tui_refreshing_registers = 1;
|
2004-02-07 01:23:56 +01:00
|
|
|
tui_check_data_values (fi);
|
2001-07-24 22:40:39 +02:00
|
|
|
tui_refreshing_registers = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Breakpoint creation hook.
|
|
|
|
Update the screen to show the new breakpoint. */
|
|
|
|
static void
|
|
|
|
tui_event_create_breakpoint (int number)
|
|
|
|
{
|
2002-08-30 22:07:05 +02:00
|
|
|
tui_update_all_breakpoint_info ();
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Breakpoint deletion hook.
|
|
|
|
Refresh the screen to update the breakpoint marks. */
|
|
|
|
static void
|
|
|
|
tui_event_delete_breakpoint (int number)
|
|
|
|
{
|
2002-08-30 22:07:05 +02:00
|
|
|
tui_update_all_breakpoint_info ();
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
tui_event_modify_breakpoint (int number)
|
|
|
|
{
|
2002-08-30 22:07:05 +02:00
|
|
|
tui_update_all_breakpoint_info ();
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Called when going to wait for the target.
|
|
|
|
Leave curses mode and setup program mode. */
|
|
|
|
static ptid_t
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
tui_target_wait_hook (ptid_t pid,
|
2009-05-21 17:48:42 +02:00
|
|
|
struct target_waitstatus *status, int options)
|
2001-07-24 22:40:39 +02:00
|
|
|
{
|
|
|
|
ptid_t res;
|
|
|
|
|
|
|
|
/* Leave tui mode (optional). */
|
|
|
|
#if 0
|
|
|
|
if (tui_active)
|
|
|
|
{
|
|
|
|
target_terminal_ours ();
|
|
|
|
endwin ();
|
|
|
|
target_terminal_inferior ();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
tui_target_has_run = 1;
|
2009-05-21 17:48:42 +02:00
|
|
|
res = target_wait (pid, status, options);
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
if (tui_active)
|
|
|
|
{
|
|
|
|
/* TODO: need to refresh (optional). */
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The selected frame has changed. This is happens after a target
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
stop or when the user explicitly changes the frame
|
|
|
|
(up/down/thread/...). */
|
2001-07-24 22:40:39 +02:00
|
|
|
static void
|
|
|
|
tui_selected_frame_level_changed_hook (int level)
|
|
|
|
{
|
|
|
|
struct frame_info *fi;
|
|
|
|
|
2007-03-29 20:55:01 +02:00
|
|
|
/* Negative level means that the selected frame was cleared. */
|
|
|
|
if (level < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
fi = get_selected_frame (NULL);
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Ensure that symbols for this frame are read in. Also, determine
|
|
|
|
the source language of this frame, and switch to it if
|
|
|
|
desired. */
|
2001-07-24 22:40:39 +02:00
|
|
|
if (fi)
|
|
|
|
{
|
|
|
|
struct symtab *s;
|
|
|
|
|
2003-06-12 17:44:24 +02:00
|
|
|
s = find_pc_symtab (get_frame_pc (fi));
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* elz: This if here fixes the problem with the pc not being
|
|
|
|
displayed in the tui asm layout, with no debug symbols. The
|
|
|
|
value of s would be 0 here, and select_source_symtab would
|
|
|
|
abort the command by calling the 'error' function. */
|
2001-07-24 22:40:39 +02:00
|
|
|
if (s)
|
2002-08-25 20:42:32 +02:00
|
|
|
select_source_symtab (s);
|
|
|
|
|
|
|
|
/* Display the frame position (even if there is no symbols). */
|
2004-01-29 00:16:50 +01:00
|
|
|
tui_show_frame_info (fi);
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
/* Refresh the register window if it's visible. */
|
|
|
|
if (tui_is_window_visible (DATA_WIN))
|
|
|
|
{
|
|
|
|
tui_refreshing_registers = 1;
|
2004-02-07 01:23:56 +01:00
|
|
|
tui_check_data_values (fi);
|
2001-07-24 22:40:39 +02:00
|
|
|
tui_refreshing_registers = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Called from print_frame_info to list the line we stopped in. */
|
|
|
|
static void
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
tui_print_frame_info_listing_hook (struct symtab *s,
|
|
|
|
int line,
|
|
|
|
int stopline,
|
|
|
|
int noerror)
|
2001-07-24 22:40:39 +02:00
|
|
|
{
|
|
|
|
select_source_symtab (s);
|
* frame.c (deprecated_selected_frame): Rename to...
(selected_frame): ...this. Make static.
(get_selected_frame, select_frame): Update.
* frame.h (deprected_select_frame): Delete.
(deprecated_safe_get_selected_frame): Update comments.
* breakpoint.c, cli/cli-cmds.c, f-valprint.c, infcmd.c, inflow.c,
infrun.c, stack.c, tui/tui-disasm.c, tui/tui-source.c,
tui/tui-winsource.c, valops.c, varobj.c, findvar.c, macroscope.c,
parse.c, regcache.h, sh64-tdep.c, tui/tui-hooks.c, tui/tui-win.c,
tui/tui.c: Replace references to deprecated_selected_frame.
2007-02-27 20:46:04 +01:00
|
|
|
tui_show_frame_info (get_selected_frame (NULL));
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|
|
|
|
|
2002-09-01 14:49:32 +02:00
|
|
|
/* Called when the target process died or is detached.
|
|
|
|
Update the status line. */
|
|
|
|
static void
|
|
|
|
tui_detach_hook (void)
|
|
|
|
{
|
2004-01-29 00:16:50 +01:00
|
|
|
tui_show_frame_info (0);
|
2002-09-01 14:49:32 +02:00
|
|
|
tui_display_main ();
|
|
|
|
}
|
|
|
|
|
gdb:
* tui/tui-hooks.c: Include observer.h.
(tui_event_default, tui_old_event_hooks, tui_event_hooks):
Remove.
(tui_bp_created_observer, tui_bp_deleted_observer,
tui_bp_modified_observer): New globals.
(tui_install_hooks): Use observers, not events.
(tui_remove_hooks): Likewise.
* mi/mi-cmd-break.c: Include observer.h, not gdb-events.h.
(mi_breakpoint_observers_installed, mi_can_breakpoint_notify): New
globals.
(breakpoint_notify): Check mi_can_breakpoint_notify.
(breakpoint_hooks): Remove.
(mi_cmd_break_insert): Attach observers. Don't use events.
* tracepoint.c: Include observer.h, not gdb-events.h.
(tracepoint_operation, trace_pass_command): Notify observer.
* interps.c: Don't include gdb-events.h.
(clear_interpreter_hooks): Don't call clear_gdb_event_hooks.
* gdbarch.c: Rebuild.
* gdbarch.sh: Emit include for observer.h, not gdb-events.h.
(deprecated_current_gdbarch_select_hack): Notify observer.
* breakpoint.h: Don't include gdb-events.h.
* breakpoint.c: Don't include gdb-events.h.
(condition_command): Notify observer.
(commands_command): Likewise.
(commands_from_control_command): Likewise.
(mention, delete_breakpoint, set_ignore_count): Likewise.
(disable_breakpoint, do_enable_breakpoint): Likewise.
* Makefile.in (gdb_events_h): Remove.
(breakpoint_h): Update.
(COMMON_OBS): Remove gdb-events.o.
(gdb-events.o): Remove.
(breakpoint.o, gdbarch.o, interps.o, tracepoint.o, gdbtk-bp.o,
gdbtk-hooks.o, mi-cmd-break.o, tui-hooks.o): Update.
* gdb-events.c: Remove.
* gdb-events.h: Remove.
* gdb-events.sh: Remove.
gdb/doc:
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdb/gdbtk:
* generic/gdbtk-hooks.c: Include observer.h, not gdb-events.h.
(gdbtk_add_hooks): Use observers, not events.
(gdbtk_architecture_changed): Add argument, for observer.
* generic/gdbtk-bp.c: Include observer.h.
(gdb_set_bp): Notify observer.
(gdb_set_bp_addr): Likewise.
2008-07-25 18:12:03 +02:00
|
|
|
/* Observers created when installing TUI hooks. */
|
|
|
|
static struct observer *tui_bp_created_observer;
|
|
|
|
static struct observer *tui_bp_deleted_observer;
|
|
|
|
static struct observer *tui_bp_modified_observer;
|
|
|
|
|
2001-07-24 22:40:39 +02:00
|
|
|
/* Install the TUI specific hooks. */
|
|
|
|
void
|
|
|
|
tui_install_hooks (void)
|
|
|
|
{
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-22 01:52:21 +02:00
|
|
|
deprecated_target_wait_hook = tui_target_wait_hook;
|
|
|
|
deprecated_selected_frame_level_changed_hook = tui_selected_frame_level_changed_hook;
|
|
|
|
deprecated_print_frame_info_listing_hook = tui_print_frame_info_listing_hook;
|
2001-07-24 22:40:39 +02:00
|
|
|
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-22 01:52:21 +02:00
|
|
|
deprecated_query_hook = tui_query_hook;
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
/* Install the event hooks. */
|
gdb:
* tui/tui-hooks.c: Include observer.h.
(tui_event_default, tui_old_event_hooks, tui_event_hooks):
Remove.
(tui_bp_created_observer, tui_bp_deleted_observer,
tui_bp_modified_observer): New globals.
(tui_install_hooks): Use observers, not events.
(tui_remove_hooks): Likewise.
* mi/mi-cmd-break.c: Include observer.h, not gdb-events.h.
(mi_breakpoint_observers_installed, mi_can_breakpoint_notify): New
globals.
(breakpoint_notify): Check mi_can_breakpoint_notify.
(breakpoint_hooks): Remove.
(mi_cmd_break_insert): Attach observers. Don't use events.
* tracepoint.c: Include observer.h, not gdb-events.h.
(tracepoint_operation, trace_pass_command): Notify observer.
* interps.c: Don't include gdb-events.h.
(clear_interpreter_hooks): Don't call clear_gdb_event_hooks.
* gdbarch.c: Rebuild.
* gdbarch.sh: Emit include for observer.h, not gdb-events.h.
(deprecated_current_gdbarch_select_hack): Notify observer.
* breakpoint.h: Don't include gdb-events.h.
* breakpoint.c: Don't include gdb-events.h.
(condition_command): Notify observer.
(commands_command): Likewise.
(commands_from_control_command): Likewise.
(mention, delete_breakpoint, set_ignore_count): Likewise.
(disable_breakpoint, do_enable_breakpoint): Likewise.
* Makefile.in (gdb_events_h): Remove.
(breakpoint_h): Update.
(COMMON_OBS): Remove gdb-events.o.
(gdb-events.o): Remove.
(breakpoint.o, gdbarch.o, interps.o, tracepoint.o, gdbtk-bp.o,
gdbtk-hooks.o, mi-cmd-break.o, tui-hooks.o): Update.
* gdb-events.c: Remove.
* gdb-events.h: Remove.
* gdb-events.sh: Remove.
gdb/doc:
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdb/gdbtk:
* generic/gdbtk-hooks.c: Include observer.h, not gdb-events.h.
(gdbtk_add_hooks): Use observers, not events.
(gdbtk_architecture_changed): Add argument, for observer.
* generic/gdbtk-bp.c: Include observer.h.
(gdb_set_bp): Notify observer.
(gdb_set_bp_addr): Likewise.
2008-07-25 18:12:03 +02:00
|
|
|
tui_bp_created_observer
|
|
|
|
= observer_attach_breakpoint_created (tui_event_create_breakpoint);
|
|
|
|
tui_bp_deleted_observer
|
|
|
|
= observer_attach_breakpoint_deleted (tui_event_delete_breakpoint);
|
|
|
|
tui_bp_modified_observer
|
|
|
|
= observer_attach_breakpoint_modified (tui_event_modify_breakpoint);
|
2001-07-24 22:40:39 +02:00
|
|
|
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-22 01:52:21 +02:00
|
|
|
deprecated_register_changed_hook = tui_register_changed_hook;
|
|
|
|
deprecated_detach_hook = tui_detach_hook;
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Remove the TUI specific hooks. */
|
|
|
|
void
|
|
|
|
tui_remove_hooks (void)
|
|
|
|
{
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-22 01:52:21 +02:00
|
|
|
deprecated_target_wait_hook = 0;
|
|
|
|
deprecated_selected_frame_level_changed_hook = 0;
|
|
|
|
deprecated_print_frame_info_listing_hook = 0;
|
|
|
|
deprecated_query_hook = 0;
|
|
|
|
deprecated_register_changed_hook = 0;
|
|
|
|
deprecated_detach_hook = 0;
|
2001-07-24 22:40:39 +02:00
|
|
|
|
gdb:
* tui/tui-hooks.c: Include observer.h.
(tui_event_default, tui_old_event_hooks, tui_event_hooks):
Remove.
(tui_bp_created_observer, tui_bp_deleted_observer,
tui_bp_modified_observer): New globals.
(tui_install_hooks): Use observers, not events.
(tui_remove_hooks): Likewise.
* mi/mi-cmd-break.c: Include observer.h, not gdb-events.h.
(mi_breakpoint_observers_installed, mi_can_breakpoint_notify): New
globals.
(breakpoint_notify): Check mi_can_breakpoint_notify.
(breakpoint_hooks): Remove.
(mi_cmd_break_insert): Attach observers. Don't use events.
* tracepoint.c: Include observer.h, not gdb-events.h.
(tracepoint_operation, trace_pass_command): Notify observer.
* interps.c: Don't include gdb-events.h.
(clear_interpreter_hooks): Don't call clear_gdb_event_hooks.
* gdbarch.c: Rebuild.
* gdbarch.sh: Emit include for observer.h, not gdb-events.h.
(deprecated_current_gdbarch_select_hack): Notify observer.
* breakpoint.h: Don't include gdb-events.h.
* breakpoint.c: Don't include gdb-events.h.
(condition_command): Notify observer.
(commands_command): Likewise.
(commands_from_control_command): Likewise.
(mention, delete_breakpoint, set_ignore_count): Likewise.
(disable_breakpoint, do_enable_breakpoint): Likewise.
* Makefile.in (gdb_events_h): Remove.
(breakpoint_h): Update.
(COMMON_OBS): Remove gdb-events.o.
(gdb-events.o): Remove.
(breakpoint.o, gdbarch.o, interps.o, tracepoint.o, gdbtk-bp.o,
gdbtk-hooks.o, mi-cmd-break.o, tui-hooks.o): Update.
* gdb-events.c: Remove.
* gdb-events.h: Remove.
* gdb-events.sh: Remove.
gdb/doc:
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdb/gdbtk:
* generic/gdbtk-hooks.c: Include observer.h, not gdb-events.h.
(gdbtk_add_hooks): Use observers, not events.
(gdbtk_architecture_changed): Add argument, for observer.
* generic/gdbtk-bp.c: Include observer.h.
(gdb_set_bp): Notify observer.
(gdb_set_bp_addr): Likewise.
2008-07-25 18:12:03 +02:00
|
|
|
/* Remove our observers. */
|
|
|
|
observer_detach_breakpoint_created (tui_bp_created_observer);
|
|
|
|
tui_bp_created_observer = NULL;
|
|
|
|
observer_detach_breakpoint_deleted (tui_bp_deleted_observer);
|
|
|
|
tui_bp_deleted_observer = NULL;
|
|
|
|
observer_detach_breakpoint_modified (tui_bp_modified_observer);
|
|
|
|
tui_bp_modified_observer = NULL;
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|
|
|
|
|
2003-02-14 14:58:06 +01:00
|
|
|
void _initialize_tui_hooks (void);
|
2002-09-10 21:59:31 +02:00
|
|
|
|
2003-02-14 14:58:06 +01:00
|
|
|
void
|
|
|
|
_initialize_tui_hooks (void)
|
2001-07-24 22:40:39 +02:00
|
|
|
{
|
|
|
|
/* Install the permanent hooks. */
|
2007-05-11 21:55:20 +02:00
|
|
|
observer_attach_new_objfile (tui_new_objfile_hook);
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|