* [RFA] Add missing gdb_bfd.h includes
@ 2012-09-25 9:12 Pierre Muller
0 siblings, 0 replies; 3+ messages in thread
From: Pierre Muller @ 2012-09-25 9:12 UTC (permalink / raw)
To: gdb-patches; +Cc: 'Tom Tromey'
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"
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <18620.4427075156$1348564388@news.gmane.org>]
* Re: [RFA] Add missing gdb_bfd.h includes
[not found] <18620.4427075156$1348564388@news.gmane.org>
@ 2012-09-26 20:01 ` Tom Tromey
2012-09-26 21:31 ` Pierre Muller
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2012-09-26 20:01 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> Is this OK?
Yes, thank you.
Pierre> As usual,
Pierre> 1) I am not sure about correct wording for ChangeLog
What you wrote is fine.
Pierre> 2) I never really understood the ordering logic (or to
Pierre> be more precise, if there is an ordering logic) of C headers
Pierre> in C source files, thus I inserted them more or less randomly...
There should not be many strong ordering dependencies in gdb, aside from
the rule that defs.h has to come first. I wouldn't worry about it in
general.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [RFA] Add missing gdb_bfd.h includes
2012-09-26 20:01 ` Tom Tromey
@ 2012-09-26 21:31 ` Pierre Muller
0 siblings, 0 replies; 3+ messages in thread
From: Pierre Muller @ 2012-09-26 21:31 UTC (permalink / raw)
To: 'Tom Tromey'; +Cc: gdb-patches
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : mercredi 26 septembre 2012 22:01
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA] Add missing gdb_bfd.h includes
>
> >>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
writes:
>
> Pierre> Is this OK?
>
> Yes, thank you.
OK, patch committed in
http://sourceware.org/ml/gdb-cvs/2012-09/msg00156.html
> Pierre> As usual,
> Pierre> 1) I am not sure about correct wording for ChangeLog
>
> What you wrote is fine.
>
> Pierre> 2) I never really understood the ordering logic (or to
> Pierre> be more precise, if there is an ordering logic) of C headers
> Pierre> in C source files, thus I inserted them more or less randomly...
>
> There should not be many strong ordering dependencies in gdb, aside from
> the rule that defs.h has to come first. I wouldn't worry about it in
> general.
Thanks for the clarification,
Pierre
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-26 21:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-25 9:12 [RFA] Add missing gdb_bfd.h includes Pierre Muller
[not found] <18620.4427075156$1348564388@news.gmane.org>
2012-09-26 20:01 ` Tom Tromey
2012-09-26 21:31 ` Pierre Muller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox