diff options
author | Fred Fish <fnf@specifix.com> | 1992-08-12 18:17:48 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-08-12 18:17:48 +0000 |
commit | 7b5d965008fee110409d054a787a7d825bc44436 (patch) | |
tree | 834ee0f20477b37bf8885c14ebea7cb94436aa40 /gdb/buildsym.c | |
parent | a00721fc4a008ab916883559397d635e28f1fd1a (diff) | |
download | gdb-7b5d965008fee110409d054a787a7d825bc44436.zip gdb-7b5d965008fee110409d054a787a7d825bc44436.tar.gz gdb-7b5d965008fee110409d054a787a7d825bc44436.tar.bz2 |
* buildsym.c (end_symtab): Document that end_symtab can return
NULL under non-error conditions.
* dwarfread.c (read_file_scope): Guard against dereferencing NULL
returned from end_symtab for empty compilation units.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r-- | gdb/buildsym.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c index e0f69cd..566a66f 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -549,7 +549,14 @@ start_symtab (name, dirname, start_addr) (creating struct block's for them), then make the struct symtab for that file and put it in the list of all such. - END_ADDR is the address of the end of the file's text. */ + END_ADDR is the address of the end of the file's text. + + Note that it is possible for end_symtab() to return NULL. In particular, + for the DWARF case at least, it will return NULL when it finds a + compilation unit that has exactly one DIE, a TAG_compile_unit DIE. This + can happen when we link in an object file that was compiled from an empty + source file. Returning NULL is probably not the correct thing to do, + because then gdb will never know about this empty file (FIXME). */ struct symtab * end_symtab (end_addr, sort_pending, sort_linevec, objfile) |