aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2011-05-09 21:49:57 +0000
committerDoug Evans <dje@google.com>2011-05-09 21:49:57 +0000
commit478aac75e4114810db639e06a13e15547ec49e3d (patch)
treef9952574ed7f284c1a30ff2052208d9e398fa0fa /gdb/main.c
parent673c2bbeab36a7240fc8b85e696fbad249fbf408 (diff)
downloadgdb-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/main.c')
-rw-r--r--gdb/main.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gdb/main.c b/gdb/main.c
index ff305a1..73ce4c8 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -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