aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-08 09:45:27 -0700
committerTom Tromey <tom@tromey.com>2022-01-08 09:45:27 -0700
commit249f1cf8e669cc2fa7832601e0bbf460c5bfb97d (patch)
tree64b2171a101def45fcc1af7b5d00c4f5e766eb25
parent24fe764c8a14bd519826e7e9af01edff59ab6be3 (diff)
downloadgdb-249f1cf8e669cc2fa7832601e0bbf460c5bfb97d.zip
gdb-249f1cf8e669cc2fa7832601e0bbf460c5bfb97d.tar.gz
gdb-249f1cf8e669cc2fa7832601e0bbf460c5bfb97d.tar.bz2
Add explicit check for nullptr to target_announce_attach
Lancelot pointed out that target_announce_attach was missing an explicit check against nullptr. This patch adds it.
-rw-r--r--gdb/target.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/target.c b/gdb/target.c
index c25ce69..950f2f0 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3648,7 +3648,7 @@ target_announce_attach (int from_tty, int pid)
const char *exec_file = get_exec_file (0);
- if (exec_file)
+ if (exec_file != nullptr)
printf_unfiltered ("Attaching to program: %s, %s\n", exec_file,
target_pid_to_str (ptid_t (pid)).c_str ());
else