+2002-09-29 Elena Zannoni <ezannoni@redhat.com>
+
+ * tui.c (tui_show_source): Don't access current_source_symtab, use
+ accessor function instead. Include source.h and symtab.h
+ * tuiDisassem.c (tuiShowDisassemAndUpdateSource,
+ tuiVerticalDisassemScroll): Use accessor functions for current
+ source line and symtab. Include source.h.
+ * tuiLayout.c (_extractDisplayStartAddr): Use accessor functions
+ for current source line and symtab. Include source.h.
+ * tuiWin.c (_makeVisibleWithNewHeight): Ditto.
+ * tuiSourceWin.c (tuiUpdateSourceWindowAsIs,
+ tuiHorizontalSourceScroll): Ditto.
+ * tuiSource.c (tuiVerticalSourceScroll): Ditto.
+
2002-09-13 Stephane Carrez <stcarrez@nerim.fr>
* tui.c (tui_rl_switch_mode): Remove unecessary TUI switch printfs.
#include "frame.h"
#include "breakpoint.h"
#include "inferior.h"
+#include "symtab.h"
+#include "source.h"
/* Tells whether the TUI is active or not. */
int tui_active = 0;
void
tui_show_source (const char *file, int line)
{
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
/* make sure that the source window is displayed */
tuiAddWinToLayout (SRC_WIN);
- tuiUpdateSourceWindowsWithLine (current_source_symtab, line);
+ tuiUpdateSourceWindowsWithLine (cursal.symtab, line);
tuiUpdateLocatorFilename (file);
}
#include "breakpoint.h"
#include "frame.h"
#include "value.h"
+#include "source.h"
#include "tui.h"
#include "tuiData.h"
tuiUpdateSourceWindow (srcWin, sal.symtab, val, TRUE);
if (sal.symtab)
{
- current_source_symtab = sal.symtab;
+ set_current_source_symtab_and_line (&sal);
tuiUpdateLocatorFilename (sal.symtab->filename);
}
else
struct symtab *s;
TuiLineOrAddress val;
int maxLines, dir;
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
content = (TuiWinContent) disassemWin->generic.content;
- if (current_source_symtab == (struct symtab *) NULL)
+ if (cursal.symtab == (struct symtab *) NULL)
s = find_pc_symtab (selected_frame->pc);
else
- s = current_source_symtab;
+ s = cursal.symtab;
/* account for hilite */
maxLines = disassemWin->generic.height - 2;
#include "command.h"
#include "symtab.h"
#include "frame.h"
+#include "source.h"
#include <ctype.h>
#include "tui.h"
TuiLayoutType curLayout = currentLayout ();
CORE_ADDR addr;
CORE_ADDR pc;
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
switch (curLayout)
{
case SRC_COMMAND:
case SRC_DATA_COMMAND:
- find_line_pc (current_source_symtab,
+ find_line_pc (cursal.symtab,
srcWin->detail.sourceInfo.startLineOrAddr.lineNo,
&pc);
addr = pc;
TuiLineOrAddress l;
struct symtab *s;
TuiWinContent content = (TuiWinContent) srcWin->generic.content;
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
- if (current_source_symtab == (struct symtab *) NULL)
+ if (cursal.symtab == (struct symtab *) NULL)
s = find_pc_symtab (selected_frame->pc);
else
- s = current_source_symtab;
+ s = cursal.symtab;
if (scrollDirection == FORWARD_SCROLL)
{
#include "frame.h"
#include "breakpoint.h"
#include "value.h"
+#include "source.h"
#include "tui.h"
#include "tuiData.h"
tuiUpdateExecInfo (winInfo);
if (winInfo->generic.type == SRC_WIN)
{
- current_source_line = lineOrAddr.lineNo +
+ struct symtab_and_line sal;
+
+ sal.line = lineOrAddr.lineNo +
(winInfo->generic.contentSize - 2);
- current_source_symtab = s;
+ sal.symtab = s;
+ set_current_source_symtab_and_line (&sal);
/*
** If the focus was in the asm win, put it in the src
** win if we don't have a split layout
{
int offset;
struct symtab *s;
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
- if (current_source_symtab == (struct symtab *) NULL)
+ if (cursal.symtab == (struct symtab *) NULL)
s = find_pc_symtab (selected_frame->pc);
else
- s = current_source_symtab;
+ s = cursal.symtab;
if (direction == LEFT_SCROLL)
offset = winInfo->detail.sourceInfo.horizontalOffset + numToScroll;
#include "frame.h"
#include "cli/cli-cmds.h"
#include "top.h"
+#include "source.h"
#include "tui.h"
#include "tuiData.h"
if (winInfo->generic.content != (OpaquePtr) NULL)
{
TuiLineOrAddress lineOrAddr;
+ struct symtab_and_line cursal
+ = get_current_source_symtab_and_line ();
if (winInfo->generic.type == SRC_WIN)
lineOrAddr.lineNo =
winInfo->detail.sourceInfo.startLineOrAddr.addr;
freeWinContent (&winInfo->generic);
tuiUpdateSourceWindow (winInfo,
- current_source_symtab, lineOrAddr, TRUE);
+ cursal.symtab, lineOrAddr, TRUE);
}
else if (selected_frame != (struct frame_info *) NULL)
{
TuiLineOrAddress line;
- extern int current_source_line;
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+
s = find_pc_symtab (selected_frame->pc);
if (winInfo->generic.type == SRC_WIN)
- line.lineNo = current_source_line;
+ line.lineNo = cursal.line;
else
{
- find_line_pc (s, current_source_line, &line.addr);
+ find_line_pc (s, cursal.line, &line.addr);
}
tuiUpdateSourceWindow (winInfo, s, line, TRUE);
}