diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2001-07-19 21:56:39 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2001-07-19 21:56:39 +0000 |
commit | 3024f13a83deadef212a3d8606d3784033615ea2 (patch) | |
tree | f2d4c22acab68a505faaa592ca786f4b3d20ba41 /gdb/tui | |
parent | 0150732f4e40a1ce339f7773c34cb4a6f078839b (diff) | |
download | gdb-3024f13a83deadef212a3d8606d3784033615ea2.zip gdb-3024f13a83deadef212a3d8606d3784033615ea2.tar.gz gdb-3024f13a83deadef212a3d8606d3784033615ea2.tar.bz2 |
* tuiDisassem.c (tuiVerticalDisassemScroll): Use CORE_ADDR.
(tuiVerticalDisassemScroll): Likewise.
(tuiShowDisassemAndUpdateSource): Check for null symtab to
prevent a crash.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/tui/tuiDisassem.c | 23 |
2 files changed, 20 insertions, 10 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 376f8b7..8277bbe 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,10 @@ +2001-07-19 Stephane Carrez <Stephane.Carrez@worldnet.fr> + + * tuiDisassem.c (tuiVerticalDisassemScroll): Use CORE_ADDR. + (tuiVerticalDisassemScroll): Likewise. + (tuiShowDisassemAndUpdateSource): Check for null symtab to + prevent a crash. + 2001-07-18 Stephane Carrez <Stephane.Carrez@worldnet.fr> * tuiIO.c (_tuiHandleResizeDuringIO): Call tuiRefreshAll. diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c index e73b40a..4d3b61a 100644 --- a/gdb/tui/tuiDisassem.c +++ b/gdb/tui/tuiDisassem.c @@ -178,9 +178,14 @@ tuiShowDisassemAndUpdateSource (CORE_ADDR startAddr) ** note that it follows what is in the disassembly window and visa-versa */ sal = find_pc_line (startAddr, 0); - current_source_symtab = sal.symtab; - tuiUpdateSourceWindow (srcWin, sal.symtab, (Opaque) sal.line, TRUE); - tuiUpdateLocatorFilename (sal.symtab->filename); + tuiUpdateSourceWindow (srcWin, sal.symtab, sal.line, TRUE); + if (sal.symtab) + { + current_source_symtab = sal.symtab; + tuiUpdateLocatorFilename (sal.symtab->filename); + } + else + tuiUpdateLocatorFilename ("?"); } return; @@ -248,7 +253,7 @@ tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection, { if (disassemWin->generic.content != (OpaquePtr) NULL) { - Opaque pc, lowAddr; + CORE_ADDR pc, lowAddr; TuiWinContent content; struct symtab *s; @@ -259,15 +264,13 @@ tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection, s = current_source_symtab; pc = content[0]->whichElement.source.lineOrAddr.addr; - if (find_pc_partial_function ((CORE_ADDR) pc, - (char **) NULL, - (CORE_ADDR *) & lowAddr, - (CORE_ADDR) NULL) == 0) - error ("No function contains prgram counter for selected frame.\n"); + if (find_pc_partial_function (pc, (char **) NULL, &lowAddr, + (CORE_ADDR) 0) == 0) + error ("No function contains program counter for selected frame.\n"); else { register int line = 0; - register Opaque newLow; + register CORE_ADDR newLow; bfd_byte buffer[4]; newLow = pc; |