From b5582ab72f025c54d4a6e8f459f78a8c92e6df29 Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Wed, 5 Aug 2020 18:29:33 -0700 Subject: [PATCH] Don't output null pathname in core_target::build_file_mappings warning While looking into the regressions reported by Luis Machado, I noticed that null pathnames were being output in the warnings. E.g. warning: Can't open file (null) during file-backed mapping note processing I've changed the warning to output the pathname found in the note, like this: warning: Can't open file /var/lib/docker/aufs/diff/d07c...e21/lib/x86_64-linux-gnu/libc-2.27.so during file-backed mapping note processing (I've shortened one of the path elements above.) gdb/ChangeLog: * corelow.c (core_target::build_file_mappings): Don't output null pathname in warning. --- gdb/ChangeLog | 5 +++++ gdb/corelow.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1d510321d3b..01f3c9e7519 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-08-05 Kevin Buettner + + * corelow.c (core_target::build_file_mappings): Don't output + null pathname in warning. + 2020-08-05 Simon Marchi * gdb.dwarf2/clztest.exp, gdb.dwarf2/dw2-common-block.exp, diff --git a/gdb/corelow.c b/gdb/corelow.c index 367f54cd536..b6ee219f57c 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -218,7 +218,7 @@ core_target::build_file_mappings () { warning (_("Can't open file %s during file-backed mapping " "note processing"), - expanded_fname.get ()); + filename); return; } -- 2.30.2