Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [patch, rfc] configure option for default value of solib-search-path
@ 2002-07-13 15:39 Dan Kegel
  2002-07-13 15:47 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Kegel @ 2002-07-13 15:39 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

In my cross-development environment, I need to type

set solib-search-path 
/opt/hardhat/devkit/ppc/405/powerpc-hardhat-linux/lib:/opt/hardhat/devkit/ppc/405/powerpc-hardhat-linux/usr/lib:/opt/hardhat/devkit/ppc/405/target/lib:/opt/hardhat/devkit/ppc/405/target/usr/lib

when I start gdb.  That's just a bit awkward; I'd prefer to have it default
to the proper value, just like the Montavista version does.

Here's a patch that lets you set the initial value of this patch at
configure time.  I haven't sent in a copyright assignment, so this
won't be accepted into the gdb tree, but I'd appreciate comments on
whether this is the right approach.  If it is, I'll gladly get the
copyright asignment paperwork going.

(Note: after applying the patch, you need to run autoconf.)

Thanks,
Dan


[-- Attachment #2: solib-path.patch --]
[-- Type: text/plain, Size: 1715 bytes --]

--- src/gdb/solib.c.orig	Sat Jul 13 12:13:51 2002
+++ src/gdb/solib.c	Sat Jul 13 12:15:23 2002
@@ -65,7 +65,11 @@
 /* If non-empty, this is a search path for loading non-absolute shared library
    symbol files.  This takes precedence over the environment variables PATH
    and LD_LIBRARY_PATH.  */
-static char *solib_search_path = NULL;
+#ifdef CONFIG_SOLIB_SEARCH_PATH
+  static char *solib_search_path = CONFIG_SOLIB_SEARCH_PATH;
+#else 
+  static char *solib_search_path = NULL;
+#endif
 
 /*

--- src/gdb/acconfig.h.orig	Sat Jul 13 12:53:20 2002
+++ src/gdb/acconfig.h	Sat Jul 13 12:54:46 2002
@@ -176,3 +176,7 @@
 
 /* nativefile */
 #undef GDB_NM_FILE
+
+/* Define when building cross gcc for particular cross-development environment */
+#undef CONFIG_SOLIB_SEARCH_PATH
+
--- src/gdb/config.in.orig	Thu Apr 11 11:32:51 2002
+++ src/gdb/config.in	Sat Jul 13 12:55:42 2002
@@ -186,6 +189,9 @@
 
 /* nativefile */
 #undef GDB_NM_FILE
+
+/* Define when building cross gcc for particular cross-development environment */
+#undef CONFIG_SOLIB_SEARCH_PATH
 
 /* Define if you have the __argz_count function.  */
 #undef HAVE___ARGZ_COUNT
--- src/gdb/configure.in.orig	Sat Jul 13 12:47:13 2002
+++ src/gdb/configure.in	Sat Jul 13 12:55:33 2002
@@ -932,6 +932,13 @@
 ],)
 
 
+AC_ARG_WITH(solib-search-path, [  --with-solib-search-path=DIR:DIR:DIR...   Directories to search for shared libraries on host], with_solib_seach_path=${withval})    
+
+if test x"${with_solib_seach_path}" != x ; then
+    AC_DEFINE_UNQUOTED(CONFIG_SOLIB_SEARCH_PATH,"$with_solib_seach_path")
+fi
+AC_SUBST(CONFIG_SOLIB_SEARCH_PATH)
+
 AC_ARG_ENABLE(gdbtk,
 [  --enable-gdbtk          Enable GDBTK GUI front end],
 [case "${enableval}" in

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch, rfc] configure option for default value of solib-search-path
  2002-07-13 15:39 [patch, rfc] configure option for default value of solib-search-path Dan Kegel
@ 2002-07-13 15:47 ` Daniel Jacobowitz
  2002-07-15 17:24   ` Dan Kegel
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2002-07-13 15:47 UTC (permalink / raw)
  To: Dan Kegel; +Cc: gdb

On Sat, Jul 13, 2002 at 04:21:49PM -0700, Dan Kegel wrote:
> In my cross-development environment, I need to type
> 
> set solib-search-path 
> /opt/hardhat/devkit/ppc/405/powerpc-hardhat-linux/lib:/opt/hardhat/devkit/ppc/405/powerpc-hardhat-linux/usr/lib:/opt/hardhat/devkit/ppc/405/target/lib:/opt/hardhat/devkit/ppc/405/target/usr/lib
> 
> when I start gdb.  That's just a bit awkward; I'd prefer to have it default
> to the proper value, just like the Montavista version does.
> 
> Here's a patch that lets you set the initial value of this patch at
> configure time.  I haven't sent in a copyright assignment, so this
> won't be accepted into the gdb tree, but I'd appreciate comments on
> whether this is the right approach.  If it is, I'll gladly get the
> copyright asignment paperwork going.
> 
> (Note: after applying the patch, you need to run autoconf.)

I believe that this was rejected in the past, for reference.  I don't
remember why though.

(Also, it's almost certainly a solib-absolute-prefix of
/opt/hardhat/devkit/ppc/405/target that you want.  I don't know that
setting a search path will work properly when the filenames and full
paths of the libraries are available... might work, but if you actually
need any shared libraries outside of target/ your program is unlikely to run
on the target :)

Or are you putting unstripped versions in one and stripped in the
other?  That always makes me worry about library skew; I generally
strip the target libraries only after building a target image.

-- 
Daniel Jacobowitz                           Debian GNU/Linux Developer
MontaVista Software                         Carnegie Mellon University


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch, rfc] configure option for default value of solib-search-path
  2002-07-13 15:47 ` Daniel Jacobowitz
@ 2002-07-15 17:24   ` Dan Kegel
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Kegel @ 2002-07-15 17:24 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

