aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc/gdb.texinfo
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-09-08 00:05:22 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-09-17 15:53:32 -0400
commit67f3ed6afef86d08ef9989cc251eac585e9ef9cf (patch)
treeb4a93b3ab7485c8f1dbf8b426463f9056502cbf6 /gdb/doc/gdb.texinfo
parent743321899674e03cf572fcfeb6c7705aded7c9a5 (diff)
downloadgdb-67f3ed6afef86d08ef9989cc251eac585e9ef9cf.zip
gdb-67f3ed6afef86d08ef9989cc251eac585e9ef9cf.tar.gz
gdb-67f3ed6afef86d08ef9989cc251eac585e9ef9cf.tar.bz2
gdb: Catch exceptions when accessing source cache
The source_cache::get_line_charpos function can currently throw an exception if the source file is missing, which doesn't match the expected behaviour documented in the functions header file. The documented behaviour is to return false on failure, and this is how the function appears to be used throughout GDB. I spotted this in the 'info source' command, currently for a missing source file you'll see something like this: (gdb) info source Current source file is /path/to/src/file.c Compilation directory is /path/to/build/ /path/to/src/file.c: No such file or directory. (gdb) After this patch we see this: (gdb) info source Current source file is /path/to/src/file.c Compilation directory is /path/to/build/ Source language is c. Producer is COMPILER VERSION AND FLAGS. Compiled with DWARF 2 debugging format. Does not include preprocessor macro info. We don't currently indicate that the source file can't be found, and maybe that would be something worth adding in the future. gdb/ChangeLog: * source-cache.c (source_cache::get_line_charpos): Catch exceptions and return false, this matches the behaviour documented in the header file. gdb/testsuite/ChangeLog: * gdb.base/list-missing-source.exp: New file.
Diffstat (limited to 'gdb/doc/gdb.texinfo')
0 files changed, 0 insertions, 0 deletions