This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Add missing gdb_bfd.h includes


  It seems that "gdb_bfd.h" header is not included in several
c files.
  I noticed that with a compilation failure for native windows:
gcc -g -O2    -I. -I../../puresrc/gdb -I../../puresrc/gdb/common
-I../../puresrc/gdb/config  -DLOCALEDIR="\"/usr/local/s
hare/locale\"" -DHAVE_CONFIG_H -I../../puresrc/gdb/../include/opcode
-I../../puresrc/gdb/../opcodes/.. -I../../puresrc/g
db/../readline/..  -I../bfd -I../../puresrc/gdb/../bfd
-I../../puresrc/gdb/../include -I../libdecnumber -I../../puresrc/
gdb/../libdecnumber   -I../../puresrc/gdb/gnulib/import
-Ibuild-gnulib/import   -DTUI=1  -I/usr/include/python2.6 -I/usr
/include/python2.6 -Wall -Wdeclaration-after-statement -Wpointer-arith
-Wformat-nonliteral -Wno-pointer-sign -Wno-unused
 -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
-Wmissing-prototypes -Wdeclaration-after-statement -W
error -c -o windows-nat.o -MT windows-nat.o -MMD -MP  -MF
.deps/windows-nat.Tpo ../../puresrc/gdb/windows-nat.c
cc1: warnings being treated as errors
../../puresrc/gdb/windows-nat.c: In function 'windows_make_so':
../../puresrc/gdb/windows-nat.c:755:7: error: implicit declaration of
function 'gdb_bfd_open'
../../puresrc/gdb/windows-nat.c:755:12: error: assignment makes pointer from
integer without a cast
../../puresrc/gdb/windows-nat.c:765:4: error: implicit declaration of
function 'gdb_bfd_unref'
Makefile:962: recipe for target `windows-nat.o' failed
make[1]: *** [windows-nat.o] Error 1

Upon investigation I found several missing gdb_bfd.h header,
mainly in native files.

This patch adds the header to any C source that had a match for
grep  gdb_bfd *.c
but no corresponding header inclusion.

   All those file seem to call at least gdb_bfd_unref function,
so I suppose that the inclusion is correct, but 
I would still prefer an approval from Tom, 
as he seemed to have committed all the gdb_bfd header related changes.
  
Is this OK?

As usual, 
 1) I am not  sure about correct wording for ChangeLog
 2) I never really understood the ordering logic (or to
be more precise, if there is an ordering logic) of C headers
in C source files, thus I inserted them more or less randomly...
 
 Tom, if you feel like putting them on the right place,
don't hesitate to commit yourself...


Pierre Muller
GDB pascal language maintainer

2012-09-25  Pierre Muller  <muller@ics.u-strasbg.fr>

        * procfs.c: Add gdb_bfd header.
        * rs6000-nat.c: Likewise.
        * solib-pa64.c: Likewise.
        * spu-linux-nat.c: Likewise.
        * windows-nat.c: Likewise.

Index: src/gdb/procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.160
diff -u -p -r1.160 procfs.c
--- src/gdb/procfs.c    7 Aug 2012 13:26:32 -0000       1.160
+++ src/gdb/procfs.c    25 Sep 2012 08:57:18 -0000
@@ -45,6 +45,7 @@
 #include "gdb_wait.h"
 #include <signal.h>
 #include <ctype.h>
+#include "gdb_bfd.h"
 #include "gdb_string.h"
 #include "gdb_assert.h"
 #include "inflow.h"
Index: src/gdb/rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.116
diff -u -p -r1.116 rs6000-nat.c
--- src/gdb/rs6000-nat.c        22 Aug 2012 16:24:38 -0000      1.116
+++ src/gdb/rs6000-nat.c        25 Sep 2012 08:57:18 -0000
@@ -53,6 +53,7 @@
 #include <a.out.h>
 #include <sys/file.h>
 #include "gdb_stat.h"
+#include "gdb_bfd.h"
 #include <sys/core.h>
 #define __LDINFO_PTRACE32__    /* for __ld_info32 */
 #define __LDINFO_PTRACE64__    /* for __ld_info64 */
Index: src/gdb/solib-pa64.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-pa64.c,v
retrieving revision 1.37
diff -u -p -r1.37 solib-pa64.c
--- src/gdb/solib-pa64.c        22 Aug 2012 16:24:38 -0000      1.37
+++ src/gdb/solib-pa64.c        25 Sep 2012 08:57:18 -0000
@@ -37,6 +37,7 @@
 #include "target.h"
 #include "inferior.h"
 #include "regcache.h"
+#include "gdb_bfd.h"

 #include "hppa-tdep.h"
 #include "solist.h"
Index: src/gdb/spu-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-linux-nat.c,v
retrieving revision 1.35
diff -u -p -r1.35 spu-linux-nat.c
--- src/gdb/spu-linux-nat.c     23 Jul 2012 14:58:44 -0000      1.35
+++ src/gdb/spu-linux-nat.c     25 Sep 2012 08:57:18 -0000
@@ -29,6 +29,7 @@
 #include "symfile.h"
 #include "gdb_wait.h"
 #include "gdbthread.h"
+#include "gdb_bfd.h"

 #include <sys/ptrace.h>
 #include <asm/ptrace.h>
Index: src/gdb/windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.232
diff -u -p -r1.232 windows-nat.c
--- src/gdb/windows-nat.c       22 Aug 2012 16:24:39 -0000      1.232
+++ src/gdb/windows-nat.c       25 Sep 2012 08:57:19 -0000
@@ -49,6 +49,7 @@
 #include "filenames.h"
 #include "symfile.h"
 #include "objfiles.h"
+#include "gdb_bfd.h"
 #include "gdb_obstack.h"
 #include "gdb_string.h"
 #include "gdbthread.h"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]