* tuiWin.c, tuiWin.h, tui.c, tui.h, tuiCommand.c: Add FSF copyright.
tuiCommand.h, tuiIO.c, tuiIO.h, tuiData.h, tuiData.c: Likewise.
tuiDataWin.c, tuiDataWin.h, tuiDisassem.c, tuiDisassem.h: Likewise.
tuiGeneralWin.c, tuiGeneralWin.h, tuiLayout.c, tuiLayout.h: Likewise.
tuiRegs.c, tuiRegs.h, tuiSource.c, tuiSource.h: Likewise.
tuiSouceWin.c, tuiSourceWin.h, tuiStack.c, tuiStack.h: Likewise.
2001-07-14 19:01:25 +00:00
|
|
|
/* TUI display registers in window.
|
2002-03-01 06:19:28 +00:00
|
|
|
|
2007-01-09 17:59:20 +00:00
|
|
|
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
|
|
|
|
Free Software Foundation, Inc.
|
2002-03-01 06:19:28 +00:00
|
|
|
|
* tuiWin.c, tuiWin.h, tui.c, tui.h, tuiCommand.c: Add FSF copyright.
tuiCommand.h, tuiIO.c, tuiIO.h, tuiData.h, tuiData.c: Likewise.
tuiDataWin.c, tuiDataWin.h, tuiDisassem.c, tuiDisassem.h: Likewise.
tuiGeneralWin.c, tuiGeneralWin.h, tuiLayout.c, tuiLayout.h: Likewise.
tuiRegs.c, tuiRegs.h, tuiSource.c, tuiSource.h: Likewise.
tuiSouceWin.c, tuiSourceWin.h, tuiStack.c, tuiStack.h: Likewise.
2001-07-14 19:01:25 +00:00
|
|
|
Contributed by Hewlett-Packard Company.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
* tuiWin.c, tuiWin.h, tui.c, tui.h, tuiCommand.c: Add FSF copyright.
tuiCommand.h, tuiIO.c, tuiIO.h, tuiData.h, tuiData.c: Likewise.
tuiDataWin.c, tuiDataWin.h, tuiDisassem.c, tuiDisassem.h: Likewise.
tuiGeneralWin.c, tuiGeneralWin.h, tuiLayout.c, tuiLayout.h: Likewise.
tuiRegs.c, tuiRegs.h, tuiSource.c, tuiSource.h: Likewise.
tuiSouceWin.c, tuiSourceWin.h, tuiStack.c, tuiStack.h: Likewise.
2001-07-14 19:01:25 +00:00
|
|
|
This file is part of GDB.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
* tuiWin.c, tuiWin.h, tui.c, tui.h, tuiCommand.c: Add FSF copyright.
tuiCommand.h, tuiIO.c, tuiIO.h, tuiData.h, tuiData.c: Likewise.
tuiDataWin.c, tuiDataWin.h, tuiDisassem.c, tuiDisassem.h: Likewise.
tuiGeneralWin.c, tuiGeneralWin.h, tuiLayout.c, tuiLayout.h: Likewise.
tuiRegs.c, tuiRegs.h, tuiSource.c, tuiSource.h: Likewise.
tuiSouceWin.c, tuiSourceWin.h, tuiStack.c, tuiStack.h: Likewise.
2001-07-14 19:01:25 +00:00
|
|
|
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
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(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
|
|
|
|
along with this program; if not, write to the Free Software
|
2005-12-23 19:10:03 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#include "defs.h"
|
2004-01-19 04:31:53 +00:00
|
|
|
#include "tui/tui.h"
|
|
|
|
#include "tui/tui-data.h"
|
1999-04-16 01:35:26 +00:00
|
|
|
#include "symtab.h"
|
|
|
|
#include "gdbtypes.h"
|
|
|
|
#include "gdbcmd.h"
|
|
|
|
#include "frame.h"
|
2002-08-25 09:12:36 +00:00
|
|
|
#include "regcache.h"
|
1999-04-16 01:35:26 +00:00
|
|
|
#include "inferior.h"
|
|
|
|
#include "target.h"
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
#include "gdb_string.h"
|
2004-01-19 04:31:53 +00:00
|
|
|
#include "tui/tui-layout.h"
|
|
|
|
#include "tui/tui-win.h"
|
|
|
|
#include "tui/tui-windata.h"
|
|
|
|
#include "tui/tui-wingeneral.h"
|
|
|
|
#include "tui/tui-file.h"
|
2004-03-13 14:14:01 +00:00
|
|
|
#include "reggroups.h"
|
1999-04-16 01:35:26 +00: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 19:08:19 +00:00
|
|
|
#include "gdb_curses.h"
|
2003-06-22 15:21:39 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/*****************************************
|
2004-03-13 14:14:01 +00:00
|
|
|
** STATIC LOCAL FUNCTIONS FORWARD DECLS **
|
1999-04-16 01:35:26 +00:00
|
|
|
******************************************/
|
2004-03-13 14:14:01 +00:00
|
|
|
static void
|
|
|
|
tui_display_register (struct tui_data_element *data,
|
|
|
|
struct tui_gen_win_info *win_info);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
static enum tui_status
|
|
|
|
tui_show_register_group (struct gdbarch *gdbarch, struct reggroup *group,
|
|
|
|
struct frame_info *frame, int refresh_values_only);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
static enum tui_status
|
|
|
|
tui_get_register (struct gdbarch *gdbarch, struct frame_info *frame,
|
|
|
|
struct tui_data_element *data, int regnum, int *changedp);
|
2004-02-08 00:05:16 +00:00
|
|
|
static void tui_register_format
|
2004-03-13 14:14:01 +00:00
|
|
|
(struct gdbarch *, struct frame_info *, struct tui_data_element*, int);
|
2004-02-08 00:05:16 +00:00
|
|
|
static void tui_scroll_regs_forward_command (char *, int);
|
|
|
|
static void tui_scroll_regs_backward_command (char *, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************
|
|
|
|
** PUBLIC FUNCTIONS **
|
|
|
|
******************************************/
|
|
|
|
|
2004-01-19 16:06:04 +00:00
|
|
|
/* Answer the number of the last line in the regs display. If there
|
|
|
|
are no registers (-1) is returned. */
|
1999-04-16 01:35:26 +00:00
|
|
|
int
|
2004-01-19 16:06:04 +00:00
|
|
|
tui_last_regs_line_no (void)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 01:32:26 +00:00
|
|
|
int num_lines = (-1);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 00:05:16 +00:00
|
|
|
num_lines = (TUI_DATA_WIN->detail.data_display_info.regs_content_count /
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
TUI_DATA_WIN->detail.data_display_info.regs_column_count);
|
|
|
|
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count %
|
|
|
|
TUI_DATA_WIN->detail.data_display_info.regs_column_count)
|
2004-02-08 00:05:16 +00:00
|
|
|
num_lines++;
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2004-02-08 00:05:16 +00:00
|
|
|
return num_lines;
|
2004-01-19 16:06:04 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
/* Answer the line number that the register element at element_no is
|
|
|
|
on. If element_no is greater than the number of register elements
|
2004-01-19 16:06:04 +00:00
|
|
|
there are, -1 is returned. */
|
1999-04-16 01:35:26 +00:00
|
|
|
int
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_line_from_reg_element_no (int element_no)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 00:05:16 +00:00
|
|
|
if (element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
int i, line = (-1);
|
|
|
|
|
|
|
|
i = 1;
|
|
|
|
while (line == (-1))
|
|
|
|
{
|
2004-02-08 00:05:16 +00:00
|
|
|
if (element_no <
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
(TUI_DATA_WIN->detail.data_display_info.regs_column_count * i))
|
1999-04-16 01:35:26 +00:00
|
|
|
line = i - 1;
|
|
|
|
else
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return line;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return (-1);
|
2004-01-19 16:06:04 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
/* Answer the index of the first element in line_no. If line_no is past
|
2004-01-19 16:06:04 +00:00
|
|
|
the register area (-1) is returned. */
|
1999-04-16 01:35:26 +00:00
|
|
|
int
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_first_reg_element_no_inline (int line_no)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 00:05:16 +00:00
|
|
|
if ((line_no * TUI_DATA_WIN->detail.data_display_info.regs_column_count)
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
<= TUI_DATA_WIN->detail.data_display_info.regs_content_count)
|
2004-02-08 00:05:16 +00:00
|
|
|
return ((line_no + 1) *
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
TUI_DATA_WIN->detail.data_display_info.regs_column_count) -
|
|
|
|
TUI_DATA_WIN->detail.data_display_info.regs_column_count;
|
1999-04-16 01:35:26 +00:00
|
|
|
else
|
|
|
|
return (-1);
|
2004-01-19 16:06:04 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
/* Answer the index of the last element in line_no. If line_no is
|
|
|
|
past the register area (-1) is returned. */
|
1999-04-16 01:35:26 +00:00
|
|
|
int
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_last_reg_element_no_in_line (int line_no)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 00:05:16 +00:00
|
|
|
if ((line_no * TUI_DATA_WIN->detail.data_display_info.regs_column_count) <=
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
TUI_DATA_WIN->detail.data_display_info.regs_content_count)
|
2004-02-08 00:05:16 +00:00
|
|
|
return ((line_no + 1) *
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
TUI_DATA_WIN->detail.data_display_info.regs_column_count) - 1;
|
1999-04-16 01:35:26 +00:00
|
|
|
else
|
|
|
|
return (-1);
|
2004-02-08 00:05:16 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
/* Show the registers of the given group in the data window
|
|
|
|
and refresh the window. */
|
1999-04-16 01:35:26 +00:00
|
|
|
void
|
2004-03-13 14:14:01 +00:00
|
|
|
tui_show_registers (struct reggroup *group)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h (Opaque, OpaquePtr OpaqueList): Delete definition.
(TuiPoint, TuiPointPtr): Ditto.
(TuiStatus, TuiStatusPtr): Ditto.
(TuiWinType, TuiWinTypePtr): Ditto.
(struct tui_point): Rename _TuiPoint.
(tui_get_low_disassembly_address): Rename
tuiGetLowDisassemblyAddress.
(tui_update_all_exec_infos): Rename tuiUpdateAllExecInfos.
(tuiFree): Delete declaration.
(OpaqueFuncPtr, TuiOpaqueFuncPtr): Delete definitions.
(TuiVoidFuncPtr, TuiIntFuncPtr): Delete definitions.
* tui/tui.c (tuiFree): Delete function.
* cli/cli-cmds.c (disassemble_command): Update references.
* tui/tui-data.c, tui/tui-data.h, tui/tui-disasm.c: Ditto.
* tui/tui-layout.c, tui/tui-regs.c, tui/tui-source.c: Ditto.
* tui/tui-stack.c, tui/tui-win.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c: Ditto.
2004-02-07 17:46:14 +00:00
|
|
|
enum tui_status ret = TUI_FAILURE;
|
2004-03-28 10:18:07 +00:00
|
|
|
struct tui_data_info *display_info;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-28 10:18:07 +00:00
|
|
|
/* Make sure the curses mode is enabled. */
|
|
|
|
tui_enable ();
|
|
|
|
|
|
|
|
/* Make sure the register window is visible. If not, select an
|
|
|
|
appropriate layout. */
|
|
|
|
if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible)
|
|
|
|
tui_set_layout_for_display_command (DATA_NAME);
|
|
|
|
|
|
|
|
display_info = &TUI_DATA_WIN->detail.data_display_info;
|
2004-03-13 14:14:01 +00:00
|
|
|
if (group == 0)
|
|
|
|
group = general_reggroup;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
/* Say that registers should be displayed, even if there is a problem. */
|
|
|
|
display_info->display_regs = TRUE;
|
|
|
|
|
|
|
|
if (target_has_registers && target_has_stack && target_has_memory)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
ret = tui_show_register_group (current_gdbarch, group,
|
|
|
|
get_current_frame (),
|
|
|
|
group == display_info->current_group);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
if (ret == TUI_FAILURE)
|
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
display_info->current_group = 0;
|
2004-02-07 00:23:56 +00:00
|
|
|
tui_erase_data_content (NO_REGS_STRING);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Clear all notation of changed values */
|
2004-03-13 14:14:01 +00:00
|
|
|
for (i = 0; i < display_info->regs_content_count; i++)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
struct tui_gen_win_info *data_item_win;
|
|
|
|
struct tui_win_element *win;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
data_item_win = &display_info->regs_content[i]
|
|
|
|
->which_element.data_window;
|
|
|
|
win = (struct tui_win_element *) data_item_win->content[0];
|
|
|
|
win->which_element.data.highlight = FALSE;
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2004-03-13 14:14:01 +00:00
|
|
|
display_info->current_group = group;
|
2004-02-07 00:23:56 +00:00
|
|
|
tui_display_all_data ();
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2004-01-19 16:06:04 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
/* Set the data window to display the registers of the register group
|
|
|
|
using the given frame. Values are refreshed only when refresh_values_only
|
|
|
|
is TRUE. */
|
|
|
|
|
|
|
|
static enum tui_status
|
|
|
|
tui_show_register_group (struct gdbarch *gdbarch, struct reggroup *group,
|
|
|
|
struct frame_info *frame, int refresh_values_only)
|
|
|
|
{
|
|
|
|
enum tui_status ret = TUI_FAILURE;
|
|
|
|
int nr_regs;
|
|
|
|
int allocated_here = FALSE;
|
|
|
|
int regnum, pos;
|
|
|
|
char title[80];
|
|
|
|
struct tui_data_info *display_info = &TUI_DATA_WIN->detail.data_display_info;
|
|
|
|
|
|
|
|
/* Make a new title showing which group we display. */
|
|
|
|
snprintf (title, sizeof (title) - 1, "Register group: %s",
|
|
|
|
reggroup_name (group));
|
|
|
|
xfree (TUI_DATA_WIN->generic.title);
|
|
|
|
TUI_DATA_WIN->generic.title = xstrdup (title);
|
|
|
|
|
|
|
|
/* See how many registers must be displayed. */
|
|
|
|
nr_regs = 0;
|
2007-05-31 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (NUM_REGS): Replace by gdbarch_num_regs.
* i386-tdep.c (i386_dbx_reg_to_regnum)
(i386_svr4_reg_to_regnum): Likewise.
* inf-ptrace.c (inf_ptrace_fetch_registers)
(inf_ptrace_store_registers): Likewise.
* corelow.c (get_core_registers): Likewise.
* i386-linux-nat.c (supply_gregset, fill_gregset)
(i386_linux_fetch_inferior_registers)
(i386_linux_store_inferior_registers): Likewise.
* remote.c (init_remote_state,packet_reg_from_regnum)
(packet_reg_from_pnum,process_g_packet,remote_fetch_registers)
(remote_prepare_to_store,store_registers_using_G)
(remote_store_registers,remote_arch_state): Likewise.
* tracepoint.c (encode_actions): Likewise.
* mi/mi-main.c (mi_cmd_data_list_register_names)
(mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values)
(mi_cmd_data_write_register_values): Likewise.
* tui/tui-regs.c (tui_show_register_group)
(tui_show_register_group): Likewise.
* xtensa-tdep.h (FP_ALIAS): Likewise.
* xtensa-tdep.c (xtensa_register_name,xtensa_register_type)
(xtensa_reg_to_regnum,xtensa_pseudo_register_read)
(xtensa_pseudo_register_write,xtensa_register_reggroup_p): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers,fetch_elf_core_registers
* user-regs.h: Likewise (comment).
* user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Likewise.
* target-descriptions.h: Likewise (comment).
* target-descriptions.c (tdesc_use_registers): Likewise (comment).
* target.c (debug_print_register): Likewise.
* stack.c (frame_info): Likewise.
* stabsread.c (define_symbol): Likewise.
* sh64-tdep.c (sh64_do_pseudo_register,sh64_print_register)
(sh64_media_print_registers_info)
(sh64_compact_print_registers_info): Likewise.
* rs6000-tdep.c (rs6000_register_sim_regno): Likewise.
* rs6000-nat.c (fetch_register,store_register): Likewise.
* remote-sim.c (one2one_register_sim_regno,gdbsim_fetch_register)
(gdbsim_fetch_register,gdbsim_store_register): Likewise.
* remote-mips.c (mips_fetch_registers,mips_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* reggroups.c (default_register_reggroup_p): Likewise.
* regcache.c (init_regcache_descr,register_size,regcache,regcache_save)
(regcache_restore,regcache_dump): Likewise.
* monitor.c (monitor_fetch_registers,monitor_store_registers): Likewise.
* mips-tdep.c (mips_xfer_register,mips_register_name)
(mips_register_reggroup_p,mips_pseudo_register_read)
(mips_pseudo_register_write,mips_convert_register_p,mips_register_type)
(mips_unwind_pc,mips_unwind_sp,mips_unwind_dummy_id,set_reg_offset)
(mips16_scan_prologue,mips_insn16_frame_cache,reset_saved_regs)
(mips32_scan_prologue,mips_insn32_frame_cache,read_next_frame_reg)
(mips_n32n64_return_value,mips_o32_return_value,mips_o64_return_value)
(print_gp_register_row,mips_print_registers_info)
(mips_stab_reg_to_regnum,mips_dwarf_dwarf2_ecoff_reg_to_regnum)
(mips_register_sim_regno): Likewise.
* mips-linux-tdep.c (mips_linux_o32_sigframe_init)
(mips_linux_n32n64_sigframe_init): Likewise.
* mips-linux-nat.c (mips_linux_register_addr)
(mips64_linux_register_addr): Likewise.
* findvar.c (value_of_register): Likewise.
* infcmd.c (default_print_registers_info,registers_info)
(print_vector_info,print_float_info): Likewise.
* mips64obsd-tdep.c (mips64obsd_sigframe_init): Likewise.
* inf-child.c (inf_child_fetch_inferior_registers): Likewise.
* m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache(: Likewise.
* m32r-tdep.c (m32r_frame_unwind_cache): Likewise.
* ia64-linux-nat.c (ia64_register_addr,ia64_cannot_fetch_register)
(ia64_cannot_store_register,ia64_linux_fetch_registers)
(ia64_linux_store_registers): Likewise.
* hpux-thread.c (hpux_thread_fetch_registers)
(hpux_thread_store_registers): Likewise.
* h8300-tdep.c (E_PSEUDO_CCR_REGNUM,E_PSEUDO_EXR_REGNUM)
(h8300_init_frame_cache,h8300_frame_cache,h8300_frame_prev_register)
(h8300_register_type): Likewise.
* dwarf2-frame.c (dwarf2_frame_cache)
(dwarf2_frame_state_alloc_regs): Likewise.
* cris-tdep.c (cris_register_size,cris_cannot_fetch_register)
(cris_cannot_store_register,crisv32_cannot_fetch_register)
(crisv32_cannot_store_register,cris_register_name): Likewise.
* avr-tdep.c (avr_frame_unwind_cache): Likewise.
* arch-utils.c (legacy_register_sim_regno)
(legacy_virtual_frame_pointer): Likewise.
* arm-tdep.c (arm_make_prologue_cache,arm_register_sim_regno):Likewise.
* arm-tdep.h: Likewise (comment).
* frv-tdep.c (frv_register_sim_regno): Likewise.
* m68klinux-nat.c (old_fetch_inferior_registers)
(old_store_inferior_registers): Likewise.
* m32c-tdep.c (m32c_virtual_frame_pointer): Likewise.
* irix5-nat.c (fetch_core_registers): Likewise.
* hppa-tdep.c (hppa_frame_cache): Likewise.
* hppa-linux-nat.c (hppa_linux_register_addr)
(hppa_linux_fetch_inferior_registers)
(hppa_linux_store_inferior_registers): Likewise.
* hppa-hpux-nat.c (hppa_hpux_fetch_inferior_registers)
(hppa_hpux_store_inferior_registers): Likewise.
* amd64-nat.c (amd64_native_gregset_reg_offset)
(amd64_supply_native_gregset,amd64_collect_native_gregset): Likewise.
* dbug-rom.c (dbug_regname): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache)
(HARD_PAGE_REGNUM (comment)): Likewise.
* gdbarch.sh (NUM_PSEUDO_REGS): Replace by gdbarch_num_pseudo_regs.
* i386-tdep.c (i386_dbx_reg_to_regnum)
(i386_svr4_reg_to_regnum): Likewise.
* mi/mi-main.c (mi_cmd_data_list_register_names)
(mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values)
(mi_cmd_data_write_register_values): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
* tui/tui-regs.c (tui_show_register_group): Likewise.
* xtensa-tdep.h (FP_ALIAS): Likewise.
* user-regs.h: Likewise (comment).
* user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Likewise.
* target-descriptions.h: Likewise (comment).
* target.c (debug_print_register): Likewise.
* stack.c (frame_info): Likewise.
* stabsread.c (define_symbol): Likewise.
* sh64-tdep.c (sh64_print_register,sh64_media_print_registers_info)
(sh64_compact_print_registers_info): Likewise.
* rs6000-tdep.c (rs6000_register_sim_regno): Likewise.
* regcache.c (init_regcache_descr,register_size,regcache,regcache_save
(regcache_restore,regcache_dump): Likewise.
* mips-tdep.c (print_gp_register_row,mips_print_registers_info)
(mips_dwarf_dwarf2_ecoff_reg_to_regnum)
(mips_stab_reg_to_regnum): Likewise.
* findvar.c (value_of_register): Likewise.
* infcmd.c (default_print_registers_info,registers_info)
(print_vector_info,print_float_info): Likewise.
* m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise.
* h8300-tdep.c (h8300_register_type): Likewise.
* dwarf2-frame.c (dwarf2_frame_cache): Likewise.
* frame.h (SIZEOF_FRAME_SAVED_REGS): Likewise.
* xtensa-tdep.c (xtensa_register_type,xtensa_reg_to_regnum)
(xtensa_pseudo_register_read,xtensa_pseudo_register_write): Likewise.
* parse.c: Remove comment.
* gdbarch.c, gdbarch.h: Regenerate
2007-05-31 17:32:22 +00:00
|
|
|
for (regnum = 0;
|
|
|
|
regnum < gdbarch_num_regs (current_gdbarch)
|
|
|
|
+ gdbarch_num_pseudo_regs (current_gdbarch);
|
|
|
|
regnum++)
|
2004-03-13 14:14:01 +00:00
|
|
|
{
|
|
|
|
/* Must be in the group and have a name. */
|
|
|
|
if (gdbarch_register_reggroup_p (gdbarch, regnum, group)
|
|
|
|
&& gdbarch_register_name (gdbarch, regnum) != 0)
|
|
|
|
nr_regs++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (display_info->regs_content_count > 0 && !refresh_values_only)
|
|
|
|
{
|
|
|
|
tui_free_data_content (display_info->regs_content,
|
|
|
|
display_info->regs_content_count);
|
|
|
|
display_info->regs_content_count = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (display_info->regs_content_count <= 0)
|
|
|
|
{
|
|
|
|
display_info->regs_content = tui_alloc_content (nr_regs, DATA_WIN);
|
|
|
|
allocated_here = TRUE;
|
|
|
|
refresh_values_only = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (display_info->regs_content != (tui_win_content) NULL)
|
|
|
|
{
|
|
|
|
if (!refresh_values_only || allocated_here)
|
|
|
|
{
|
|
|
|
TUI_DATA_WIN->generic.content = (void*) NULL;
|
|
|
|
TUI_DATA_WIN->generic.content_size = 0;
|
|
|
|
tui_add_content_elements (&TUI_DATA_WIN->generic, nr_regs);
|
|
|
|
display_info->regs_content
|
|
|
|
= (tui_win_content) TUI_DATA_WIN->generic.content;
|
|
|
|
display_info->regs_content_count = nr_regs;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now set the register names and values */
|
|
|
|
pos = 0;
|
2007-05-31 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (NUM_REGS): Replace by gdbarch_num_regs.
* i386-tdep.c (i386_dbx_reg_to_regnum)
(i386_svr4_reg_to_regnum): Likewise.
* inf-ptrace.c (inf_ptrace_fetch_registers)
(inf_ptrace_store_registers): Likewise.
* corelow.c (get_core_registers): Likewise.
* i386-linux-nat.c (supply_gregset, fill_gregset)
(i386_linux_fetch_inferior_registers)
(i386_linux_store_inferior_registers): Likewise.
* remote.c (init_remote_state,packet_reg_from_regnum)
(packet_reg_from_pnum,process_g_packet,remote_fetch_registers)
(remote_prepare_to_store,store_registers_using_G)
(remote_store_registers,remote_arch_state): Likewise.
* tracepoint.c (encode_actions): Likewise.
* mi/mi-main.c (mi_cmd_data_list_register_names)
(mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values)
(mi_cmd_data_write_register_values): Likewise.
* tui/tui-regs.c (tui_show_register_group)
(tui_show_register_group): Likewise.
* xtensa-tdep.h (FP_ALIAS): Likewise.
* xtensa-tdep.c (xtensa_register_name,xtensa_register_type)
(xtensa_reg_to_regnum,xtensa_pseudo_register_read)
(xtensa_pseudo_register_write,xtensa_register_reggroup_p): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers,fetch_elf_core_registers
* user-regs.h: Likewise (comment).
* user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Likewise.
* target-descriptions.h: Likewise (comment).
* target-descriptions.c (tdesc_use_registers): Likewise (comment).
* target.c (debug_print_register): Likewise.
* stack.c (frame_info): Likewise.
* stabsread.c (define_symbol): Likewise.
* sh64-tdep.c (sh64_do_pseudo_register,sh64_print_register)
(sh64_media_print_registers_info)
(sh64_compact_print_registers_info): Likewise.
* rs6000-tdep.c (rs6000_register_sim_regno): Likewise.
* rs6000-nat.c (fetch_register,store_register): Likewise.
* remote-sim.c (one2one_register_sim_regno,gdbsim_fetch_register)
(gdbsim_fetch_register,gdbsim_store_register): Likewise.
* remote-mips.c (mips_fetch_registers,mips_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* reggroups.c (default_register_reggroup_p): Likewise.
* regcache.c (init_regcache_descr,register_size,regcache,regcache_save)
(regcache_restore,regcache_dump): Likewise.
* monitor.c (monitor_fetch_registers,monitor_store_registers): Likewise.
* mips-tdep.c (mips_xfer_register,mips_register_name)
(mips_register_reggroup_p,mips_pseudo_register_read)
(mips_pseudo_register_write,mips_convert_register_p,mips_register_type)
(mips_unwind_pc,mips_unwind_sp,mips_unwind_dummy_id,set_reg_offset)
(mips16_scan_prologue,mips_insn16_frame_cache,reset_saved_regs)
(mips32_scan_prologue,mips_insn32_frame_cache,read_next_frame_reg)
(mips_n32n64_return_value,mips_o32_return_value,mips_o64_return_value)
(print_gp_register_row,mips_print_registers_info)
(mips_stab_reg_to_regnum,mips_dwarf_dwarf2_ecoff_reg_to_regnum)
(mips_register_sim_regno): Likewise.
* mips-linux-tdep.c (mips_linux_o32_sigframe_init)
(mips_linux_n32n64_sigframe_init): Likewise.
* mips-linux-nat.c (mips_linux_register_addr)
(mips64_linux_register_addr): Likewise.
* findvar.c (value_of_register): Likewise.
* infcmd.c (default_print_registers_info,registers_info)
(print_vector_info,print_float_info): Likewise.
* mips64obsd-tdep.c (mips64obsd_sigframe_init): Likewise.
* inf-child.c (inf_child_fetch_inferior_registers): Likewise.
* m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache(: Likewise.
* m32r-tdep.c (m32r_frame_unwind_cache): Likewise.
* ia64-linux-nat.c (ia64_register_addr,ia64_cannot_fetch_register)
(ia64_cannot_store_register,ia64_linux_fetch_registers)
(ia64_linux_store_registers): Likewise.
* hpux-thread.c (hpux_thread_fetch_registers)
(hpux_thread_store_registers): Likewise.
* h8300-tdep.c (E_PSEUDO_CCR_REGNUM,E_PSEUDO_EXR_REGNUM)
(h8300_init_frame_cache,h8300_frame_cache,h8300_frame_prev_register)
(h8300_register_type): Likewise.
* dwarf2-frame.c (dwarf2_frame_cache)
(dwarf2_frame_state_alloc_regs): Likewise.
* cris-tdep.c (cris_register_size,cris_cannot_fetch_register)
(cris_cannot_store_register,crisv32_cannot_fetch_register)
(crisv32_cannot_store_register,cris_register_name): Likewise.
* avr-tdep.c (avr_frame_unwind_cache): Likewise.
* arch-utils.c (legacy_register_sim_regno)
(legacy_virtual_frame_pointer): Likewise.
* arm-tdep.c (arm_make_prologue_cache,arm_register_sim_regno):Likewise.
* arm-tdep.h: Likewise (comment).
* frv-tdep.c (frv_register_sim_regno): Likewise.
* m68klinux-nat.c (old_fetch_inferior_registers)
(old_store_inferior_registers): Likewise.
* m32c-tdep.c (m32c_virtual_frame_pointer): Likewise.
* irix5-nat.c (fetch_core_registers): Likewise.
* hppa-tdep.c (hppa_frame_cache): Likewise.
* hppa-linux-nat.c (hppa_linux_register_addr)
(hppa_linux_fetch_inferior_registers)
(hppa_linux_store_inferior_registers): Likewise.
* hppa-hpux-nat.c (hppa_hpux_fetch_inferior_registers)
(hppa_hpux_store_inferior_registers): Likewise.
* amd64-nat.c (amd64_native_gregset_reg_offset)
(amd64_supply_native_gregset,amd64_collect_native_gregset): Likewise.
* dbug-rom.c (dbug_regname): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache)
(HARD_PAGE_REGNUM (comment)): Likewise.
* gdbarch.sh (NUM_PSEUDO_REGS): Replace by gdbarch_num_pseudo_regs.
* i386-tdep.c (i386_dbx_reg_to_regnum)
(i386_svr4_reg_to_regnum): Likewise.
* mi/mi-main.c (mi_cmd_data_list_register_names)
(mi_cmd_data_list_changed_registers,mi_cmd_data_list_register_values)
(mi_cmd_data_write_register_values): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
* tui/tui-regs.c (tui_show_register_group): Likewise.
* xtensa-tdep.h (FP_ALIAS): Likewise.
* user-regs.h: Likewise (comment).
* user-regs.c (user_reg, user_reg_map_name_to_regnum): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Likewise.
* target-descriptions.h: Likewise (comment).
* target.c (debug_print_register): Likewise.
* stack.c (frame_info): Likewise.
* stabsread.c (define_symbol): Likewise.
* sh64-tdep.c (sh64_print_register,sh64_media_print_registers_info)
(sh64_compact_print_registers_info): Likewise.
* rs6000-tdep.c (rs6000_register_sim_regno): Likewise.
* regcache.c (init_regcache_descr,register_size,regcache,regcache_save
(regcache_restore,regcache_dump): Likewise.
* mips-tdep.c (print_gp_register_row,mips_print_registers_info)
(mips_dwarf_dwarf2_ecoff_reg_to_regnum)
(mips_stab_reg_to_regnum): Likewise.
* findvar.c (value_of_register): Likewise.
* infcmd.c (default_print_registers_info,registers_info)
(print_vector_info,print_float_info): Likewise.
* m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise.
* h8300-tdep.c (h8300_register_type): Likewise.
* dwarf2-frame.c (dwarf2_frame_cache): Likewise.
* frame.h (SIZEOF_FRAME_SAVED_REGS): Likewise.
* xtensa-tdep.c (xtensa_register_type,xtensa_reg_to_regnum)
(xtensa_pseudo_register_read,xtensa_pseudo_register_write): Likewise.
* parse.c: Remove comment.
* gdbarch.c, gdbarch.h: Regenerate
2007-05-31 17:32:22 +00:00
|
|
|
for (regnum = 0;
|
|
|
|
regnum < gdbarch_num_regs (current_gdbarch)
|
|
|
|
+ gdbarch_num_pseudo_regs (current_gdbarch);
|
|
|
|
regnum++)
|
2004-03-13 14:14:01 +00:00
|
|
|
{
|
|
|
|
struct tui_gen_win_info *data_item_win;
|
|
|
|
struct tui_data_element *data;
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
if (!gdbarch_register_reggroup_p (gdbarch, regnum, group))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
name = gdbarch_register_name (gdbarch, regnum);
|
|
|
|
if (name == 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
data_item_win =
|
|
|
|
&display_info->regs_content[pos]->which_element.data_window;
|
|
|
|
data =
|
|
|
|
&((struct tui_win_element *) data_item_win->content[0])->which_element.data;
|
|
|
|
if (data)
|
|
|
|
{
|
|
|
|
if (!refresh_values_only)
|
|
|
|
{
|
|
|
|
data->item_no = regnum;
|
|
|
|
data->name = name;
|
|
|
|
data->highlight = FALSE;
|
|
|
|
}
|
|
|
|
if (data->value == (void*) NULL)
|
|
|
|
data->value = (void*) xmalloc (MAX_REGISTER_SIZE);
|
|
|
|
|
|
|
|
tui_get_register (gdbarch, frame, data, regnum, 0);
|
|
|
|
}
|
|
|
|
pos++;
|
|
|
|
}
|
|
|
|
|
|
|
|
TUI_DATA_WIN->generic.content_size =
|
|
|
|
display_info->regs_content_count + display_info->data_content_count;
|
|
|
|
ret = TUI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2004-01-19 16:06:04 +00:00
|
|
|
/* Function to display the registers in the content from
|
2004-02-08 00:05:16 +00:00
|
|
|
'start_element_no' until the end of the register content or the end
|
2004-01-19 16:06:04 +00:00
|
|
|
of the display height. No checking for displaying past the end of
|
|
|
|
the registers is done here. */
|
1999-04-16 01:35:26 +00:00
|
|
|
void
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_display_registers_from (int start_element_no)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
struct tui_data_info *display_info = &TUI_DATA_WIN->detail.data_display_info;
|
|
|
|
|
|
|
|
if (display_info->regs_content != (tui_win_content) NULL &&
|
|
|
|
display_info->regs_content_count > 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 01:32:26 +00:00
|
|
|
int i = start_element_no;
|
2004-02-25 01:10:01 +00:00
|
|
|
int j, value_chars_wide, item_win_width, cur_y;
|
2004-03-13 14:14:01 +00:00
|
|
|
|
|
|
|
int max_len = 0;
|
|
|
|
for (i = 0; i < display_info->regs_content_count; i++)
|
|
|
|
{
|
|
|
|
struct tui_data_element *data;
|
|
|
|
struct tui_gen_win_info *data_item_win;
|
|
|
|
char *p;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
data_item_win = &display_info->regs_content[i]->which_element.data_window;
|
|
|
|
data = &((struct tui_win_element *)
|
|
|
|
data_item_win->content[0])->which_element.data;
|
|
|
|
len = 0;
|
|
|
|
p = data->content;
|
|
|
|
if (p != 0)
|
|
|
|
while (*p)
|
|
|
|
{
|
|
|
|
if (*p++ == '\t')
|
|
|
|
len = 8 * ((len / 8) + 1);
|
|
|
|
else
|
|
|
|
len++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (len > max_len)
|
|
|
|
max_len = len;
|
|
|
|
}
|
|
|
|
item_win_width = max_len + 1;
|
|
|
|
i = start_element_no;
|
|
|
|
|
|
|
|
display_info->regs_column_count =
|
|
|
|
(TUI_DATA_WIN->generic.width - 2) / item_win_width;
|
|
|
|
if (display_info->regs_column_count == 0)
|
|
|
|
display_info->regs_column_count = 1;
|
|
|
|
item_win_width =
|
|
|
|
(TUI_DATA_WIN->generic.width - 2) / display_info->regs_column_count;
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
/*
|
1999-07-07 20:19:36 +00:00
|
|
|
** Now create each data "sub" window, and write the display into it.
|
|
|
|
*/
|
2004-02-08 00:05:16 +00:00
|
|
|
cur_y = 1;
|
2004-03-13 14:14:01 +00:00
|
|
|
while (i < display_info->regs_content_count &&
|
2004-02-08 00:05:16 +00:00
|
|
|
cur_y <= TUI_DATA_WIN->generic.viewport_height)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
for (j = 0;
|
2004-03-13 14:14:01 +00:00
|
|
|
(j < display_info->regs_column_count &&
|
|
|
|
i < display_info->regs_content_count); j++)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 00:05:16 +00:00
|
|
|
struct tui_gen_win_info * data_item_win;
|
|
|
|
struct tui_data_element * data_element_ptr;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
/* create the window if necessary */
|
2004-03-13 14:14:01 +00:00
|
|
|
data_item_win = &display_info->regs_content[i]
|
|
|
|
->which_element.data_window;
|
2004-02-08 00:05:16 +00:00
|
|
|
data_element_ptr = &((struct tui_win_element *)
|
|
|
|
data_item_win->content[0])->which_element.data;
|
2004-03-13 14:14:01 +00:00
|
|
|
if (data_item_win->handle != (WINDOW*) NULL
|
|
|
|
&& (data_item_win->height != 1
|
|
|
|
|| data_item_win->width != item_win_width
|
|
|
|
|| data_item_win->origin.x != (item_win_width * j) + 1
|
|
|
|
|| data_item_win->origin.y != cur_y))
|
|
|
|
{
|
|
|
|
tui_delete_win (data_item_win->handle);
|
|
|
|
data_item_win->handle = 0;
|
|
|
|
}
|
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
if (data_item_win->handle == (WINDOW *) NULL)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 00:05:16 +00:00
|
|
|
data_item_win->height = 1;
|
2004-03-13 14:14:01 +00:00
|
|
|
data_item_win->width = item_win_width;
|
2004-02-08 00:05:16 +00:00
|
|
|
data_item_win->origin.x = (item_win_width * j) + 1;
|
|
|
|
data_item_win->origin.y = cur_y;
|
|
|
|
tui_make_window (data_item_win, DONT_BOX_WINDOW);
|
|
|
|
scrollok (data_item_win->handle, FALSE);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2004-02-08 00:05:16 +00:00
|
|
|
touchwin (data_item_win->handle);
|
2001-07-21 19:46:59 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
/* Get the printable representation of the register
|
|
|
|
and display it. */
|
|
|
|
tui_display_register (data_element_ptr, data_item_win);
|
1999-04-16 01:35:26 +00:00
|
|
|
i++; /* next register */
|
|
|
|
}
|
2004-02-08 00:05:16 +00:00
|
|
|
cur_y++; /* next row; */
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
}
|
2004-01-19 16:06:04 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
/* Function to display the registers in the content from
|
|
|
|
'start_element_no' on 'start_line_no' until the end of the register
|
|
|
|
content or the end of the display height. This function checks
|
|
|
|
that we won't display off the end of the register display. */
|
1999-04-16 01:35:26 +00:00
|
|
|
void
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_display_reg_element_at_line (int start_element_no, int start_line_no)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL &&
|
|
|
|
TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 01:32:26 +00:00
|
|
|
int element_no = start_element_no;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
if (start_element_no != 0 && start_line_no != 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 01:32:26 +00:00
|
|
|
int last_line_no, first_line_on_last_page;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
last_line_no = tui_last_regs_line_no ();
|
|
|
|
first_line_on_last_page = last_line_no - (TUI_DATA_WIN->generic.height - 2);
|
|
|
|
if (first_line_on_last_page < 0)
|
|
|
|
first_line_on_last_page = 0;
|
1999-04-16 01:35:26 +00:00
|
|
|
/*
|
1999-07-07 20:19:36 +00:00
|
|
|
** If there is no other data displayed except registers,
|
2004-02-08 00:05:16 +00:00
|
|
|
** and the element_no causes us to scroll past the end of the
|
1999-07-07 20:19:36 +00:00
|
|
|
** registers, adjust what element to really start the display at.
|
|
|
|
*/
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0 &&
|
2004-02-08 00:05:16 +00:00
|
|
|
start_line_no > first_line_on_last_page)
|
|
|
|
element_no = tui_first_reg_element_no_inline (first_line_on_last_page);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_display_registers_from (element_no);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2004-02-08 00:05:16 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
/* Function to display the registers starting at line line_no in the
|
2004-01-19 16:06:04 +00:00
|
|
|
data window. Answers the line number that the display actually
|
|
|
|
started from. If nothing is displayed (-1) is returned. */
|
1999-04-16 01:35:26 +00:00
|
|
|
int
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_display_registers_from_line (int line_no, int force_display)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-08 00:05:16 +00:00
|
|
|
int line, element_no;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
if (line_no < 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
line = 0;
|
2004-02-08 00:05:16 +00:00
|
|
|
else if (force_display)
|
1999-04-16 01:35:26 +00:00
|
|
|
{ /*
|
2004-02-08 00:05:16 +00:00
|
|
|
** If we must display regs (force_display is true), then make
|
1999-07-07 20:19:36 +00:00
|
|
|
** sure that we don't display off the end of the registers.
|
|
|
|
*/
|
2004-02-08 00:05:16 +00:00
|
|
|
if (line_no >= tui_last_regs_line_no ())
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-01-19 16:06:04 +00:00
|
|
|
if ((line = tui_line_from_reg_element_no (
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
TUI_DATA_WIN->detail.data_display_info.regs_content_count - 1)) < 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
line = 0;
|
|
|
|
}
|
|
|
|
else
|
2004-02-08 00:05:16 +00:00
|
|
|
line = line_no;
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
else
|
2004-02-08 00:05:16 +00:00
|
|
|
line = line_no;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-02-08 00:05:16 +00:00
|
|
|
element_no = tui_first_reg_element_no_inline (line);
|
|
|
|
if (element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
|
|
|
|
tui_display_reg_element_at_line (element_no, line);
|
1999-04-16 01:35:26 +00:00
|
|
|
else
|
|
|
|
line = (-1);
|
|
|
|
|
|
|
|
return line;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (-1); /* nothing was displayed */
|
2004-01-19 16:06:04 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
2004-01-19 16:06:04 +00:00
|
|
|
/* This function check all displayed registers for changes in values,
|
|
|
|
given a particular frame. If the values have changed, they are
|
|
|
|
updated with the new value and highlighted. */
|
1999-04-16 01:35:26 +00:00
|
|
|
void
|
2004-01-19 16:06:04 +00:00
|
|
|
tui_check_register_values (struct frame_info *frame)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
struct tui_data_info *display_info
|
|
|
|
= &TUI_DATA_WIN->detail.data_display_info;
|
|
|
|
|
|
|
|
if (display_info->regs_content_count <= 0 && display_info->display_regs)
|
|
|
|
tui_show_registers (display_info->current_group);
|
1999-04-16 01:35:26 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
for (i = 0; (i < display_info->regs_content_count); i++)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
struct tui_data_element *data;
|
|
|
|
struct tui_gen_win_info *data_item_win_ptr;
|
2004-02-08 00:05:16 +00:00
|
|
|
int was_hilighted;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
data_item_win_ptr = &display_info->regs_content[i]->
|
|
|
|
which_element.data_window;
|
|
|
|
data = &((struct tui_win_element *)
|
|
|
|
data_item_win_ptr->content[0])->which_element.data;
|
|
|
|
was_hilighted = data->highlight;
|
|
|
|
|
|
|
|
tui_get_register (current_gdbarch, frame, data,
|
|
|
|
data->item_no, &data->highlight);
|
|
|
|
|
|
|
|
if (data->highlight || was_hilighted)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
tui_display_register (data, data_item_win_ptr);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-01-19 16:06:04 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
/* Display a register in a window. If hilite is TRUE,
|
|
|
|
then the value will be displayed in reverse video */
|
|
|
|
static void
|
|
|
|
tui_display_register (struct tui_data_element *data,
|
|
|
|
struct tui_gen_win_info *win_info)
|
|
|
|
{
|
|
|
|
if (win_info->handle != (WINDOW *) NULL)
|
|
|
|
{
|
|
|
|
int i;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
if (data->highlight)
|
|
|
|
wstandout (win_info->handle);
|
|
|
|
|
|
|
|
wmove (win_info->handle, 0, 0);
|
|
|
|
for (i = 1; i < win_info->width; i++)
|
|
|
|
waddch (win_info->handle, ' ');
|
|
|
|
wmove (win_info->handle, 0, 0);
|
|
|
|
if (data->content)
|
|
|
|
waddstr (win_info->handle, data->content);
|
|
|
|
|
|
|
|
if (data->highlight)
|
|
|
|
wstandend (win_info->handle);
|
|
|
|
tui_refresh_win (win_info);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
tui_reg_next_command (char *arg, int from_tty)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
if (TUI_DATA_WIN != 0)
|
|
|
|
{
|
|
|
|
struct reggroup *group
|
|
|
|
= TUI_DATA_WIN->detail.data_display_info.current_group;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
group = reggroup_next (current_gdbarch, group);
|
|
|
|
if (group == 0)
|
|
|
|
group = reggroup_next (current_gdbarch, 0);
|
|
|
|
|
|
|
|
if (group)
|
|
|
|
tui_show_registers (group);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
tui_reg_float_command (char *arg, int from_tty)
|
|
|
|
{
|
|
|
|
tui_show_registers (float_reggroup);
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
static void
|
|
|
|
tui_reg_general_command (char *arg, int from_tty)
|
|
|
|
{
|
|
|
|
tui_show_registers (general_reggroup);
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
static void
|
|
|
|
tui_reg_system_command (char *arg, int from_tty)
|
|
|
|
{
|
|
|
|
tui_show_registers (system_reggroup);
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct cmd_list_element *tuireglist;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
static void
|
|
|
|
tui_reg_command (char *args, int from_tty)
|
|
|
|
{
|
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 00:39:24 +00:00
|
|
|
printf_unfiltered (_("\"tui reg\" must be followed by the name of a "
|
|
|
|
"tui reg command.\n"));
|
2004-03-13 14:14:01 +00:00
|
|
|
help_list (tuireglist, "tui reg ", -1, gdb_stdout);
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
void
|
2004-02-08 00:05:16 +00:00
|
|
|
_initialize_tui_regs (void)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
struct cmd_list_element **tuicmd;
|
|
|
|
|
|
|
|
tuicmd = tui_get_cmd_list ();
|
|
|
|
|
|
|
|
add_prefix_cmd ("reg", class_tui, tui_reg_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
_("TUI commands to control the register window."),
|
2004-03-13 14:14:01 +00:00
|
|
|
&tuireglist, "tui reg ", 0,
|
|
|
|
tuicmd);
|
|
|
|
|
|
|
|
add_cmd ("float", class_tui, tui_reg_float_command,
|
2005-02-14 Andrew Cagney <cagney@gnu.org>
Mark up add_cmd.
* arch-utils.c, avr-tdep.c, breakpoint.c, corefile.c: Update.
* cp-abi.c, cp-namespace.c, cp-support.c, dummy-frame.c: Update.
* exec.c, gnu-nat.c, go32-nat.c, hppa-tdep.c, infcmd.c: Update.
* infrun.c, interps.c, macrocmd.c, maint.c, memattr.c: Update.
* mips-tdep.c, ocd.c, osabi.c, printcmd.c, regcache.c: Update.
* reggroups.c, remote-fileio.c, remote-rdi.c, remote.c: Update.
* sol-thread.c, source.c, stack.c, symfile-mem.c: Update.
* symfile.c, thread.c, tracepoint.c, valprint.c, value.c: Update.
* win32-nat.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-regs.c: Update.
2005-02-14 18:10:11 +00:00
|
|
|
_("Display only floating point registers."),
|
2004-03-13 14:14:01 +00:00
|
|
|
&tuireglist);
|
|
|
|
add_cmd ("general", class_tui, tui_reg_general_command,
|
2005-02-14 Andrew Cagney <cagney@gnu.org>
Mark up add_cmd.
* arch-utils.c, avr-tdep.c, breakpoint.c, corefile.c: Update.
* cp-abi.c, cp-namespace.c, cp-support.c, dummy-frame.c: Update.
* exec.c, gnu-nat.c, go32-nat.c, hppa-tdep.c, infcmd.c: Update.
* infrun.c, interps.c, macrocmd.c, maint.c, memattr.c: Update.
* mips-tdep.c, ocd.c, osabi.c, printcmd.c, regcache.c: Update.
* reggroups.c, remote-fileio.c, remote-rdi.c, remote.c: Update.
* sol-thread.c, source.c, stack.c, symfile-mem.c: Update.
* symfile.c, thread.c, tracepoint.c, valprint.c, value.c: Update.
* win32-nat.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-regs.c: Update.
2005-02-14 18:10:11 +00:00
|
|
|
_("Display only general registers."),
|
2004-03-13 14:14:01 +00:00
|
|
|
&tuireglist);
|
|
|
|
add_cmd ("system", class_tui, tui_reg_system_command,
|
2005-02-14 Andrew Cagney <cagney@gnu.org>
Mark up add_cmd.
* arch-utils.c, avr-tdep.c, breakpoint.c, corefile.c: Update.
* cp-abi.c, cp-namespace.c, cp-support.c, dummy-frame.c: Update.
* exec.c, gnu-nat.c, go32-nat.c, hppa-tdep.c, infcmd.c: Update.
* infrun.c, interps.c, macrocmd.c, maint.c, memattr.c: Update.
* mips-tdep.c, ocd.c, osabi.c, printcmd.c, regcache.c: Update.
* reggroups.c, remote-fileio.c, remote-rdi.c, remote.c: Update.
* sol-thread.c, source.c, stack.c, symfile-mem.c: Update.
* symfile.c, thread.c, tracepoint.c, valprint.c, value.c: Update.
* win32-nat.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-regs.c: Update.
2005-02-14 18:10:11 +00:00
|
|
|
_("Display only system registers."),
|
2004-03-13 14:14:01 +00:00
|
|
|
&tuireglist);
|
|
|
|
add_cmd ("next", class_tui, tui_reg_next_command,
|
2005-02-14 Andrew Cagney <cagney@gnu.org>
Mark up add_cmd.
* arch-utils.c, avr-tdep.c, breakpoint.c, corefile.c: Update.
* cp-abi.c, cp-namespace.c, cp-support.c, dummy-frame.c: Update.
* exec.c, gnu-nat.c, go32-nat.c, hppa-tdep.c, infcmd.c: Update.
* infrun.c, interps.c, macrocmd.c, maint.c, memattr.c: Update.
* mips-tdep.c, ocd.c, osabi.c, printcmd.c, regcache.c: Update.
* reggroups.c, remote-fileio.c, remote-rdi.c, remote.c: Update.
* sol-thread.c, source.c, stack.c, symfile-mem.c: Update.
* symfile.c, thread.c, tracepoint.c, valprint.c, value.c: Update.
* win32-nat.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-regs.c: Update.
2005-02-14 18:10:11 +00:00
|
|
|
_("Display next register group."),
|
2004-03-13 14:14:01 +00:00
|
|
|
&tuireglist);
|
|
|
|
|
2001-07-19 22:47:46 +00:00
|
|
|
if (xdb_commands)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
add_com ("fr", class_tui, tui_reg_float_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
_("Display only floating point registers\n"));
|
2004-03-13 14:14:01 +00:00
|
|
|
add_com ("gr", class_tui, tui_reg_general_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
_("Display only general registers\n"));
|
2004-03-13 14:14:01 +00:00
|
|
|
add_com ("sr", class_tui, tui_reg_system_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
_("Display only special registers\n"));
|
2004-02-08 00:05:16 +00:00
|
|
|
add_com ("+r", class_tui, tui_scroll_regs_forward_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
_("Scroll the registers window forward\n"));
|
2004-02-08 00:05:16 +00:00
|
|
|
add_com ("-r", class_tui, tui_scroll_regs_backward_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
_("Scroll the register window backward\n"));
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2001-07-19 22:47:46 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************
|
|
|
|
** STATIC LOCAL FUNCTIONS **
|
|
|
|
******************************************/
|
|
|
|
|
2001-07-17 06:44:57 +00:00
|
|
|
extern int pagination_enabled;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2001-07-17 06:44:57 +00:00
|
|
|
static void
|
|
|
|
tui_restore_gdbout (void *ui)
|
|
|
|
{
|
|
|
|
ui_file_delete (gdb_stdout);
|
|
|
|
gdb_stdout = (struct ui_file*) ui;
|
|
|
|
pagination_enabled = 1;
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
/* Get the register from the frame and make a printable representation
|
|
|
|
of it in the data element. */
|
1999-04-16 01:35:26 +00:00
|
|
|
static void
|
2004-03-13 14:14:01 +00:00
|
|
|
tui_register_format (struct gdbarch *gdbarch, struct frame_info *frame,
|
|
|
|
struct tui_data_element *data_element, int regnum)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2000-02-02 00:21:19 +00:00
|
|
|
struct ui_file *stream;
|
2001-07-17 06:44:57 +00:00
|
|
|
struct ui_file *old_stdout;
|
2002-08-25 09:12:36 +00:00
|
|
|
const char *name;
|
2001-07-17 06:44:57 +00:00
|
|
|
struct cleanup *cleanups;
|
2004-03-13 14:14:01 +00:00
|
|
|
char *p, *s;
|
2001-07-21 19:46:59 +00:00
|
|
|
int pos;
|
2007-01-21 17:37:51 +00:00
|
|
|
struct type *type = register_type (gdbarch, regnum);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
name = gdbarch_register_name (gdbarch, regnum);
|
2001-07-17 06:44:57 +00:00
|
|
|
if (name == 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
pagination_enabled = 0;
|
|
|
|
old_stdout = gdb_stdout;
|
2004-03-13 14:14:01 +00:00
|
|
|
stream = tui_sfileopen (256);
|
2001-07-17 06:44:57 +00:00
|
|
|
gdb_stdout = stream;
|
|
|
|
cleanups = make_cleanup (tui_restore_gdbout, (void*) old_stdout);
|
2004-03-13 14:14:01 +00:00
|
|
|
if (TYPE_VECTOR (type) != 0 && 0)
|
2001-07-21 19:46:59 +00:00
|
|
|
{
|
2005-05-22 Andrew Cagney <cagney@gnu.org>
* frame.h (frame_register_unwind, frame_unwind_register)
(get_frame_register, frame_register, put_frame_register)
(get_frame_memory, safe_frame_unwind_memory)
(frame_register_read): Use gdb_byte for byte buffer parameters.
* trad-frame.h (trad_frame_get_register)
(frame_get_prev_register): Ditto.
* frame-unwind.h (frame_prev_register_ftype): Ditto.
* frame.c (frame_pop, frame_register, frame_unwind_register)
(get_frame_register, frame_unwind_register_signed)
(frame_unwind_register_unsigned, frame_unwind_unsigned_register)
(frame_register_read, get_frame_memory): Update.
* trad-frame.c (trad_frame_get_prev_register): Update.
(trad_frame_get_register): Update.
* gdbcore.h (deprecated_read_memory_nobpt, read_memory): Ditto.
* breakpoint.c (deprecated_read_memory_nobpt): Update.
* corefile.c (read_memory): Update.
* tramp-frame.c (tramp_frame_prev_register): Update.
* valops.c (value_assign): Update.
* sentinel-frame.c (sentinel_frame_prev_register): Update.
* std-regs.c (value_of_builtin_frame_fp_reg)
(value_of_builtin_frame_pc_reg): Update.
* infcmd.c (default_print_registers_info): Update
* dummy-frame.c (dummy_frame_prev_register): Update.
* findvar.c (value_of_register, value_from_register): Update.
* tui/tui-regs.c (tui_register_format, tui_get_register): Update.
* mi/mi-main.c (register_changed_p, get_register): Update.
2005-05-22 14:53:35 +00:00
|
|
|
gdb_byte buf[MAX_REGISTER_SIZE];
|
2004-03-13 14:14:01 +00:00
|
|
|
int len;
|
|
|
|
|
|
|
|
len = register_size (current_gdbarch, regnum);
|
|
|
|
fprintf_filtered (stream, "%-14s ", name);
|
|
|
|
get_frame_register (frame, regnum, buf);
|
|
|
|
print_scalar_formatted (buf, type, 'f', len, stream);
|
2001-07-21 19:46:59 +00:00
|
|
|
}
|
2004-03-13 14:14:01 +00:00
|
|
|
else
|
2001-07-21 19:46:59 +00:00
|
|
|
{
|
2004-03-13 14:14:01 +00:00
|
|
|
gdbarch_print_registers_info (current_gdbarch, stream,
|
|
|
|
frame, regnum, 1);
|
2001-07-21 19:46:59 +00:00
|
|
|
}
|
2004-03-13 14:14:01 +00:00
|
|
|
|
|
|
|
/* Save formatted output in the buffer. */
|
|
|
|
p = tui_file_get_strbuf (stream);
|
2001-07-17 06:44:57 +00:00
|
|
|
|
|
|
|
/* Remove the possible \n. */
|
2004-03-13 14:14:01 +00:00
|
|
|
s = strrchr (p, '\n');
|
|
|
|
if (s && s[1] == 0)
|
|
|
|
*s = 0;
|
2001-07-17 06:44:57 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
xfree (data_element->content);
|
|
|
|
data_element->content = xstrdup (p);
|
2001-07-17 06:44:57 +00:00
|
|
|
do_cleanups (cleanups);
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
/* Get the register value from the given frame and format it for
|
|
|
|
the display. When changep is set, check if the new register value
|
|
|
|
has changed with respect to the previous call. */
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h (Opaque, OpaquePtr OpaqueList): Delete definition.
(TuiPoint, TuiPointPtr): Ditto.
(TuiStatus, TuiStatusPtr): Ditto.
(TuiWinType, TuiWinTypePtr): Ditto.
(struct tui_point): Rename _TuiPoint.
(tui_get_low_disassembly_address): Rename
tuiGetLowDisassemblyAddress.
(tui_update_all_exec_infos): Rename tuiUpdateAllExecInfos.
(tuiFree): Delete declaration.
(OpaqueFuncPtr, TuiOpaqueFuncPtr): Delete definitions.
(TuiVoidFuncPtr, TuiIntFuncPtr): Delete definitions.
* tui/tui.c (tuiFree): Delete function.
* cli/cli-cmds.c (disassemble_command): Update references.
* tui/tui-data.c, tui/tui-data.h, tui/tui-disasm.c: Ditto.
* tui/tui-layout.c, tui/tui-regs.c, tui/tui-source.c: Ditto.
* tui/tui-stack.c, tui/tui-win.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c: Ditto.
2004-02-07 17:46:14 +00:00
|
|
|
static enum tui_status
|
2004-03-13 14:14:01 +00:00
|
|
|
tui_get_register (struct gdbarch *gdbarch, struct frame_info *frame,
|
|
|
|
struct tui_data_element *data, int regnum, int *changedp)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h (Opaque, OpaquePtr OpaqueList): Delete definition.
(TuiPoint, TuiPointPtr): Ditto.
(TuiStatus, TuiStatusPtr): Ditto.
(TuiWinType, TuiWinTypePtr): Ditto.
(struct tui_point): Rename _TuiPoint.
(tui_get_low_disassembly_address): Rename
tuiGetLowDisassemblyAddress.
(tui_update_all_exec_infos): Rename tuiUpdateAllExecInfos.
(tuiFree): Delete declaration.
(OpaqueFuncPtr, TuiOpaqueFuncPtr): Delete definitions.
(TuiVoidFuncPtr, TuiIntFuncPtr): Delete definitions.
* tui/tui.c (tuiFree): Delete function.
* cli/cli-cmds.c (disassemble_command): Update references.
* tui/tui-data.c, tui/tui-data.h, tui/tui-disasm.c: Ditto.
* tui/tui-layout.c, tui/tui-regs.c, tui/tui-source.c: Ditto.
* tui/tui-stack.c, tui/tui-win.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c: Ditto.
2004-02-07 17:46:14 +00:00
|
|
|
enum tui_status ret = TUI_FAILURE;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2004-03-13 14:14:01 +00:00
|
|
|
if (changedp)
|
|
|
|
*changedp = FALSE;
|
1999-04-16 01:35:26 +00:00
|
|
|
if (target_has_registers)
|
|
|
|
{
|
2005-05-22 Andrew Cagney <cagney@gnu.org>
* frame.h (frame_register_unwind, frame_unwind_register)
(get_frame_register, frame_register, put_frame_register)
(get_frame_memory, safe_frame_unwind_memory)
(frame_register_read): Use gdb_byte for byte buffer parameters.
* trad-frame.h (trad_frame_get_register)
(frame_get_prev_register): Ditto.
* frame-unwind.h (frame_prev_register_ftype): Ditto.
* frame.c (frame_pop, frame_register, frame_unwind_register)
(get_frame_register, frame_unwind_register_signed)
(frame_unwind_register_unsigned, frame_unwind_unsigned_register)
(frame_register_read, get_frame_memory): Update.
* trad-frame.c (trad_frame_get_prev_register): Update.
(trad_frame_get_register): Update.
* gdbcore.h (deprecated_read_memory_nobpt, read_memory): Ditto.
* breakpoint.c (deprecated_read_memory_nobpt): Update.
* corefile.c (read_memory): Update.
* tramp-frame.c (tramp_frame_prev_register): Update.
* valops.c (value_assign): Update.
* sentinel-frame.c (sentinel_frame_prev_register): Update.
* std-regs.c (value_of_builtin_frame_fp_reg)
(value_of_builtin_frame_pc_reg): Update.
* infcmd.c (default_print_registers_info): Update
* dummy-frame.c (dummy_frame_prev_register): Update.
* findvar.c (value_of_register, value_from_register): Update.
* tui/tui-regs.c (tui_register_format, tui_get_register): Update.
* mi/mi-main.c (register_changed_p, get_register): Update.
2005-05-22 14:53:35 +00:00
|
|
|
gdb_byte buf[MAX_REGISTER_SIZE];
|
2004-03-13 14:14:01 +00:00
|
|
|
get_frame_register (frame, regnum, buf);
|
|
|
|
|
2007-05-06 19:37:31 +00:00
|
|
|
if (changedp)
|
|
|
|
{
|
|
|
|
int size = register_size (gdbarch, regnum);
|
|
|
|
char *old = (char*) data->value;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < size; i++)
|
|
|
|
if (buf[i] != old[i])
|
|
|
|
{
|
|
|
|
*changedp = TRUE;
|
|
|
|
old[i] = buf[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Reformat the data content if the value changed. */
|
|
|
|
if (changedp == 0 || *changedp == TRUE)
|
|
|
|
tui_register_format (gdbarch, frame, data, regnum);
|
|
|
|
|
|
|
|
ret = TUI_SUCCESS;
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
return ret;
|
2004-02-08 00:05:16 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
static void
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_scroll_regs_forward_command (char *arg, int from_tty)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
tui_scroll (FORWARD_SCROLL, TUI_DATA_WIN, 1);
|
2001-07-18 22:03:22 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
2004-02-08 00:05:16 +00:00
|
|
|
tui_scroll_regs_backward_command (char *arg, int from_tty)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
2004-02-07 20:57:02 +00:00
|
|
|
tui_scroll (BACKWARD_SCROLL, TUI_DATA_WIN, 1);
|
2001-07-18 22:03:22 +00:00
|
|
|
}
|