From: Ruben G. <ru...@ug...> - 2003-03-20 20:47:20
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In valgrind 1.0.4 (dont know if this is fixed in development) the location of gdb is hardcoded in vg_main.c as /usr/bin/gdb. Gdb sources, on the other hand, install by default in /usr/local/bin/gdb. Surely a patch to the ./configure to check where gdb is installed cannot be difficult. Thanks! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org iD8DBQE+eigdkzndl97WsggRAuEiAJ4oDZHdPTA/H34ruZnO+Tfqc7tNUQCeMdoA oG6azwlPvd+HSEeY0B1cMxo= =bsaQ -----END PGP SIGNATURE----- |
From: Nicholas N. <nj...@ca...> - 2003-04-16 09:59:01
|
On Thu, 20 Mar 2003, Ruben Garcia wrote: > In valgrind 1.0.4 (dont know if this is fixed in development) > the location of gdb is hardcoded in vg_main.c as /usr/bin/gdb. > > Gdb sources, on the other hand, install by default in /usr/local/bin/gdb. > Surely a patch to the ./configure to check where gdb is installed cannot > be difficult. I have this working, but I'm not certain if I've done it the best way. Here's what I did: - added this to configure.in: AC_PATH_PROG(GDB, gdb) - added this to coregrind/Makefile.am: vg_main.o: CFLAGS += -DWHERE_IS_GDB=@GDB@ - changed coregrind/vg_main.c to use WHERE_IS_GDB for the path. This works, but it would be better if the GDB variable was put into a .h file, so it's available everywhere -- that's better than having to feed it in to every file that needs it with -D. This could be done by introducing eg. vg_skin.h.in, but that would be a pain, especially just for one variable. I tried various ways to get the WHERE_IS_GDB variable put into config.h, but didn't manage... this would be a better solution. Does anyone know how to do this? Thanks very much. N |
From: Philippe E. <ph...@wa...> - 2003-04-16 16:55:26
|
Nicholas Nethercote wrote: > On Thu, 20 Mar 2003, Ruben Garcia wrote: > > >>In valgrind 1.0.4 (dont know if this is fixed in development) >>the location of gdb is hardcoded in vg_main.c as /usr/bin/gdb. >> >>Gdb sources, on the other hand, install by default in /usr/local/bin/gdb. >>Surely a patch to the ./configure to check where gdb is installed cannot >>be difficult. > > > I have this working, but I'm not certain if I've done it the best way. > > Here's what I did: > > - added this to configure.in: > > AC_PATH_PROG(GDB, gdb) > > - added this to coregrind/Makefile.am: > > vg_main.o: CFLAGS += -DWHERE_IS_GDB=@GDB@ > > - changed coregrind/vg_main.c to use WHERE_IS_GDB for the path. > > This works, but it would be better if the GDB variable was put into a .h > file, so it's available everywhere -- that's better than having to feed it > in to every file that needs it with -D. This could be done by introducing > eg. vg_skin.h.in, but that would be a pain, especially just for one > variable. > > I tried various ways to get the WHERE_IS_GDB variable put into config.h, > but didn't manage... this would be a better solution. Does anyone know > how to do this? Yes, it's a better way but the trivial: AC_PATH_PROG(GDB, gdb) AC_DEFINE(GDB_PATH, @GDB@, "gdb path") AC_SUBST(GDB) doesn't work cause configure don't do subsititution in config.h.in when creating config.h, I don't think there is any way to put it in config.h.in. I work around by doing: ** configure.in: AC_PATH(GDB_PATH, gdb) AC_SUBST(GDB_PATH) AC_OUTPUT( .... \ path-1.h) AX_COPY_IF_CHANGE(path-1.h, path.h) $ cat path-1.h.in #define GDB_PATH @GDB_PATH@ $ cat copyifchange.m4 dnl AX_COPY_IF_CHANGE(source, dest) dnl copy source to dest if they don't compare equally or if dest doesn't exist AC_DEFUN(AX_COPY_IF_CHANGE, [ if test -r $2; then if cmp $1 $2 > /dev/null; then echo $2 is unchanged else cp -f $1 $2 fi else cp -f $1 $2 fi ]) I use path-1.h and copyifchange to avoid spurious recompilation when you configure and nothing change in path-1.h. (configure take care to not change time stamp of config.h if unnecessary but doesn't do the same thing for other .in translation) Not very elegant but the only way I found The only required file in cvs/tarball is path-1.h.in regards, Phil |
From: Nicholas N. <nj...@ca...> - 2003-04-16 20:11:02
|
On Wed, 16 Apr 2003, Philippe Elie wrote: > > This works, but it would be better if the GDB variable was put into a .h > > file, so it's available everywhere -- that's better than having to feed it > > in to every file that needs it with -D. This could be done by introducing > > eg. vg_skin.h.in, but that would be a pain, especially just for one > > variable. > > Yes, it's a better way but the trivial: [snip] > Not very elegant but the only way I found Hmm, pretty ugly... if that's the only way to do it, I can live with passing in the option using -D :) Thanks very much. N |
From: Philippe E. <ph...@wa...> - 2003-04-17 00:06:03
|
Nicholas Nethercote wrote: > On Wed, 16 Apr 2003, Philippe Elie wrote: > > >>>This works, but it would be better if the GDB variable was put into a .h >>>file, so it's available everywhere -- that's better than having to feed it >>>in to every file that needs it with -D. This could be done by introducing >>>eg. vg_skin.h.in, but that would be a pain, especially just for one >>>variable. >> >>Yes, it's a better way but the trivial: > > > [snip] > > >>Not very elegant but the only way I found > > > Hmm, pretty ugly... if that's the only way to do it, I can live with > passing in the option using -D :) But the dependencies problem ? If the flags change you don't recompile the right file. A user with two gdb version, can change $PATH to select a different version and run configure; make but he will not get the right gdb version. regard, Phil |
From: Olly B. <ol...@su...> - 2003-04-18 12:26:20
|
On Wed, Apr 16, 2003 at 07:00:05PM +0000, Philippe Elie wrote: > Yes, it's a better way but the trivial: > > AC_PATH_PROG(GDB, gdb) > AC_DEFINE(GDB_PATH, @GDB@, "gdb path") > AC_SUBST(GDB) > > doesn't work cause configure don't do subsititution in > config.h.in when creating config.h, I don't think there is > any way to put it in config.h.in. There is - just use this: AC_PATH_PROG(GDB, gdb) AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", "gdb with path") Note that you must use AC_DEFINE_UNQUOTED instead of AC_DEFINE to get $GDB expanded before it is substituted - otherwise config.h will contain: #define GDB_PATH "$GDB" Cheers, Olly |
From: Nicholas N. <nj...@ca...> - 2003-04-18 12:55:11
|
On Fri, 18 Apr 2003, Olly Betts wrote: > > AC_PATH_PROG(GDB, gdb) > > AC_DEFINE(GDB_PATH, @GDB@, "gdb path") > > AC_SUBST(GDB) > > > > doesn't work cause configure don't do subsititution in > > config.h.in when creating config.h, I don't think there is > > any way to put it in config.h.in. > > There is - just use this: > > AC_PATH_PROG(GDB, gdb) > AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", "gdb with path") Ah, perfect, just what I wanted. I just committed the change. Thanks. N |