Fix procfs.c compilation
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Thu, 31 Mar 2022 08:34:52 +0000 (10:34 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Thu, 31 Mar 2022 08:34:52 +0000 (10:34 +0200)
procfs.c doesn't compile on Solaris:

/vol/src/gnu/gdb/hg/master/local/gdb/procfs.c: In member function ‘virtual bool procfs_target::info_proc(const char*, info_proc_what)’:
/vol/src/gnu/gdb/hg/master/local/gdb/procfs.c:3302:3: error: ‘gdb_argv’ was not declared in this scope
 3302 |   gdb_argv built_argv (args);
      |   ^~~~~~~~
/vol/src/gnu/gdb/hg/master/local/gdb/procfs.c:3303:20: error: ‘built_argv’ was not declared in this scope; did you mean ‘buildargv’?
 3303 |   for (char *arg : built_argv)
      |                    ^~~~~~~~~~
      |                    buildargv

Fixed by including  "gdbsupport/buildargv.h".

Tested on amd64-pc-solaris2.11, sparcv9-sun-solaris2.11.

gdb/procfs.c

index 584833a284ef99099918976433a780e8bceb74ea..f6ca1345a21c7e5eed67d609bf6f0645460e2d51 100644 (file)
@@ -45,6 +45,7 @@
 #include "observable.h"
 #include "gdbsupport/scoped_fd.h"
 #include "gdbsupport/pathstuff.h"
+#include "gdbsupport/buildargv.h"
 
 /* This module provides the interface between GDB and the
    /proc file system, which is used on many versions of Unix