diff options
author | Doug Evans <dje@google.com> | 2011-05-09 21:49:57 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2011-05-09 21:49:57 +0000 |
commit | 478aac75e4114810db639e06a13e15547ec49e3d (patch) | |
tree | f9952574ed7f284c1a30ff2052208d9e398fa0fa /gdb | |
parent | 673c2bbeab36a7240fc8b85e696fbad249fbf408 (diff) | |
download | gdb-478aac75e4114810db639e06a13e15547ec49e3d.zip gdb-478aac75e4114810db639e06a13e15547ec49e3d.tar.gz gdb-478aac75e4114810db639e06a13e15547ec49e3d.tar.bz2 |
* NEWS: Mention --with-iconv-bin.
* configure.ac: New option --with-iconv-bin.
* configure: Regenerate.
* config.in: Regenerate.
* defs.h (relocate_gdb_directory): Declare.
* main.c (relocate_gdb_directory): Renamed from relocate_directory,
removed progname parameter, and exported. All callers updated.
* charset.c (find_charset_names): Use --with-iconv-bin if specified.
doc/
* gdb.texinfo (Requirements): Fix typo. Mention --with-iconv-bin.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/NEWS | 6 | ||||
-rw-r--r-- | gdb/charset.c | 23 | ||||
-rw-r--r-- | gdb/config.in | 6 | ||||
-rwxr-xr-x | gdb/configure | 53 | ||||
-rw-r--r-- | gdb/configure.ac | 23 | ||||
-rw-r--r-- | gdb/defs.h | 6 | ||||
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 7 | ||||
-rw-r--r-- | gdb/main.c | 23 |
10 files changed, 145 insertions, 15 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 580ce56..6a130b6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 2011-05-09 Doug Evans <dje@google.com> + * NEWS: Mention --with-iconv-bin. + * configure.ac: New option --with-iconv-bin. + * configure: Regenerate. + * config.in: Regenerate. + * defs.h (relocate_gdb_directory): Declare. + * main.c (relocate_gdb_directory): Renamed from relocate_directory, + removed progname parameter, and exported. All callers updated. + * charset.c (find_charset_names): Use --with-iconv-bin if specified. + * linux-nat.c (lin_lwp_attach_lwp): For !WIPSTOPPED case, adding missing call to restore_child_signals_mask. @@ -3,6 +3,12 @@ *** Changes since GDB 7.3 +* New configure option --with-iconv-bin. + When using the internationalization support like the one in the GNU C + library, GDB will invoke the "iconv" program to get a list of supported + character sets. If this program lives in a non-standard location, one can + use this option to specify where to find it. + * When natively debugging programs on PowerPC BookE processors running a Linux kernel version 2.6.34 or later, GDB supports masked hardware watchpoints, which specify a mask in addition to an address to watch. diff --git a/gdb/charset.c b/gdb/charset.c index a84085a..b85758b 100644 --- a/gdb/charset.c +++ b/gdb/charset.c @@ -799,7 +799,9 @@ find_charset_names (void) char *args[3]; int err, status; int fail = 1; + int flags; struct gdb_environ *iconv_env; + char *iconv_program; /* Older iconvs, e.g. 2.2.2, don't omit the intro text if stdout is not a tty. We need to recognize it and ignore it. This text is @@ -811,12 +813,26 @@ find_charset_names (void) child = pex_init (PEX_USE_PIPES, "iconv", NULL); - args[0] = "iconv"; +#ifdef ICONV_BIN + { + char *iconv_dir = relocate_gdb_directory (ICONV_BIN, + ICONV_BIN_RELOCATABLE); + iconv_program = concat (iconv_dir, SLASH_STRING, "iconv", NULL); + xfree (iconv_dir); + } +#else + iconv_program = xstrdup ("iconv"); +#endif + args[0] = iconv_program; args[1] = "-l"; args[2] = NULL; + flags = PEX_STDERR_TO_STDOUT; +#ifndef ICONV_BIN + flags |= PEX_SEARCH; +#endif /* Note that we simply ignore errors here. */ - if (!pex_run_in_environment (child, PEX_SEARCH | PEX_STDERR_TO_STDOUT, - "iconv", args, environ_vector (iconv_env), + if (!pex_run_in_environment (child, flags, + args[0], args, environ_vector (iconv_env), NULL, NULL, &err)) { FILE *in = pex_read_output (child, 0); @@ -888,6 +904,7 @@ find_charset_names (void) } + xfree (iconv_program); pex_free (child); free_environ (iconv_env); diff --git a/gdb/config.in b/gdb/config.in index 01ba750..db00195 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -716,6 +716,12 @@ /* Define to 1 if you have the `_mcleanup' function. */ #undef HAVE__MCLEANUP +/* Path of directory of iconv program. */ +#undef ICONV_BIN + +/* Define if the iconv directory should be relocated when GDB is moved. */ +#undef ICONV_BIN_RELOCATABLE + /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST diff --git a/gdb/configure b/gdb/configure index 92818a0..bf6ac01 100755 --- a/gdb/configure +++ b/gdb/configure @@ -961,6 +961,7 @@ with_pkgversion with_bugurl with_zlib with_libiconv_prefix +with_iconv_bin with_system_readline with_expat with_gnu_ld @@ -1660,6 +1661,7 @@ Optional Packages: --with-zlib include zlib support (auto/yes/no) default=auto --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib + --with-iconv-bin=PATH specify where to find the iconv program --with-system-readline use installed readline library --with-expat include expat support (auto/yes/no) --with-gnu-ld assume the C compiler uses GNU ld default=no @@ -9523,6 +9525,57 @@ _ACEOF fi +# GDB may fork/exec the iconv program to get the list of supported character +# sets. Allow the user to specify where to find it. +# There are several factors affecting the choice of option name: +# - There is already --with-libiconv-prefix but we can't use it, it specifies +# the build-time location of libiconv files. +# - The program we need to find is iconv, which comes with glibc. The user +# doesn't necessarily have libiconv installed. Therefore naming this +# --with-libiconv-foo feels wrong. +# - We want the path to be relocatable, but GDB_AC_DEFINE_RELOCATABLE is +# defined to work on directories not files (though it really doesn't know +# the difference). +# - Calling this --with-iconv-prefix is perceived to cause too much confusion +# with --with-libiconv-prefix. +# Putting these together is why the option name is --with-iconv-bin. + + +# Check whether --with-iconv-bin was given. +if test "${with_iconv_bin+set}" = set; then : + withval=$with_iconv_bin; iconv_bin="${withval}" + +cat >>confdefs.h <<_ACEOF +#define ICONV_BIN "${iconv_bin}" +_ACEOF + + + if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + value=0 + case ${iconv_bin} in + "${test_prefix}"|"${test_prefix}/"*|\ + '${exec_prefix}'|'${exec_prefix}/'*) + value=1 + ;; + esac + +cat >>confdefs.h <<_ACEOF +#define ICONV_BIN_RELOCATABLE $value +_ACEOF + + + +fi + + # On alpha-osf, it appears that libtermcap and libcurses are not compatible. # There is a very specific comment in /usr/include/curses.h explaining that # termcap routines built into libcurses must not be used. diff --git a/gdb/configure.ac b/gdb/configure.ac index 96e0a7b..a42ce27 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -433,6 +433,29 @@ AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl]) AM_ICONV +# GDB may fork/exec the iconv program to get the list of supported character +# sets. Allow the user to specify where to find it. +# There are several factors affecting the choice of option name: +# - There is already --with-libiconv-prefix but we can't use it, it specifies +# the build-time location of libiconv files. +# - The program we need to find is iconv, which comes with glibc. The user +# doesn't necessarily have libiconv installed. Therefore naming this +# --with-libiconv-foo feels wrong. +# - We want the path to be relocatable, but GDB_AC_DEFINE_RELOCATABLE is +# defined to work on directories not files (though it really doesn't know +# the difference). +# - Calling this --with-iconv-prefix is perceived to cause too much confusion +# with --with-libiconv-prefix. +# Putting these together is why the option name is --with-iconv-bin. + +AC_ARG_WITH(iconv-bin, +AS_HELP_STRING([--with-iconv-bin=PATH], [specify where to find the iconv program]), +[iconv_bin="${withval}" + AC_DEFINE_UNQUOTED([ICONV_BIN], ["${iconv_bin}"], + [Path of directory of iconv program.]) + GDB_AC_DEFINE_RELOCATABLE(ICONV_BIN, iconv, ${iconv_bin}) +]) + # On alpha-osf, it appears that libtermcap and libcurses are not compatible. # There is a very specific comment in /usr/include/curses.h explaining that # termcap routines built into libcurses must not be used. @@ -282,6 +282,12 @@ struct breakpoint; struct frame_info; struct gdbarch; +/* From main.c. */ + +/* This really belong in utils.c (path-utils.c?), but it references some + globals that are currently only available to main.c. */ +extern char *relocate_gdb_directory (const char *initial, int flag); + /* From utils.c */ extern void initialize_utils (void); diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 2eacb32..e9990c2 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2011-05-09 Doug Evans <dje@google.com> + + * gdb.texinfo (Requirements): Fix typo. Mention --with-iconv-bin. + 2011-05-06 Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com> Thiago Jung Bauermann <bauerman@br.ibm.com> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 3618b70..65172b5 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -31214,7 +31214,12 @@ Sets}) require a functioning @code{iconv} implementation. If you are on a GNU system, then this is provided by the GNU C Library. Some other systems also provide a working @code{iconv}. -On systems with @code{iconv}, you can install GNU Libiconv. If you +If @value{GDBN} is using the @code{iconv} program which is installed +in a non-standard place, you will need to tell @value{GDBN} where to find it. +This is done with @option{--with-iconv-bin} which specifies the +directory that contains the @code{iconv} program. + +On systems without @code{iconv}, you can install GNU Libiconv. If you have previously installed Libiconv, you can use the @option{--with-libiconv-prefix} option to configure. @@ -104,6 +104,7 @@ extern char *external_editor_command; file or directory. FLAG is true if the value is relocatable, false otherwise. Returns a newly allocated string; this may return NULL under the same conditions as make_relative_prefix. */ + static char * relocate_path (const char *progname, const char *initial, int flag) { @@ -117,12 +118,13 @@ relocate_path (const char *progname, const char *initial, int flag) the result is a directory, it is used; otherwise, INITIAL is used. The chosen directory is then canonicalized using lrealpath. This function always returns a newly-allocated string. */ -static char * -relocate_directory (const char *progname, const char *initial, int flag) + +char * +relocate_gdb_directory (const char *initial, int flag) { char *dir; - dir = relocate_path (progname, initial, flag); + dir = relocate_path (gdb_program_name, initial, flag); if (dir) { struct stat s; @@ -342,22 +344,21 @@ captured_main (void *data) current_directory = gdb_dirbuf; /* Set the sysroot path. */ - gdb_sysroot = relocate_directory (argv[0], TARGET_SYSTEM_ROOT, - TARGET_SYSTEM_ROOT_RELOCATABLE); + gdb_sysroot = relocate_gdb_directory (TARGET_SYSTEM_ROOT, + TARGET_SYSTEM_ROOT_RELOCATABLE); - debug_file_directory = relocate_directory (argv[0], DEBUGDIR, - DEBUGDIR_RELOCATABLE); + debug_file_directory = relocate_gdb_directory (DEBUGDIR, + DEBUGDIR_RELOCATABLE); - gdb_datadir = relocate_directory (argv[0], GDB_DATADIR, - GDB_DATADIR_RELOCATABLE); + gdb_datadir = relocate_gdb_directory (GDB_DATADIR, + GDB_DATADIR_RELOCATABLE); #ifdef WITH_PYTHON_PATH { /* For later use in helping Python find itself. */ char *tmp = concat (WITH_PYTHON_PATH, SLASH_STRING, "lib", NULL); - python_libdir = relocate_directory (argv[0], tmp, - PYTHON_PATH_RELOCATABLE); + python_libdir = relocate_gdb_directory (tmp, PYTHON_PATH_RELOCATABLE); xfree (tmp); } #endif |