* 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.
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.
*** 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.
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
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);
}
+ xfree (iconv_program);
pex_free (child);
free_environ (iconv_env);
/* 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
with_bugurl
with_zlib
with_libiconv_prefix
+with_iconv_bin
with_system_readline
with_expat
with_gnu_ld
--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
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.
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.
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);
+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>
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.
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)
{
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;
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