/* TUI layout window management.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
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
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
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
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arch-utils.h"
#include "command.h"
#include "symtab.h"
#include "frame.h"
#include "tui/tui-win.h"
#include "tui/tui-winsource.h"
#include "tui/tui-disasm.h"
+#include "tui/tui-layout.h"
#include "gdb_string.h"
#include "gdb_curses.h"
static void tui_layout_command (char *, int);
static void tui_toggle_layout_command (char *, int);
static void tui_toggle_split_layout_command (char *, int);
-static CORE_ADDR extract_display_start_addr (void);
+static void extract_display_start_addr (struct gdbarch **, CORE_ADDR *);
static void tui_handle_xdb_layout (struct tui_layout_def *);
enum tui_layout_type cur_layout = tui_current_layout (),
new_layout = UNDEFINED_LAYOUT;
int regs_populate = FALSE;
- CORE_ADDR addr = extract_display_start_addr ();
+ struct gdbarch *gdbarch;
+ CORE_ADDR addr;
struct tui_win_info *win_with_focus = tui_win_with_focus ();
struct tui_layout_def *layout_def = tui_layout_def ();
+ extract_display_start_addr (&gdbarch, &addr);
if (layout_type == UNDEFINED_LAYOUT
&& regs_display_type != TUI_UNDEFINED_REGS)
2. if target was compiled without -g
We still want to show the assembly though! */
- addr = tui_get_begin_asm_address ();
+ tui_get_begin_asm_address (&gdbarch, &addr);
tui_set_win_focus_to (TUI_DISASM_WIN);
layout_def->display_mode = DISASSEM_WIN;
layout_def->split = FALSE;
2. if target was compiled without -g
We still want to show the assembly though! */
- addr = tui_get_begin_asm_address ();
+ tui_get_begin_asm_address (&gdbarch, &addr);
if (win_with_focus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_SRC_WIN);
else
2. if target was compiled without -g
We still want to show the assembly though! */
- addr = tui_get_begin_asm_address ();
+ tui_get_begin_asm_address (&gdbarch, &addr);
if (win_with_focus != TUI_DATA_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN);
else
|| new_layout == DISASSEM_DATA_COMMAND))
tui_display_all_data ();
- tui_update_source_windows_with_addr (addr);
+ tui_update_source_windows_with_addr (gdbarch, addr);
}
if (regs_populate)
{
/* Function to initialize gdb commands, for tui window layout
manipulation. */
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+extern initialize_file_ftype _initialize_tui_layout;
+
void
_initialize_tui_layout (void)
{
}
-static CORE_ADDR
-extract_display_start_addr (void)
+static void
+extract_display_start_addr (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
{
enum tui_layout_type cur_layout = tui_current_layout ();
+ struct gdbarch *gdbarch = get_current_arch ();
CORE_ADDR addr;
CORE_ADDR pc;
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
{
case SRC_COMMAND:
case SRC_DATA_COMMAND:
+ gdbarch = TUI_SRC_WIN->detail.source_info.gdbarch;
find_line_pc (cursal.symtab,
TUI_SRC_WIN->detail.source_info.start_line_or_addr.u.line_no,
&pc);
case DISASSEM_COMMAND:
case SRC_DISASSEM_COMMAND:
case DISASSEM_DATA_COMMAND:
+ gdbarch = TUI_DISASM_WIN->detail.source_info.gdbarch;
addr = TUI_DISASM_WIN->detail.source_info.start_line_or_addr.u.addr;
break;
default:
break;
}
- return addr;
+ *gdbarch_p = gdbarch;
+ *addr_p = addr;
}