diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2002-08-25 13:13:20 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2002-08-25 13:13:20 +0000 |
commit | 2e17b763858bedbceca90170874358c0769d2581 (patch) | |
tree | d1ad18efd9123cdd8c1b314e32fff95c424210b1 /gdb/tui | |
parent | bc6b7f04caef65ba22b9afb4110b2515deb9ba32 (diff) | |
download | gdb-2e17b763858bedbceca90170874358c0769d2581.zip gdb-2e17b763858bedbceca90170874358c0769d2581.tar.gz gdb-2e17b763858bedbceca90170874358c0769d2581.tar.bz2 |
* tuiSourceWin.c (tuiDisplayMainFunction): Update to use
tuiUpdateLocatorFilename.
* tuiStack.c (tuiSetLocatorInfo): Make it static.
(tuiSetLocatorContent): Likewise.
(tuiUpdateLocatorInfoFromFrame): Likewise.
(tuiSwitchFilename): Remove.
(tui_set_locator_filename): New function
(tui_set_locator_info): Rename from tuiSetLocatorInfo to GNU-ify;
use tui_set_locator_filename to record the filename.
(tuiUpdateLocatorFilename): Likewise.
(tuiUpdateLocatorInfoFromFrame): Update.
(tuiSetLocatorContent): Likewise.
* tuiStack.h (tuiClearLocatorContent): Don't declare.
(tuiSetLocatorInfo, tuiSetLocatorContent): Likewise.
(tuiUpdateLocatorInfoFromFrame, tuiSwitchFilename): Likewise.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/ChangeLog | 18 | ||||
-rw-r--r-- | gdb/tui/tuiSourceWin.c | 9 | ||||
-rw-r--r-- | gdb/tui/tuiStack.c | 118 | ||||
-rw-r--r-- | gdb/tui/tuiStack.h | 8 |
4 files changed, 73 insertions, 80 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index ef71170..d7148ac 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,5 +1,23 @@ 2002-08-25 Stephane Carrez <stcarrez@nerim.fr> + * tuiSourceWin.c (tuiDisplayMainFunction): Update to use + tuiUpdateLocatorFilename. + * tuiStack.c (tuiSetLocatorInfo): Make it static. + (tuiSetLocatorContent): Likewise. + (tuiUpdateLocatorInfoFromFrame): Likewise. + (tuiSwitchFilename): Remove. + (tui_set_locator_filename): New function + (tui_set_locator_info): Rename from tuiSetLocatorInfo to GNU-ify; + use tui_set_locator_filename to record the filename. + (tuiUpdateLocatorFilename): Likewise. + (tuiUpdateLocatorInfoFromFrame): Update. + (tuiSetLocatorContent): Likewise. + * tuiStack.h (tuiClearLocatorContent): Don't declare. + (tuiSetLocatorInfo, tuiSetLocatorContent): Likewise. + (tuiUpdateLocatorInfoFromFrame, tuiSwitchFilename): Likewise. + +2002-08-25 Stephane Carrez <stcarrez@nerim.fr> + * tuiSourceWin.c (tuiSetHasBreakAt): Use filename for breakpoint comparison; cleanup. * tuiSource.c (tuiSetSourceContent): Set window title and filename. diff --git a/gdb/tui/tuiSourceWin.c b/gdb/tui/tuiSourceWin.c index 59e5f3b..73090c7 100644 --- a/gdb/tui/tuiSourceWin.c +++ b/gdb/tui/tuiSourceWin.c @@ -86,12 +86,13 @@ tuiDisplayMainFunction (void) tuiUpdateSourceWindowsWithAddr (addr); sal = find_pc_line (addr, 0); - tuiSwitchFilename (sal.symtab->filename); + if (sal.symtab) + tuiUpdateLocatorFilename (sal.symtab->filename); + else + tuiUpdateLocatorFilename ("??"); } } - - return; -} /* tuiDisplayMainFunction */ +} diff --git a/gdb/tui/tuiStack.c b/gdb/tui/tuiStack.c index e2c8a27..24ccf15 100644 --- a/gdb/tui/tuiStack.c +++ b/gdb/tui/tuiStack.c @@ -60,8 +60,18 @@ Returns a pointer to a static area holding the result. */ static char* tui_get_function_from_frame (struct frame_info *fi); +/* Set the filename portion of the locator. */ +static void tui_set_locator_filename (const char *filename); + +/* Update the locator, with the provided arguments. */ +static void tui_set_locator_info (const char *filename, const char *procname, + int lineno, CORE_ADDR addr, + TuiLocatorElementPtr element); + static void tui_update_command (char *, int); +/* Function to set the content of the locator. */ +static void tuiSetLocatorContent (struct frame_info *frameInfo); /* Get a printable name for the function at the address. The symbol name is demangled if demangling is turned on. @@ -126,72 +136,47 @@ tuiShowLocatorContent (void) return; } /* tuiShowLocatorContent */ +/* Set the filename portion of the locator. */ +static void +tui_set_locator_filename (const char *filename) +{ + TuiGenWinInfoPtr locator = locatorWinInfoPtr (); + TuiLocatorElementPtr element; + + if (locator->content[0] == (Opaque) NULL) + tuiSetLocatorContent ((struct frame_info *) NULL); + + element = &((TuiWinElementPtr) locator->content[0])->whichElement.locator; + element->fileName[0] = 0; + strcat_to_buf (element->fileName, MAX_LOCATOR_ELEMENT_LEN, filename); +} /* Update the locator, with the provided arguments. */ -void -tuiSetLocatorInfo (char *fname, char *procname, int lineNo, - CORE_ADDR addr, TuiLocatorElementPtr element) +static void +tui_set_locator_info (const char *filename, const char *procname, int lineno, + CORE_ADDR addr, TuiLocatorElementPtr element) { - element->fileName[0] = (char) 0; element->procName[0] = (char) 0; - strcat_to_buf (element->fileName, MAX_LOCATOR_ELEMENT_LEN, fname); strcat_to_buf (element->procName, MAX_LOCATOR_ELEMENT_LEN, procname); - element->lineNo = lineNo; + element->lineNo = lineno; element->addr = addr; + tui_set_locator_filename (filename); } -/* - ** tuiUpdateLocatorFilename(). - ** Update only the filename portion of the locator. - */ -void -tuiUpdateLocatorFilename (const char *fileName) -{ - TuiGenWinInfoPtr locator = locatorWinInfoPtr (); - - if (locator->content[0] == (Opaque) NULL) - tuiSetLocatorContent ((struct frame_info *) NULL); - ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName[0] = (char) 0; - strcat_to_buf (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName, - MAX_LOCATOR_ELEMENT_LEN, - fileName); - - tuiShowLocatorContent (); - - return; -} /* tuiUpdateLocatorFilename */ - -/* - ** tuiSwitchFilename(). - ** Update the filename portion of the locator. Clear the other info in locator. - ** (elz) - */ +/* Update only the filename portion of the locator. */ void -tuiSwitchFilename (char *fileName) +tuiUpdateLocatorFilename (const char *filename) { - TuiGenWinInfoPtr locator = locatorWinInfoPtr (); - - if (locator->content[0] == (Opaque) NULL) - tuiSetLocatorContent ((struct frame_info *) NULL); - ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName[0] = (char) 0; - - tuiSetLocatorInfo (fileName, - (char *) NULL, - 0, - (CORE_ADDR) 0, - &((TuiWinElementPtr) locator->content[0])->whichElement.locator); - + tui_set_locator_filename (filename); tuiShowLocatorContent (); - - return; -} /* tuiSwitchFilename */ +} /* ** tuiUpdateLocatorInfoFromFrame(). ** Function to update the locator, with the information extracted from frameInfo */ -void +static void tuiUpdateLocatorInfoFromFrame (struct frame_info *frameInfo, TuiLocatorElementPtr element) { @@ -203,27 +188,24 @@ tuiUpdateLocatorInfoFromFrame (struct frame_info *frameInfo, !frameInfo->next->signal_handler_caller && !frame_in_dummy (frameInfo->next))); if (symtabAndLine.symtab && symtabAndLine.symtab->filename) - tuiSetLocatorInfo (symtabAndLine.symtab->filename, - tui_get_function_from_frame (frameInfo), - symtabAndLine.line, - frameInfo->pc, - element); + tui_set_locator_info (symtabAndLine.symtab->filename, + tui_get_function_from_frame (frameInfo), + symtabAndLine.line, + frameInfo->pc, + element); else - tuiSetLocatorInfo ((char *) NULL, - tui_get_function_from_frame (frameInfo), - 0, - frameInfo->pc, - element); + tui_set_locator_info ((char *) NULL, + tui_get_function_from_frame (frameInfo), + 0, + frameInfo->pc, + element); return; } /* tuiUpdateLocatorInfoFromFrame */ -/* - ** tuiSetLocatorContent(). - ** Function to set the content of the locator - */ -void +/* Function to set the content of the locator. */ +static void tuiSetLocatorContent (struct frame_info *frameInfo) { TuiGenWinInfoPtr locator = locatorWinInfoPtr (); @@ -244,10 +226,10 @@ tuiSetLocatorContent (struct frame_info *frameInfo) tuiUpdateLocatorInfoFromFrame (frameInfo, &((TuiWinElementPtr) locator->content[0])->whichElement.locator); else - tuiSetLocatorInfo ((char *) NULL, - (char *) NULL, - 0, - (CORE_ADDR) 0, + tui_set_locator_info ((char *) NULL, + (char *) NULL, + 0, + (CORE_ADDR) 0, &((TuiWinElementPtr) locator->content[0])->whichElement.locator); return; } /* tuiSetLocatorContent */ diff --git a/gdb/tui/tuiStack.h b/gdb/tui/tuiStack.h index 0ffb68f..14be497 100644 --- a/gdb/tui/tuiStack.h +++ b/gdb/tui/tuiStack.h @@ -25,17 +25,9 @@ ** This header file supports */ -extern void tuiSetLocatorInfo (char *, char *, int, CORE_ADDR, - TuiLocatorElementPtr); extern void tuiUpdateLocatorFilename (const char *); -extern void tuiUpdateLocatorInfoFromFrame - (struct frame_info *, TuiLocatorElementPtr); -extern void tuiSetLocatorContent (struct frame_info *); extern void tuiShowLocatorContent (void); -extern void tuiClearLocatorContent (void); -extern void tuiSwitchFilename (char *); extern void tuiShowFrameInfo (struct frame_info *); - #endif /*_TUI_STACK_H*/ |