summaryrefslogtreecommitdiff
path: root/dist/gdb
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-11-01 11:44:14 +0200
committerOrgad Shaneh <orgads@gmail.com>2013-11-01 12:23:55 +0100
commitc56a106dbeb87239272b21c7290f705b8a7e3b19 (patch)
tree0baf7d3347d33240d2297cf9ada8030997c05db1 /dist/gdb
parente57ad86a22052684816e62fb832f9c2de2509411 (diff)
downloadqt-creator-c56a106dbeb87239272b21c7290f705b8a7e3b19.tar.gz
GDB: Remove datadir patch
Lookup is done internally in the dumpers Change-Id: Idc6a7bd7c47bb7e0655d10c21ac3e17421d98bdc Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'dist/gdb')
-rw-r--r--dist/gdb/Makefile.mingw3
-rw-r--r--dist/gdb/patches/datadir.patch142
2 files changed, 1 insertions, 144 deletions
diff --git a/dist/gdb/Makefile.mingw b/dist/gdb/Makefile.mingw
index cfa2e8e6d6..e3678e30ff 100644
--- a/dist/gdb/Makefile.mingw
+++ b/dist/gdb/Makefile.mingw
@@ -73,8 +73,7 @@ ${staging}/gdb-${version}/configure: ${source}/gdb-${version}.tar.bz2 | makestag
tar xf ${source}/gdb-${version}.tar.bz2 && \
cd gdb-${version} && \
touch configure && \
- patch -p2 < ${broot}/patches/gdb-ipv6.patch && \
- patch -p1 < ${broot}/patches/datadir.patch
+ patch -p2 < ${broot}/patches/gdb-ipv6.patch
${staging}/lib/libiconv.a: ${source}/libiconv-${iconvversion}.tar.gz | makestagingdir
cd ${staging} && \
diff --git a/dist/gdb/patches/datadir.patch b/dist/gdb/patches/datadir.patch
deleted file mode 100644
index a688ceccc5..0000000000
--- a/dist/gdb/patches/datadir.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-Source: http://sourceware-org.1504.n7.nabble.com/PATCH-Try-to-initialize-data-directory-by-first-searching-for-quot-data-directory-quot-in-the-same-dy-td73462.html
-
-orgads: Removed last dir separator before calling stat
-diff --git a/gdb/main.c b/gdb/main.c
---- a/gdb/main.c
-+++ b/gdb/main.c
-@@ -98,17 +98,38 @@ static char *gdb_program_name;
-
- static void print_gdb_help (struct ui_file *);
-
--/* Relocate a file or directory. PROGNAME is the name by which gdb
-- was invoked (i.e., argv[0]). INITIAL is the default value for the
-- 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. */
-+/* Relocate a file or directory, checking if it exists. PROGNAME is the
-+ name by which gdb was invoked (i.e., argv[0]). INITIAL is the default
-+ value for the file or directory. ISDIR is true if INITIAL is a
-+ 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, or if the relocated path does not
-+ exist. */
-
- static char *
--relocate_path (const char *progname, const char *initial, int flag)
-+relocate_path (const char *progname, const char *initial, int isdir,
-+ int flag)
- {
- if (flag)
-- return make_relative_prefix (progname, BINDIR, initial);
-+ {
-+ char *path;
-+ path = make_relative_prefix (progname, BINDIR, initial);
-+ if (path)
-+ {
-+ struct stat s;
-+
-+ char *last = path + strlen(path) - 1;
-+ if (IS_DIR_SEPARATOR(*last))
-+ *last = '\0';
-+
-+ if (*path == 0 || stat (path, &s) != 0 || (!isdir != !S_ISDIR (s.st_mode)))
-+ {
-+ xfree (path);
-+ path = NULL;
-+ }
-+ }
-+ return path;
-+ }
- return xstrdup (initial);
- }
-
-@@ -123,19 +144,52 @@ relocate_gdb_directory (const char *init
- {
- char *dir;
-
-- dir = relocate_path (gdb_program_name, initial, flag);
-- if (dir)
-+ dir = relocate_path (gdb_program_name, initial, 1, flag);
-+ if (!dir)
-+ dir = xstrdup (initial);
-+
-+ /* Canonicalize the directory. */
-+ if (*dir)
- {
-- struct stat s;
-+ char *canon_sysroot = lrealpath (dir);
-
-- if (*dir == '\0' || stat (dir, &s) != 0 || !S_ISDIR (s.st_mode))
-+ if (canon_sysroot)
- {
- xfree (dir);
-- dir = NULL;
-+ dir = canon_sysroot;
- }
- }
-+
-+ return dir;
-+}
-+
-+/* Like relocate_gdb_path, but specifically for data-directory. */
-+
-+static char *
-+relocate_gdb_data_directory (void)
-+{
-+ char *dir;
-+
-+ /* First try to find "data-directory" in the same directory as gdb.
-+
-+ Use relocate_path only to resolve the parent directory of
-+ gdb_program_name (i.e., based on PATH if necessary); relocate_path
-+ (gdb_program_name, BINDIR "/data-directory") cannot be used to resolve
-+ data-directory as it returns a path relative to the _grandparent
-+ directory_ of gdb_program_name (munging the parent directory). */
-+
-+ dir = relocate_path (gdb_program_name, BINDIR, 1, 1);
-+ if (dir)
-+ dir = reconcat (dir, dir, SLASH_STRING, "data-directory", NULL);
-+
-+ /* Then try to find GDB_DATADIR relocated relative to gdb. */
- if (!dir)
-- dir = xstrdup (initial);
-+ dir = relocate_path (gdb_program_name, GDB_DATADIR, 1,
-+ GDB_DATADIR_RELOCATABLE);
-+
-+ /* Otherwise use GDB_DATADIR as is. */
-+ if (!dir)
-+ dir = xstrdup (GDB_DATADIR);
-
- /* Canonicalize the directory. */
- if (*dir)
-@@ -169,7 +223,7 @@ get_init_files (char **system_gdbinit,
-
- if (!initialized)
- {
-- struct stat homebuf, cwdbuf, s;
-+ struct stat homebuf, cwdbuf;
- char *homedir;
-
- if (SYSTEM_GDBINIT[0])
-@@ -200,9 +254,10 @@ get_init_files (char **system_gdbinit,
- {
- relocated_sysgdbinit = relocate_path (gdb_program_name,
- SYSTEM_GDBINIT,
-+ 0,
- SYSTEM_GDBINIT_RELOCATABLE);
- }
-- if (relocated_sysgdbinit && stat (relocated_sysgdbinit, &s) == 0)
-+ if (relocated_sysgdbinit)
- sysgdbinit = relocated_sysgdbinit;
- else
- xfree (relocated_sysgdbinit);
-@@ -404,8 +459,7 @@ captured_main (void *data)
- debug_file_directory = relocate_gdb_directory (DEBUGDIR,
- DEBUGDIR_RELOCATABLE);
-
-- gdb_datadir = relocate_gdb_directory (GDB_DATADIR,
-- GDB_DATADIR_RELOCATABLE);
-+ gdb_datadir = relocate_gdb_data_directory ();
-
- #ifdef WITH_PYTHON_PATH
- {