diff options
author | Andrew Stubbs <andrew.stubbs@st.com> | 2005-11-01 17:40:25 +0000 |
---|---|---|
committer | Andrew Stubbs <andrew.stubbs@st.com> | 2005-11-01 17:40:25 +0000 |
commit | 362c05fe98907eeba515c04386aee99936914114 (patch) | |
tree | fdf7e5641627956309e33c7bab0f0c71da230c3d /gdb/tui/tui-disasm.c | |
parent | 3929abe911f69151c090ce5f3912324b852d273c (diff) | |
download | gdb-362c05fe98907eeba515c04386aee99936914114.zip gdb-362c05fe98907eeba515c04386aee99936914114.tar.gz gdb-362c05fe98907eeba515c04386aee99936914114.tar.bz2 |
2005-11-01 Andrew Stubbs <andrew.stubbs@st.com>
* tui/tui-data.h (tui_line_or_address): Encapsulate the union in a
struct with a tag.
(tui_source_element, tui_source_info): Update.
* tui/tui-disasm.c, tui/tui-source.c: Update to use the tagged union.
* tui/tui-source.h, tui/tui-stack.c, tui/tui-win.c: Likewise.
* tui/tui-winsource.c, tui/tui-data.c, tui/tui-layout.c: Likewise.
* tui/tui-winsource.h: Likewise.
Diffstat (limited to 'gdb/tui/tui-disasm.c')
-rw-r--r-- | gdb/tui/tui-disasm.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 9c3072b..aa5a62c 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -188,7 +188,8 @@ tui_set_disassem_content (CORE_ADDR pc) if (ret != TUI_SUCCESS) return ret; - TUI_DISASM_WIN->detail.source_info.start_line_or_addr.addr = pc; + 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); @@ -249,7 +250,8 @@ tui_set_disassem_content (CORE_ADDR pc) else src->line[0] = '\0'; - src->line_or_addr.addr = asm_lines[i].addr; + src->line_or_addr.loa = LOA_ADDRESS; + src->line_or_addr.u.addr = asm_lines[i].addr; src->is_exec_point = asm_lines[i].addr == cur_pc; /* See whether there is a breakpoint installed. */ @@ -270,9 +272,10 @@ tui_show_disassem (CORE_ADDR start_addr) { struct symtab *s = find_pc_symtab (start_addr); struct tui_win_info * win_with_focus = tui_win_with_focus (); - union tui_line_or_address val; + struct tui_line_or_address val; - val.addr = start_addr; + val.loa = LOA_ADDRESS; + val.u.addr = start_addr; tui_add_win_to_layout (DISASSEM_WIN); tui_update_source_window (TUI_DISASM_WIN, s, val, FALSE); /* @@ -295,14 +298,15 @@ tui_show_disassem_and_update_source (CORE_ADDR start_addr) tui_show_disassem (start_addr); if (tui_current_layout () == SRC_DISASSEM_COMMAND) { - union tui_line_or_address val; + struct tui_line_or_address val; /* ** Update what is in the source window if it is displayed too, ** note that it follows what is in the disassembly window and visa-versa */ sal = find_pc_line (start_addr, 0); - val.line_no = sal.line; + val.loa = LOA_LINE; + val.u.line_no = sal.line; tui_update_source_window (TUI_SRC_WIN, sal.symtab, val, TRUE); if (sal.symtab) { @@ -376,7 +380,7 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction, CORE_ADDR pc; tui_win_content content; struct symtab *s; - union tui_line_or_address val; + struct tui_line_or_address val; int max_lines, dir; struct symtab_and_line cursal = get_current_source_symtab_and_line (); @@ -388,10 +392,11 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction, /* account for hilite */ max_lines = TUI_DISASM_WIN->generic.height - 2; - pc = content[0]->which_element.source.line_or_addr.addr; + pc = content[0]->which_element.source.line_or_addr.u.addr; dir = (scroll_direction == FORWARD_SCROLL) ? max_lines : - max_lines; - val.addr = tui_find_disassembly_address (pc, dir); + val.loa = LOA_ADDRESS; + val.u.addr = tui_find_disassembly_address (pc, dir); tui_update_source_window_as_is (TUI_DISASM_WIN, s, val, FALSE); } } |