/* ** clearSourceWindowsDetail() ** Clear the pertinant detail in the source windows. */ void clearSourceWindowsDetail (void) { int i; for (i = 0; i < (sourceWindows ())->count; i++) clearWinDetail ((TuiWinInfoPtr) (sourceWindows ())->list[i]); return; } /* currentSourceWindows */
/* ** freeAllSourceWinsContent(). */ void freeAllSourceWinsContent (void) { int i; for (i = 0; i < (sourceWindows ())->count; i++) { TuiWinInfoPtr winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i]; if (m_winPtrNotNull (winInfo)) { freeWinContent (&(winInfo->generic)); freeWinContent (winInfo->detail.sourceInfo.executionInfo); } } return; } /* freeAllSourceWinsContent */
/* ** tuiShowFrameInfo(). ** Function to print the frame inforrmation for the TUI. */ void tuiShowFrameInfo (struct frame_info *fi) { TuiWinInfoPtr winInfo; register int i; if (fi) { register int startLine, i; register struct symtab *s; CORE_ADDR low; TuiGenWinInfoPtr locator = locatorWinInfoPtr (); int sourceAlreadyDisplayed; s = find_pc_symtab (fi->pc); if (s == 0) return; startLine = 0; sourceAlreadyDisplayed = tuiSourceIsDisplayed (s->filename); tuiUpdateLocatorDisplay (fi); for (i = 0; i < (sourceWindows ())->count; i++) { TuiWhichElement *item; winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i]; item = &((TuiWinElementPtr) locator->content[0])->whichElement; if (winInfo == srcWin) { startLine = (item->locator.lineNo - (winInfo->generic.viewportHeight / 2)) + 1; if (startLine <= 0) startLine = 1; } else { if (find_pc_partial_function (fi->pc, (char **) NULL, &low, (CORE_ADDR) NULL) == 0) error ("No function contains program counter for selected frame.\n"); else low = tuiGetLowDisassemblyAddress (low, fi->pc); } if (winInfo == srcWin) { TuiLineOrAddress l; l.lineNo = startLine; if (!(sourceAlreadyDisplayed && tuiLineIsDisplayed (item->locator.lineNo, winInfo, TRUE))) tuiUpdateSourceWindow (winInfo, s, l, TRUE); else { l.lineNo = item->locator.lineNo; tuiSetIsExecPointAt (l, winInfo); } } else { if (winInfo == disassemWin) { TuiLineOrAddress a; a.addr = low; if (!tuiAddrIsDisplayed (item->locator.addr, winInfo, TRUE)) tuiUpdateSourceWindow (winInfo, s, a, TRUE); else { a.addr = item->locator.addr; tuiSetIsExecPointAt (a, winInfo); } } } tuiUpdateExecInfo (winInfo); } } else { tuiUpdateLocatorDisplay (fi); for (i = 0; i < (sourceWindows ())->count; i++) { winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i]; tuiClearSourceContent (winInfo, EMPTY_SOURCE_PROMPT); tuiUpdateExecInfo (winInfo); } } return; } /* tuiShowFrameInfo */