Daniel Jacobowitz wrote:
> On Sat, Jul 13, 2002 at 04:21:49PM -0700, Dan Kegel wrote:
> 
>>In my cross-development environment, I need to type
>>set solib-search-path 
>>/opt/hardhat/devkit/ppc/405/powerpc-hardhat-linux/lib:/opt/hardhat/devkit/ppc/405/powerpc-hardhat-linux/usr/lib:/opt/hardhat/devkit/ppc/405/target/lib:/opt/hardhat/devkit/ppc/405/target/usr/lib
>>
>>when I start gdb.  That's just a bit awkward; I'd prefer to have it default
>>to the proper value, just like the Montavista version does.
>>
>>Here's a patch that lets you set the initial value of this patch at
>>configure time. ...
> 
> I believe that this was rejected in the past, for reference.  I don't
> remember why though.

Maybe they'll like it this time.  Seems quite handy.

> (Also, it's almost certainly a solib-absolute-prefix of
> /opt/hardhat/devkit/ppc/405/target that you want. 

You're quite right, thanks!

Here's a revised patch that lets you set defaults for both variables.
(Fixes a silly problem with the previous patch, too.)
As before, you need to run autoconf after applying.
- Dan



[-- Attachment #2: solib-path-2.patch --]
[-- Type: text/plain, Size: 2773 bytes --]

diff -aur src.orig/gdb/acconfig.h src/gdb/acconfig.h
--- src.orig/gdb/acconfig.h	Thu Apr 11 11:32:51 2002
+++ src/gdb/acconfig.h	Mon Jul 15 17:06:50 2002
@@ -176,3 +176,9 @@
 
 /* nativefile */
 #undef GDB_NM_FILE
+
+/* useful when building cross gcc for particular cross-development environment */
+#undef CONFIG_SOLIB_SEARCH_PATH
+
+/* useful when building cross gcc for particular cross-development environment */
+#undef CONFIG_SOLIB_ABSOLUTE_PREFIX
diff -aur src.orig/gdb/config.in src/gdb/config.in
--- src.orig/gdb/config.in	Fri Jun 21 16:48:32 2002
+++ src/gdb/config.in	Mon Jul 15 17:07:10 2002
@@ -1,4 +1,4 @@
-/* config.in.  Generated automatically from configure.in by autoheader.  */
+/* config.in.  Generated automatically from configure.in by autoheader 2.13.  */
 
 /* Define if on AIX 3.
    System headers sometimes define this.
@@ -190,6 +190,12 @@
 /* nativefile */
 #undef GDB_NM_FILE
 
+/* useful when building cross gcc for particular cross-development environment */
+#undef CONFIG_SOLIB_SEARCH_PATH
+
+/* useful when building cross gcc for particular cross-development environment */
+#undef CONFIG_SOLIB_ABSOLUTE_PREFIX
+
 /* Define if you have the __argz_count function.  */
 #undef HAVE___ARGZ_COUNT
 
diff -aur src.orig/gdb/configure.in src/gdb/configure.in
--- src.orig/gdb/configure.in	Fri Jun 21 16:48:39 2002
+++ src/gdb/configure.in	Mon Jul 15 16:32:05 2002
@@ -933,6 +933,21 @@
 ],)
 
 
+AC_ARG_WITH(solib-search-path, [  --with-solib-search-path=DIR:DIR:DIR...   Directories to search for shared libraries on host], with_solib_seach_path=${withval})    
+
+if test x"${with_solib_seach_path}" != x ; then
+    AC_DEFINE_UNQUOTED(CONFIG_SOLIB_SEARCH_PATH,"$with_solib_seach_path")
+fi
+AC_SUBST(CONFIG_SOLIB_SEARCH_PATH)
+
+AC_ARG_WITH(solib-absolute-prefix, [  --with-solib-absolute-prefix=DIR   Directory containing shared libraries on host], with_solib_absolute_prefix=${withval})    
+
+if test x"${with_solib_absolute_prefix}" != x ; then
+    AC_DEFINE_UNQUOTED(CONFIG_SOLIB_ABSOLUTE_PREFIX,"$with_solib_absolute_prefix")
+fi
+AC_SUBST(CONFIG_SOLIB_ABSOLUTE_PREFIX)
+
+
 AC_ARG_ENABLE(gdbtk,
 [  --enable-gdbtk          Enable GDBTK GUI front end],
 [case "${enableval}" in
diff -aur src.orig/gdb/solib.c src/gdb/solib.c
--- src.orig/gdb/solib.c	Sat May 11 21:20:06 2002
+++ src/gdb/solib.c	Mon Jul 15 16:32:05 2002
@@ -881,4 +881,12 @@
 		   &setlist);
   add_show_from_set (c, &showlist);
   set_cmd_completer (c, filename_completer);
+
+#ifdef CONFIG_SOLIB_SEARCH_PATH
+  solib_search_path = savestring(CONFIG_SOLIB_SEARCH_PATH, strlen(CONFIG_SOLIB_SEARCH_PATH));
+#endif
+#ifdef CONFIG_SOLIB_ABSOLUTE_PREFIX
+  solib_absolute_prefix = savestring(CONFIG_SOLIB_ABSOLUTE_PREFIX, strlen(CONFIG_SOLIB_ABSOLUTE_PREFIX));
+#endif
 }
+

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-07-16  0:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-13 15:39 [patch, rfc] configure option for default value of solib-search-path Dan Kegel
2002-07-13 15:47 ` Daniel Jacobowitz
2002-07-15 17:24   ` Dan Kegel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox