* [patch] 6.0: Use cconfig.h instead of config.h in sim/common
@ 2003-11-17 17:02 Maciej W. Rozycki
2003-12-02 16:10 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2003-11-17 17:02 UTC (permalink / raw)
To: gdb-patches
Hello,
Since files from sim/common are built in a target-dependent directory, an
ambiguity exists in which of the common and the target-dependent
configuration headers are included. Both directories has their own
configure scripts each and both scripts create a local configuration. To
disambiguate between them, config.h in common has been renamed to
cconfig.h, but a few files still refer to config.h. I think they all
should include cconfig.h as it records the results of tests specific to
the common directory, i.e. to these very files. The config.h header is
target-specific and need not correctly provide all examined macros. Am I
missing anything here?
Here is a proposed fix. It adds "#ifdef HAVE_CONFIG_H" for consistency
as well, although it's probably and overkill here.
2003-11-17 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
* callback.c: Include cconfig.h instead of config.h.
* run.c: Likewise.
* sim-basics.h: Likewise.
* sim-load.c: Likewise.
* syscall.c: Likewise.
I've successfully tested it with a mipsel-linux target. Please apply.
Maciej
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
gdb-6.0-sim-cconfig.patch
diff -up --recursive --new-file gdb-6.0.macro/sim/common/callback.c gdb-6.0/sim/common/callback.c
--- gdb-6.0.macro/sim/common/callback.c 2002-06-09 15:45:45.000000000 +0000
+++ gdb-6.0/sim/common/callback.c 2003-11-09 01:07:33.000000000 +0000
@@ -22,7 +22,7 @@
level. */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "cconfig.h"
#endif
#include "ansidecl.h"
#ifdef ANSI_PROTOTYPES
diff -up --recursive --new-file gdb-6.0.macro/sim/common/run.c gdb-6.0/sim/common/run.c
--- gdb-6.0.macro/sim/common/run.c 2003-06-05 02:17:29.000000000 +0000
+++ gdb-6.0/sim/common/run.c 2003-11-16 19:09:07.000000000 +0000
@@ -18,8 +18,10 @@ with this program; if not, write to the
/* Steve Chamberlain sac@cygnus.com,
and others at Cygnus. */
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include "cconfig.h"
#include "tconfig.h"
+#endif
#include <signal.h>
#include <stdio.h>
diff -up --recursive --new-file gdb-6.0.macro/sim/common/sim-basics.h gdb-6.0/sim/common/sim-basics.h
--- gdb-6.0.macro/sim/common/sim-basics.h 2002-11-23 01:12:05.000000000 +0000
+++ gdb-6.0/sim/common/sim-basics.h 2003-11-09 01:06:45.000000000 +0000
@@ -29,7 +29,7 @@
/* Basic configuration */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "cconfig.h"
#endif
/* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will
diff -up --recursive --new-file gdb-6.0.macro/sim/common/sim-load.c gdb-6.0/sim/common/sim-load.c
--- gdb-6.0.macro/sim/common/sim-load.c 2002-06-09 15:45:45.000000000 +0000
+++ gdb-6.0/sim/common/sim-load.c 2003-11-09 01:09:52.000000000 +0000
@@ -19,7 +19,9 @@ along with this program; if not, write t
as it is used by simulators that don't use it [though that doesn't mean
to suggest that they shouldn't :-)]. */
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include "cconfig.h"
+#endif
#include "ansidecl.h"
#include <stdio.h> /* for NULL */
#ifdef ANSI_PROTOTYPES
diff -up --recursive --new-file gdb-6.0.macro/sim/common/syscall.c gdb-6.0/sim/common/syscall.c
--- gdb-6.0.macro/sim/common/syscall.c 2002-06-09 15:45:45.000000000 +0000
+++ gdb-6.0/sim/common/syscall.c 2003-11-09 01:10:04.000000000 +0000
@@ -25,7 +25,7 @@
supported. */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "cconfig.h"
#endif
#include "ansidecl.h"
#include "libiberty.h"
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] 6.0: Use cconfig.h instead of config.h in sim/common
2003-11-17 17:02 [patch] 6.0: Use cconfig.h instead of config.h in sim/common Maciej W. Rozycki
@ 2003-12-02 16:10 ` Daniel Jacobowitz
2003-12-02 17:35 ` Frank Ch. Eigler
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-12-02 16:10 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: gdb-patches, Ben Elliston, Frank Ch. Eigler
On Mon, Nov 17, 2003 at 06:02:03PM +0100, Maciej W. Rozycki wrote:
> Hello,
>
> Since files from sim/common are built in a target-dependent directory, an
> ambiguity exists in which of the common and the target-dependent
> configuration headers are included. Both directories has their own
> configure scripts each and both scripts create a local configuration. To
> disambiguate between them, config.h in common has been renamed to
> cconfig.h, but a few files still refer to config.h. I think they all
> should include cconfig.h as it records the results of tests specific to
> the common directory, i.e. to these very files. The config.h header is
> target-specific and need not correctly provide all examined macros. Am I
> missing anything here?
>
> Here is a proposed fix. It adds "#ifdef HAVE_CONFIG_H" for consistency
> as well, although it's probably and overkill here.
>
> 2003-11-17 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
>
> * callback.c: Include cconfig.h instead of config.h.
> * run.c: Likewise.
> * sim-basics.h: Likewise.
> * sim-load.c: Likewise.
> * syscall.c: Likewise.
>
> I've successfully tested it with a mipsel-linux target. Please apply.
This patch looks right to me, but I'm not very familiar with the sim.
I've CC'd the listed maintainers for sim/common/ in case they know
something I don't about this code.
> gdb-6.0-sim-cconfig.patch
> diff -up --recursive --new-file gdb-6.0.macro/sim/common/callback.c gdb-6.0/sim/common/callback.c
> --- gdb-6.0.macro/sim/common/callback.c 2002-06-09 15:45:45.000000000 +0000
> +++ gdb-6.0/sim/common/callback.c 2003-11-09 01:07:33.000000000 +0000
> @@ -22,7 +22,7 @@
> level. */
>
> #ifdef HAVE_CONFIG_H
> -#include "config.h"
> +#include "cconfig.h"
> #endif
> #include "ansidecl.h"
> #ifdef ANSI_PROTOTYPES
> diff -up --recursive --new-file gdb-6.0.macro/sim/common/run.c gdb-6.0/sim/common/run.c
> --- gdb-6.0.macro/sim/common/run.c 2003-06-05 02:17:29.000000000 +0000
> +++ gdb-6.0/sim/common/run.c 2003-11-16 19:09:07.000000000 +0000
> @@ -18,8 +18,10 @@ with this program; if not, write to the
> /* Steve Chamberlain sac@cygnus.com,
> and others at Cygnus. */
>
> -#include "config.h"
> +#ifdef HAVE_CONFIG_H
> +#include "cconfig.h"
> #include "tconfig.h"
> +#endif
>
> #include <signal.h>
> #include <stdio.h>
> diff -up --recursive --new-file gdb-6.0.macro/sim/common/sim-basics.h gdb-6.0/sim/common/sim-basics.h
> --- gdb-6.0.macro/sim/common/sim-basics.h 2002-11-23 01:12:05.000000000 +0000
> +++ gdb-6.0/sim/common/sim-basics.h 2003-11-09 01:06:45.000000000 +0000
> @@ -29,7 +29,7 @@
> /* Basic configuration */
>
> #ifdef HAVE_CONFIG_H
> -#include "config.h"
> +#include "cconfig.h"
> #endif
>
> /* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will
> diff -up --recursive --new-file gdb-6.0.macro/sim/common/sim-load.c gdb-6.0/sim/common/sim-load.c
> --- gdb-6.0.macro/sim/common/sim-load.c 2002-06-09 15:45:45.000000000 +0000
> +++ gdb-6.0/sim/common/sim-load.c 2003-11-09 01:09:52.000000000 +0000
> @@ -19,7 +19,9 @@ along with this program; if not, write t
> as it is used by simulators that don't use it [though that doesn't mean
> to suggest that they shouldn't :-)]. */
>
> -#include "config.h"
> +#ifdef HAVE_CONFIG_H
> +#include "cconfig.h"
> +#endif
> #include "ansidecl.h"
> #include <stdio.h> /* for NULL */
> #ifdef ANSI_PROTOTYPES
> diff -up --recursive --new-file gdb-6.0.macro/sim/common/syscall.c gdb-6.0/sim/common/syscall.c
> --- gdb-6.0.macro/sim/common/syscall.c 2002-06-09 15:45:45.000000000 +0000
> +++ gdb-6.0/sim/common/syscall.c 2003-11-09 01:10:04.000000000 +0000
> @@ -25,7 +25,7 @@
> supported. */
>
> #ifdef HAVE_CONFIG_H
> -#include "config.h"
> +#include "cconfig.h"
> #endif
> #include "ansidecl.h"
> #include "libiberty.h"
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] 6.0: Use cconfig.h instead of config.h in sim/common
2003-12-02 16:10 ` Daniel Jacobowitz
@ 2003-12-02 17:35 ` Frank Ch. Eigler
0 siblings, 0 replies; 3+ messages in thread
From: Frank Ch. Eigler @ 2003-12-02 17:35 UTC (permalink / raw)
To: Maciej W. Rozycki, gdb-patches, Ben Elliston
[-- Attachment #1: Type: text/plain, Size: 599 bytes --]
Hi -
On Tue, Dec 02, 2003 at 11:10:43AM -0500, Daniel Jacobowitz wrote:
> On Mon, Nov 17, 2003 at 06:02:03PM +0100, Maciej W. Rozycki wrote:
> > [...]
> > Since files from sim/common are built in a target-dependent directory, an
> > ambiguity exists in which of the common and the target-dependent
> > configuration headers are included. [...]
>
> This patch looks right to me, but I'm not very familiar with the sim.
> I've CC'd the listed maintainers for sim/common/ in case they know
> something I don't about this code.
This looks fine to me, maybe even obvious.
- FChE
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-12-02 17:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-17 17:02 [patch] 6.0: Use cconfig.h instead of config.h in sim/common Maciej W. Rozycki
2003-12-02 16:10 ` Daniel Jacobowitz
2003-12-02 17:35 ` Frank Ch. Eigler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox