diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2001-07-20 23:06:48 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2001-07-20 23:06:48 +0000 |
commit | a4b99e53449d48e54a827a7bd4af282caaed0150 (patch) | |
tree | c8a98789c28683a48872862fc923552a27aff423 /gdb/tui/tuiSource.c | |
parent | 19eb139b7243abc4b725c1836ac3810b274e2637 (diff) | |
download | gdb-a4b99e53449d48e54a827a7bd4af282caaed0150.zip gdb-a4b99e53449d48e54a827a7bd4af282caaed0150.tar.gz gdb-a4b99e53449d48e54a827a7bd4af282caaed0150.tar.bz2 |
* tuiWin.c (_parseScrollingArgs): Fix uninitialized variable.
(_makeVisibleWithNewHeight): Use TuiLineOrAddress type.
* tuiStack.c (tuiShowFrameInfo): Use TuiLineOrAddress type.
(tui_vUpdateLocatorFilename): Remove.
* tuiStack.h: Update prototypes.
* tuiSourceWin.c (tuiAddrIsDisplayed): New function.
(tuiLineIsDisplayed): Split for address and line.
(tuiUpdateSourceWindow): Use TuiLineOrAddress type.
(tuiUpdateSourceWindowAsIs): Likewise.
(tuiUpdateSourceWindowsWithAddr): Likewise.
(tuiUpdateSourceWindowsWithLine): Likewise.
(tuiHorizontalSourceScroll): Likewise.
(tuiSetIsExecPointAt): Likewise.
(tuiUpdateOnEnd): Likewise.
* tuiSourceWin.h: Update prototypes.
* tuiSource.c (tuiVerticalSourceScroll): Use TuiLineOrAddress type.
(tuiShowSource): Likewise.
(tuiVerticalSourceScroll): Likewise.
* tuiSource.h (tuiShowSource): Update prototype.
* tuiDisassem.c (tuiSetDisassemContent): Use CORE_ADDR for address.
(tuiShowDisassem): Use TuiLineOrAddress type.
(tuiShowDisassemAndUpdateSource): Likewise.
(tuiVerticalDisassemScroll): Likewise.
(tuiShowDisassemAsIs): Remove.
* tuiDisassem.h (tuiSetDisassemContent): Update prototype.
* tuiData.c (initWinInfo): Use CORE_ADDR for address.
(clearWinDetail): Likewise.
(displayableWinContentOf): Fix address conversion.
(tuiNextWin): Fix crash when the window is not yet created.
(partialWinByName): Likewise.
Diffstat (limited to 'gdb/tui/tuiSource.c')
-rw-r--r-- | gdb/tui/tuiSource.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gdb/tui/tuiSource.c b/gdb/tui/tuiSource.c index 2f52fc5..6c1a8fb 100644 --- a/gdb/tui/tuiSource.c +++ b/gdb/tui/tuiSource.c @@ -25,6 +25,7 @@ #include "frame.h" #include "breakpoint.h" #include "source.h" +#include "symtab.h" #include "tui.h" #include "tuiData.h" @@ -332,10 +333,10 @@ tuiSetSourceContentNil (TuiWinInfoPtr winInfo, char *warning_string) ** initializes the horizontal scroll to 0. */ void -tuiShowSource (struct symtab *s, Opaque line, int noerror) +tuiShowSource (struct symtab *s, TuiLineOrAddress line, int noerror) { srcWin->detail.sourceInfo.horizontalOffset = 0; - m_tuiShowSourceAsIs (s, line, noerror); + tuiUpdateSourceWindowAsIs(srcWin, s, line, noerror); return; } /* tuiShowSource */ @@ -359,12 +360,12 @@ tuiSourceIsDisplayed (char *fname) ** Scroll the source forward or backward vertically */ void -tuiVerticalSourceScroll (TuiScrollDirection scrollDirection, int numToScroll) +tuiVerticalSourceScroll (TuiScrollDirection scrollDirection, + int numToScroll) { if (srcWin->generic.content != (OpaquePtr) NULL) { - int line; - Opaque addr; + TuiLineOrAddress l; struct symtab *s; TuiWinContent content = (TuiWinContent) srcWin->generic.content; @@ -375,21 +376,22 @@ tuiVerticalSourceScroll (TuiScrollDirection scrollDirection, int numToScroll) if (scrollDirection == FORWARD_SCROLL) { - line = content[0]->whichElement.source.lineOrAddr.lineNo + + l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo + numToScroll; - if (line > s->nlines) + if (l.lineNo > s->nlines) /*line = s->nlines - winInfo->generic.contentSize + 1; */ /*elz: fix for dts 23398 */ - line = content[0]->whichElement.source.lineOrAddr.lineNo; + l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo; } else { - line = content[0]->whichElement.source.lineOrAddr.lineNo - + l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo - numToScroll; - if (line <= 0) - line = 1; + if (l.lineNo <= 0) + l.lineNo = 1; } - tuiUpdateSourceWindowAsIs (srcWin, s, (Opaque) line, FALSE); + if (identify_source_line (s, l.lineNo, 0, -1) == 1) + tuiUpdateSourceWindowAsIs (srcWin, s, l, FALSE); } return; |