[PATCH 3/4] gdb: remove dead code in nto-procfs.c

Simon Marchi simon.marchi@efficios.com
Thu May 30 18:53:55 GMT 2024


From: Simon Marchi <simon.marchi@polymtl.ca>

`get_exec_file()` never returns nullptr, so remove some dead code that
check for a nullptr return.

Change-Id: I9eff2a013d602588aaf4477a22cf45f2bc417c6a
---
 gdb/nto-procfs.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index c3a45796dcc7..9ec214771271 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -1191,14 +1191,6 @@ nto_procfs_target::create_inferior (const char *exec_file,
   argv = xmalloc ((allargs.size () / (unsigned) 2 + 2) *
 		  sizeof (*argv));
   argv[0] = const_cast<char *> (get_exec_file ());
-  if (!argv[0])
-    {
-      if (exec_file)
-	argv[0] = exec_file;
-      else
-	return;
-    }
-
   args = xstrdup (allargs.c_str ());
   breakup_args (args, (exec_file != NULL) ? &argv[1] : &argv[0]);
 
-- 
2.45.1



More information about the Gdb-patches mailing list