forked from Imagelibrary/binutils-gdb
Fix set auto-load safe-path false warning regression (PR 16216)
gdb/ 2014-01-07 Jan Kratochvil <jan.kratochvil@redhat.com> PR threads/16216 * linux-thread-db.c (try_thread_db_load): Add parameter check_auto_load_safe. Move here the file_is_auto_load_safe call. (try_thread_db_load_from_pdir_1): Move it there from here. (try_thread_db_load_from_sdir): Update caller. (try_thread_db_load_from_dir): Move it there from here.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2014-01-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
PR threads/16216
|
||||||
|
* linux-thread-db.c (try_thread_db_load): Add parameter
|
||||||
|
check_auto_load_safe. Move here the file_is_auto_load_safe call.
|
||||||
|
(try_thread_db_load_from_pdir_1): Move it there from here.
|
||||||
|
(try_thread_db_load_from_sdir): Update caller.
|
||||||
|
(try_thread_db_load_from_dir): Move it there from here.
|
||||||
|
|
||||||
2014-01-08 Joel Brobecker <brobecker@adacore.com>
|
2014-01-08 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* version.in: Set GDB version number to 7.6.90.DATE-cvs.
|
* version.in: Set GDB version number to 7.6.90.DATE-cvs.
|
||||||
|
|||||||
@@ -838,7 +838,7 @@ try_thread_db_load_1 (struct thread_db_info *info)
|
|||||||
relative, or just LIBTHREAD_DB. */
|
relative, or just LIBTHREAD_DB. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
try_thread_db_load (const char *library)
|
try_thread_db_load (const char *library, int check_auto_load_safe)
|
||||||
{
|
{
|
||||||
void *handle;
|
void *handle;
|
||||||
struct thread_db_info *info;
|
struct thread_db_info *info;
|
||||||
@@ -846,6 +846,25 @@ try_thread_db_load (const char *library)
|
|||||||
if (libthread_db_debug)
|
if (libthread_db_debug)
|
||||||
printf_unfiltered (_("Trying host libthread_db library: %s.\n"),
|
printf_unfiltered (_("Trying host libthread_db library: %s.\n"),
|
||||||
library);
|
library);
|
||||||
|
|
||||||
|
if (check_auto_load_safe)
|
||||||
|
{
|
||||||
|
if (access (library, R_OK) != 0)
|
||||||
|
{
|
||||||
|
/* Do not print warnings by file_is_auto_load_safe if the library does
|
||||||
|
not exist at this place. */
|
||||||
|
if (libthread_db_debug)
|
||||||
|
printf_unfiltered (_("open failed: %s.\n"), safe_strerror (errno));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!file_is_auto_load_safe (library, _("auto-load: Loading libthread-db "
|
||||||
|
"library \"%s\" from explicit "
|
||||||
|
"directory.\n"),
|
||||||
|
library))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
handle = dlopen (library, RTLD_NOW);
|
handle = dlopen (library, RTLD_NOW);
|
||||||
if (handle == NULL)
|
if (handle == NULL)
|
||||||
{
|
{
|
||||||
@@ -919,12 +938,7 @@ try_thread_db_load_from_pdir_1 (struct objfile *obj, const char *subdir)
|
|||||||
}
|
}
|
||||||
strcat (cp, LIBTHREAD_DB_SO);
|
strcat (cp, LIBTHREAD_DB_SO);
|
||||||
|
|
||||||
if (!file_is_auto_load_safe (path, _("auto-load: Loading libthread-db "
|
result = try_thread_db_load (path, 1);
|
||||||
"library \"%s\" from $pdir.\n"),
|
|
||||||
path))
|
|
||||||
result = 0;
|
|
||||||
else
|
|
||||||
result = try_thread_db_load (path);
|
|
||||||
|
|
||||||
do_cleanups (cleanup);
|
do_cleanups (cleanup);
|
||||||
return result;
|
return result;
|
||||||
@@ -970,7 +984,7 @@ try_thread_db_load_from_pdir (const char *subdir)
|
|||||||
static int
|
static int
|
||||||
try_thread_db_load_from_sdir (void)
|
try_thread_db_load_from_sdir (void)
|
||||||
{
|
{
|
||||||
return try_thread_db_load (LIBTHREAD_DB_SO);
|
return try_thread_db_load (LIBTHREAD_DB_SO, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to load libthread_db from directory DIR of length DIR_LEN.
|
/* Try to load libthread_db from directory DIR of length DIR_LEN.
|
||||||
@@ -993,13 +1007,7 @@ try_thread_db_load_from_dir (const char *dir, size_t dir_len)
|
|||||||
path[dir_len] = '/';
|
path[dir_len] = '/';
|
||||||
strcpy (path + dir_len + 1, LIBTHREAD_DB_SO);
|
strcpy (path + dir_len + 1, LIBTHREAD_DB_SO);
|
||||||
|
|
||||||
if (!file_is_auto_load_safe (path, _("auto-load: Loading libthread-db "
|
result = try_thread_db_load (path, 1);
|
||||||
"library \"%s\" from explicit "
|
|
||||||
"directory.\n"),
|
|
||||||
path))
|
|
||||||
result = 0;
|
|
||||||
else
|
|
||||||
result = try_thread_db_load (path);
|
|
||||||
|
|
||||||
do_cleanups (cleanup);
|
do_cleanups (cleanup);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user