Restore procfs.c compilation
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 29 Mar 2021 11:26:35 +0000 (13:26 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 29 Mar 2021 11:26:35 +0000 (13:26 +0200)
Since c8fbd44a018a9923f906bfd2be5489caa87b602a (gdb: remove
target_is_pushed free function), procfs.c compilation is broken, which
went unnoticed for lack of functioning buildbots:

/vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In member function 'virtual void procfs_target::attach(const char*, int)':
/vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:1772:8: error: 'inf' was not declared in this scope; did you mean 'info'?
 1772 |   if (!inf->target_is_pushed (this))
      |        ^~~
      |        info
/vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In member function 'virtual void procfs_target::create_inferior(const char*, const string&, char**, int)':
/vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:2865:8: error: 'inf' was not declared in this scope; did you mean 'info'?
 2865 |   if (!inf->target_is_pushed (this))
      |        ^~~
      |        info

Fixed by defining inf.  Tested on amd64-pc-solaris2.11 and
sparcv9-sun-solaris2.11.

2021-03-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gdb:
* procfs.c (procfs_target::attach): Define inf.
Use it.
(procfs_target::create_inferior): Likewise.

gdb/ChangeLog
gdb/procfs.c

index 70e8ad7ebeebe1ac43e7e8479237b41c6fb7bf23..3e353b399a29f8441ce5f1c4b564cf9777776860 100644 (file)
@@ -1,3 +1,10 @@
+2021-03-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       gdb:
+       * procfs.c (procfs_target::attach): Define inf.
+       Use it.
+       (procfs_target::create_inferior): Likewise.
+
 2021-03-28  Tom Tromey  <tom@tromey.com>
 
        * elfread.c (can_lazily_read_symbols): Move to dwarf2/read.c.
index eb703cf43b70d1b621dedb21ea21149199259648..23c0aa22a7a60727cfb3973b064cb76b11c565c8 100644 (file)
@@ -1768,10 +1768,11 @@ procfs_target::attach (const char *args, int from_tty)
     error (_("Attaching GDB to itself is not a good idea..."));
 
   /* Push the target if needed, ensure it gets un-pushed it if attach fails.  */
+  inferior *inf = current_inferior ();
   target_unpush_up unpusher;
   if (!inf->target_is_pushed (this))
     {
-      current_inferior ()->push_target (this);
+      inf->push_target (this);
       unpusher.reset (this);
     }
 
@@ -2862,8 +2863,9 @@ procfs_target::create_inferior (const char *exec_file,
       shell_file = tryname;
     }
 
+  inferior *inf = current_inferior ();
   if (!inf->target_is_pushed (this))
-    current_inferior ()->push_target (this);
+    inf->push_target (this);
 
   pid = fork_inferior (exec_file, allargs, env, procfs_set_exec_trap,
                       NULL, procfs_pre_trace, shell_file, NULL);