Disassemble count lines starting at pc.
Return address of the count'th instruction after pc. */
static CORE_ADDR
-tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count)
+tui_disassemble (struct tui_asm_line* asm_lines, CORE_ADDR pc, int count)
{
struct ui_file *gdb_dis_out;
gdb_dis_out = tui_sfileopen (256);
/* Now construct each line */
- for (; count > 0; count--, lines++)
+ for (; count > 0; count--, asm_lines++)
{
- if (lines->addr_string)
- xfree (lines->addr_string);
- if (lines->insn)
- xfree (lines->insn);
+ if (asm_lines->addr_string)
+ xfree (asm_lines->addr_string);
+ if (asm_lines->insn)
+ xfree (asm_lines->insn);
print_address (pc, gdb_dis_out);
- lines->addr = pc;
- lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out));
+ asm_lines->addr = pc;
+ asm_lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out));
ui_file_rewind (gdb_dis_out);
pc = pc + gdb_print_insn (pc, gdb_dis_out);
- lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out));
+ asm_lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out));
/* reset the buffer to empty */
ui_file_rewind (gdb_dis_out);
CORE_ADDR new_low;
int max_lines;
int i;
- struct tui_asm_line* lines;
+ struct tui_asm_line* asm_lines;
max_lines = (from > 0) ? from : - from;
if (max_lines <= 1)
return pc;
- lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
+ asm_lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
* max_lines);
- memset (lines, 0, sizeof (struct tui_asm_line) * max_lines);
+ memset (asm_lines, 0, sizeof (struct tui_asm_line) * max_lines);
new_low = pc;
if (from > 0)
{
- tui_disassemble (lines, pc, max_lines);
- new_low = lines[max_lines - 1].addr;
+ tui_disassemble (asm_lines, pc, max_lines);
+ new_low = asm_lines[max_lines - 1].addr;
}
else
{
else
new_low += 1 * max_lines;
- tui_disassemble (lines, new_low, max_lines);
- last_addr = lines[pos].addr;
+ tui_disassemble (asm_lines, new_low, max_lines);
+ last_addr = asm_lines[pos].addr;
} while (last_addr > pc && msymbol);
/* Scan forward disassembling one instruction at a time
if (pos >= max_lines)
pos = 0;
- next_addr = tui_disassemble (&lines[pos], last_addr, 1);
+ next_addr = tui_disassemble (&asm_lines[pos], last_addr, 1);
/* If there are some problems while disassembling exit. */
if (next_addr <= last_addr)
pos++;
if (pos >= max_lines)
pos = 0;
- new_low = lines[pos].addr;
+ new_low = asm_lines[pos].addr;
}
for (i = 0; i < max_lines; i++)
{
- xfree (lines[i].addr_string);
- xfree (lines[i].insn);
+ xfree (asm_lines[i].addr_string);
+ xfree (asm_lines[i].insn);
}
return new_low;
}
CORE_ADDR cur_pc;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
int tab_len = tui_default_tab_len ();
- struct tui_asm_line* lines;
+ struct tui_asm_line* asm_lines;
int insn_pos;
int addr_size, max_size;
char* line;
max_lines = TUI_DISASM_WIN->generic.height - 2; /* account for hilite */
/* Get temporary table that will hold all strings (addr & insn). */
- lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
+ asm_lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
* max_lines);
- memset (lines, 0, sizeof (struct tui_asm_line) * max_lines);
+ memset (asm_lines, 0, sizeof (struct tui_asm_line) * max_lines);
line_width = TUI_DISASM_WIN->generic.width - 1;
- tui_disassemble (lines, pc, max_lines);
+ tui_disassemble (asm_lines, pc, max_lines);
/* See what is the maximum length of an address and of a line. */
addr_size = 0;
max_size = 0;
for (i = 0; i < max_lines; i++)
{
- size_t len = strlen (lines[i].addr_string);
+ size_t len = strlen (asm_lines[i].addr_string);
if (len > addr_size)
addr_size = len;
- len = strlen (lines[i].insn) + tab_len;
+ len = strlen (asm_lines[i].insn) + tab_len;
if (len > max_size)
max_size = len;
}
element = (struct tui_win_element *) TUI_DISASM_WIN->generic.content[i];
src = &element->which_element.source;
- strcpy (line, lines[i].addr_string);
+ strcpy (line, asm_lines[i].addr_string);
cur_len = strlen (line);
/* Add spaces to make the instructions start on the same column */
cur_len++;
}
- strcat (line, lines[i].insn);
+ strcat (line, asm_lines[i].insn);
/* Now copy the line taking the offset into account */
if (strlen (line) > offset)
else
src->line[0] = '\0';
- src->line_or_addr.addr = lines[i].addr;
- src->is_exec_point = lines[i].addr == cur_pc;
+ src->line_or_addr.addr = asm_lines[i].addr;
+ src->is_exec_point = asm_lines[i].addr == cur_pc;
/* See whether there is a breakpoint installed. */
src->has_break = (!src->is_exec_point
&& breakpoint_here_p (pc) != no_breakpoint_here);
- xfree (lines[i].addr_string);
- xfree (lines[i].insn);
+ xfree (asm_lines[i].addr_string);
+ xfree (asm_lines[i].insn);
}
TUI_DISASM_WIN->generic.content_size = i;
return TUI_SUCCESS;
TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
{
int i = start_element_no;
- int j, value_chars_wide, item_win_width, cur_y, label_width;
+ int j, value_chars_wide, item_win_width, cur_y;
enum precision_type precision;
+ /* Do not rename the following variable into "label_width".
+ Unfortunately, term.h on AiX systems defines a macro with
+ the same name, which causes a build failure if we use the
+ same name for this variable. */
+ int tui_label_width;
+
precision = (TUI_DATA_WIN->detail.data_display_info.regs_display_type
== TUI_DFLOAT_REGS) ?
double_precision : unspecified_precision;
TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS)
{
value_chars_wide = DOUBLE_FLOAT_VALUE_WIDTH;
- label_width = DOUBLE_FLOAT_LABEL_WIDTH;
+ tui_label_width = DOUBLE_FLOAT_LABEL_WIDTH;
}
else
{
TUI_SFLOAT_REGS)
{
value_chars_wide = SINGLE_FLOAT_VALUE_WIDTH;
- label_width = SINGLE_FLOAT_LABEL_WIDTH;
+ tui_label_width = SINGLE_FLOAT_LABEL_WIDTH;
}
else
{
value_chars_wide = SINGLE_VALUE_WIDTH;
- label_width = SINGLE_LABEL_WIDTH;
+ tui_label_width = SINGLE_LABEL_WIDTH;
}
}
- item_win_width = value_chars_wide + label_width;
+ item_win_width = value_chars_wide + tui_label_width;
/*
** Now create each data "sub" window, and write the display into it.
*/
{
int i;
char buf[40];
- int value_chars_wide, label_width;
+ int value_chars_wide;
struct tui_data_element * data_element_ptr = &((tui_win_content)
win_info->content)[0]->which_element.data;
+ /* Do not rename the following variable into "label_width".
+ Unfortunately, term.h on AiX systems defines a macro with
+ the same name, which causes a build failure if we use the
+ same name for this variable. */
+ int tui_label_width;
+
if (IS_64BIT ||
TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS)
{
value_chars_wide = DOUBLE_FLOAT_VALUE_WIDTH;
- label_width = DOUBLE_FLOAT_LABEL_WIDTH;
+ tui_label_width = DOUBLE_FLOAT_LABEL_WIDTH;
}
else
{
TUI_SFLOAT_REGS)
{
value_chars_wide = SINGLE_FLOAT_VALUE_WIDTH;
- label_width = SINGLE_FLOAT_LABEL_WIDTH;
+ tui_label_width = SINGLE_FLOAT_LABEL_WIDTH;
}
else
{
value_chars_wide = SINGLE_VALUE_WIDTH;
- label_width = SINGLE_LABEL_WIDTH;
+ tui_label_width = SINGLE_LABEL_WIDTH;
}
}
buf[0] = (char) 0;
tui_register_format (buf,
- value_chars_wide + label_width,
+ value_chars_wide + tui_label_width,
reg_num,
data_element_ptr,
precision);