From 84b1e7c7ee7e32bf88270c46f0ee1cbf002a09c3 Mon Sep 17 00:00:00 2001 From: Stephane Carrez Date: Tue, 17 Jul 2001 22:22:40 +0000 Subject: [PATCH] * tuiWin.c: Add missing includes. (_makeVisibleWithNewHeight): Fix call to find_line_pc. * tuiLayout.c: Add missing includes. (_initAndMakeWin): Don't put curses in echo mode. (_extractDisplayStartAddr): Fix calls to find_line_pc. (_tuiLayout_command): Missing ',' in warning call. * tuiSourceWin.c (tuiUpdateSourceWindowsWithLine): Fix calls to find_line_pc. (tuiSetHasBreakAt): Check for null source file. --- gdb/tui/ChangeLog | 12 ++++++++++++ gdb/tui/tuiLayout.c | 17 +++++++++++------ gdb/tui/tuiSourceWin.c | 11 +++++++++-- gdb/tui/tuiWin.c | 11 ++++++++++- 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 30163968fd6..bfa8370a42a 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,15 @@ +2001-07-17 Stephane Carrez + + * tuiWin.c: Add missing includes. + (_makeVisibleWithNewHeight): Fix call to find_line_pc. + * tuiLayout.c: Add missing includes. + (_initAndMakeWin): Don't put curses in echo mode. + (_extractDisplayStartAddr): Fix calls to find_line_pc. + (_tuiLayout_command): Missing ',' in warning call. + * tuiSourceWin.c (tuiUpdateSourceWindowsWithLine): Fix calls to + find_line_pc. + (tuiSetHasBreakAt): Check for null source file. + 2001-07-17 Stephane Carrez * tuiWin.c (_tuiSetFocus): Replace subsetCompare with subset_compare. diff --git a/gdb/tui/tuiLayout.c b/gdb/tui/tuiLayout.c index 9d30bdec973..5db7f083246 100644 --- a/gdb/tui/tuiLayout.c +++ b/gdb/tui/tuiLayout.c @@ -23,12 +23,16 @@ #include "command.h" #include "symtab.h" #include "frame.h" +#include #include "tui.h" #include "tuiData.h" +#include "tuiDataWin.h" #include "tuiGeneralWin.h" #include "tuiStack.h" #include "tuiRegs.h" +#include "tuiWin.h" +#include "tuiSourceWin.h" #include "tuiDisassem.h" /******************************* @@ -539,7 +543,7 @@ _tuiSetLayoutTo (char *layoutName) dpyType = TUI_GENERAL_REGS; else if (subset_compare (bufPtr, TUI_SPECIAL_REGS_NAME)) dpyType = TUI_SPECIAL_REGS; - else + else if (dataWin) { if (dataWin->detail.dataDisplayInfo.regsDisplayType != TUI_UNDEFINED_REGS) @@ -582,14 +586,16 @@ _extractDisplayStartAddr (void) { TuiLayoutType curLayout = currentLayout (); Opaque addr; + CORE_ADDR pc; switch (curLayout) { case SRC_COMMAND: case SRC_DATA_COMMAND: - addr = (Opaque) find_line_pc ( - current_source_symtab, - srcWin->detail.sourceInfo.startLineOrAddr.lineNo); + find_line_pc (current_source_symtab, + srcWin->detail.sourceInfo.startLineOrAddr.lineNo, + &pc); + addr =(Opaque) pc; break; case DISASSEM_COMMAND: case SRC_DISASSEM_COMMAND: @@ -672,7 +678,7 @@ _tuiLayout_command (char *arg, int fromTTY) { if ((TuiStatus) tuiDo ( (TuiOpaqueFuncPtr) tui_vSetLayoutTo, arg) != TUI_SUCCESS) - warning ("Invalid layout specified.\n%s" LAYOUT_USAGE); + warning ("Invalid layout specified.\n%s", LAYOUT_USAGE); return; } /* _tuiLayout_command */ @@ -1061,7 +1067,6 @@ _initAndMakeWin (Opaque * winInfoPtr, TuiWinType winType, makeWindow (generic, boxIt); if (winType == LOCATOR_WIN) tuiClearLocatorDisplay (); - echo (); } *winInfoPtr = opaqueWinInfo; diff --git a/gdb/tui/tuiSourceWin.c b/gdb/tui/tuiSourceWin.c index 60c55a6fd5e..4bfc04e2024 100644 --- a/gdb/tui/tuiSourceWin.c +++ b/gdb/tui/tuiSourceWin.c @@ -241,16 +241,22 @@ tui_vUpdateSourceWindowsWithAddr (va_list args) void tuiUpdateSourceWindowsWithLine (struct symtab *s, int line) { + CORE_ADDR pc; + switch (currentLayout ()) { case DISASSEM_COMMAND: case DISASSEM_DATA_COMMAND: - tuiUpdateSourceWindowsWithAddr ((Opaque) find_line_pc (s, line)); + find_line_pc (s, line, &pc); + tuiUpdateSourceWindowsWithAddr ((Opaque) pc); break; default: tuiShowSource (s, (Opaque) line, FALSE); if (currentLayout () == SRC_DISASSEM_COMMAND) - tuiShowDisassem ((Opaque) find_line_pc (s, line)); + { + find_line_pc (s, line, &pc); + tuiShowDisassem ((Opaque) pc); + } break; } @@ -514,6 +520,7 @@ tuiSetHasBreakAt (struct breakpoint *bp, TuiWinInfoPtr winInfo, int hasBreak) fileNameDisplayed = current_source_symtab->filename; gotIt = (fileNameDisplayed != (char *) NULL && + bp->source_file != NULL && (strcmp (bp->source_file, fileNameDisplayed) == 0) && content[i]->whichElement.source.lineOrAddr.lineNo == bp->line_number); diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c index 3843eb69201..4c3acd2e472 100644 --- a/gdb/tui/tuiWin.c +++ b/gdb/tui/tuiWin.c @@ -25,6 +25,7 @@ Author: Susan B. Macchia */ #include +#include #include "defs.h" #include "command.h" #include "symtab.h" @@ -35,6 +36,9 @@ #include "tuiData.h" #include "tuiGeneralWin.h" #include "tuiStack.h" +#include "tuiRegs.h" +#include "tuiDisassem.h" +#include "tuiSource.h" #include "tuiSourceWin.h" #include "tuiDataWin.h" @@ -1221,7 +1225,12 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo) if (winInfo->generic.type == SRC_WIN) line = (Opaque) current_source_line; else - line = (Opaque) find_line_pc (s, current_source_line); + { + CORE_ADDR pc; + + find_line_pc (s, current_source_line, &pc); + line = (Opaque) pc; + } tuiUpdateSourceWindow (winInfo, s, line, TRUE); } if (m_hasLocator (winInfo)) -- 2.30.2