binutils-gdb/gdb/cli
Guinevere Larsen 4fe1a40c7c gdb: fix "list ." related crash
When a user attempts to use the "list ." command with an inferior that
doesn't have debug symbols, GDB would crash. This was reported as PR
gdb/31256.

The crash would happen when attempting to get the current symtab_and_line
for the stop location, because the symtab would return a null pointer
and we'd attempt to dereference it to print the line.

This commit fixes that by checking for an empty symtab and erroring out
of the function if it happens.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31256
Approved-By: Tom Tromey <tom@tromey.com>
2024-01-23 17:00:40 +01:00
..
cli-cmds.c gdb: fix "list ." related crash 2024-01-23 17:00:40 +01:00
cli-cmds.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cli-decode.c [gdb] Fix more typos 2023-06-05 12:53:15 +02:00
cli-decode.h gdb: remove unused parameters in print_doc_of_command, apropos_cmd 2023-04-02 14:11:33 -04:00
cli-dump.c Remove deprecated_lval_hack 2023-02-13 15:22:20 -07:00
cli-interp.c Remove explanatory comments from includes 2023-09-20 11:45:16 -06:00
cli-interp.h gdb: add interp::on_user_selected_context_changed method 2023-05-30 15:07:26 -04:00
cli-logging.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cli-option.c GDB: Allow arbitrary keywords in integer set commands 2023-01-19 21:15:56 +00:00
cli-option.h GDB: Allow arbitrary keywords in integer set commands 2023-01-19 21:15:56 +00:00
cli-script.c gdb: move struct ui and related things to ui.{c,h} 2023-05-01 15:40:54 -04:00
cli-script.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cli-setshow.c Use std::string in do_set_command 2023-06-20 07:52:28 -06:00
cli-setshow.h GDB: Allow arbitrary keywords in integer set commands 2023-01-19 21:15:56 +00:00
cli-style.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cli-style.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cli-utils.c Turn value_type into method 2023-02-13 15:21:06 -07:00
cli-utils.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00