summaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-09-30 00:52:27 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-09-30 00:52:27 +0000
commit6ee4fb0f58ae1cf110f618df7e679d660d042e2e (patch)
tree7b8f0229cdfc5b9cc5fbe9cd7c9ee161baa1ddf2 /gdb/tui
parent277df5a9ee6e1495feb31115cf5ddccb6829affb (diff)
downloadgdb-6ee4fb0f58ae1cf110f618df7e679d660d042e2e.tar.gz
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.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/ChangeLog14
-rw-r--r--gdb/tui/tui.c5
-rw-r--r--gdb/tui/tuiDisassem.c8
-rw-r--r--gdb/tui/tuiLayout.c4
-rw-r--r--gdb/tui/tuiSource.c5
-rw-r--r--gdb/tui/tuiSourceWin.c13
-rw-r--r--gdb/tui/tuiWin.c12
7 files changed, 46 insertions, 15 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index edff2bd9c07..e2bc95fe455 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,17 @@
+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.
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 81edd8b85c7..a7c16bcbe0c 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -67,6 +67,8 @@
#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;
@@ -543,10 +545,11 @@ _tuiReset (void)
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);
}
diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c
index 50a6d0ef9f7..f79cc12ab66 100644
--- a/gdb/tui/tuiDisassem.c
+++ b/gdb/tui/tuiDisassem.c
@@ -44,6 +44,7 @@
#include "breakpoint.h"
#include "frame.h"
#include "value.h"
+#include "source.h"
#include "tui.h"
#include "tuiData.h"
@@ -337,7 +338,7 @@ tuiShowDisassemAndUpdateSource (CORE_ADDR startAddr)
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
@@ -415,12 +416,13 @@ tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection,
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;
diff --git a/gdb/tui/tuiLayout.c b/gdb/tui/tuiLayout.c
index c3eae72c3c5..cddbd14342f 100644
--- a/gdb/tui/tuiLayout.c
+++ b/gdb/tui/tuiLayout.c
@@ -43,6 +43,7 @@
#include "command.h"
#include "symtab.h"
#include "frame.h"
+#include "source.h"
#include <ctype.h>
#include "tui.h"
@@ -546,12 +547,13 @@ _extractDisplayStartAddr (void)
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;
diff --git a/gdb/tui/tuiSource.c b/gdb/tui/tuiSource.c
index 0d59bf06b05..f682786ce9e 100644
--- a/gdb/tui/tuiSource.c
+++ b/gdb/tui/tuiSource.c
@@ -337,11 +337,12 @@ tuiVerticalSourceScroll (TuiScrollDirection scrollDirection,
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)
{
diff --git a/gdb/tui/tuiSourceWin.c b/gdb/tui/tuiSourceWin.c
index 696b8b24719..c0c786836a3 100644
--- a/gdb/tui/tuiSourceWin.c
+++ b/gdb/tui/tuiSourceWin.c
@@ -45,6 +45,7 @@
#include "frame.h"
#include "breakpoint.h"
#include "value.h"
+#include "source.h"
#include "tui.h"
#include "tuiData.h"
@@ -125,9 +126,12 @@ tuiUpdateSourceWindowAsIs (TuiWinInfoPtr winInfo, struct symtab *s,
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
@@ -348,11 +352,12 @@ tuiHorizontalSourceScroll (TuiWinInfoPtr winInfo,
{
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;
diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c
index fe3b8e054be..38283b59da1 100644
--- a/gdb/tui/tuiWin.c
+++ b/gdb/tui/tuiWin.c
@@ -53,6 +53,7 @@
#include "frame.h"
#include "cli/cli-cmds.h"
#include "top.h"
+#include "source.h"
#include "tui.h"
#include "tuiData.h"
@@ -1364,6 +1365,8 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo)
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 =
@@ -1373,19 +1376,20 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo)
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);
}