/* Disassembly display.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2013 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arch-utils.h"
#include "symtab.h"
#include "breakpoint.h"
#include "frame.h"
#include "tui/tui-stack.h"
#include "tui/tui-file.h"
#include "tui/tui-disasm.h"
+#include "progspace.h"
#include "gdb_curses.h"
if (asm_lines->insn)
xfree (asm_lines->insn);
- print_address (pc, gdb_dis_out);
+ print_address (gdbarch, pc, gdb_dis_out);
asm_lines->addr = pc;
asm_lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out));
enum tui_status ret = TUI_FAILURE;
int i;
int offset = TUI_DISASM_WIN->detail.source_info.horizontal_offset;
- int line_width, max_lines;
+ int max_lines;
CORE_ADDR cur_pc;
struct tui_gen_win_info *locator = tui_locator_win_info_ptr ();
int tab_len = tui_default_tab_len ();
TUI_DISASM_WIN->detail.source_info.gdbarch = gdbarch;
TUI_DISASM_WIN->detail.source_info.start_line_or_addr.loa = LOA_ADDRESS;
TUI_DISASM_WIN->detail.source_info.start_line_or_addr.u.addr = pc;
- cur_pc = (CORE_ADDR)
- (((struct tui_win_element *) locator->content[0])->which_element.locator.addr);
+ cur_pc = (CORE_ADDR) (((struct tui_win_element *)
+ locator->content[0])->which_element.locator.addr);
max_lines = TUI_DISASM_WIN->generic.height - 2; /* Account for
hilite. */
* max_lines);
memset (asm_lines, 0, sizeof (struct tui_asm_line) * max_lines);
- line_width = TUI_DISASM_WIN->generic.width - 1;
-
tui_disassemble (gdbarch, asm_lines, pc, max_lines);
/* See what is the maximum length of an address and of a line. */
for (i = 0; i < max_lines; i++)
{
size_t len = strlen (asm_lines[i].addr_string);
+
if (len > addr_size)
addr_size = len;
/* See whether there is a breakpoint installed. */
src->has_break = (!src->is_exec_point
- && breakpoint_here_p (pc) != no_breakpoint_here);
+ && breakpoint_here_p (current_program_space->aspace,
+ pc)
+ != no_breakpoint_here);
xfree (asm_lines[i].addr_string);
xfree (asm_lines[i].insn);
if (sal.symtab)
{
set_current_source_symtab_and_line (&sal);
- tui_update_locator_filename (sal.symtab->filename);
+ tui_update_locator_fullname (symtab_to_fullname (sal.symtab));
}
else
- tui_update_locator_filename ("?");
+ tui_update_locator_fullname ("?");
}
return;
{
struct tui_gen_win_info *locator;
struct tui_locator_element *element;
- struct gdbarch *gdbarch = NULL;
+ struct gdbarch *gdbarch = get_current_arch ();
CORE_ADDR addr;
locator = tui_locator_win_info_ptr ();
- element = &((struct tui_win_element *) locator->content[0])->which_element.locator;
+ element = &((struct tui_win_element *)
+ locator->content[0])->which_element.locator;
if (element->addr == 0)
{
pc = content[0]->which_element.source.line_or_addr.u.addr;
num_to_scroll++;
- dir = (scroll_direction == FORWARD_SCROLL) ? num_to_scroll : -num_to_scroll;
+ dir = (scroll_direction == FORWARD_SCROLL)
+ ? num_to_scroll : -num_to_scroll;
val.loa = LOA_ADDRESS;
val.u.addr = tui_find_disassembly_address (gdbarch, pc, dir);
- tui_update_source_window_as_is (TUI_DISASM_WIN, gdbarch, NULL, val, FALSE);
+ tui_update_source_window_as_is (TUI_DISASM_WIN, gdbarch,
+ NULL, val, FALSE);
}
}