mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
Fix logic in exec_file_locate_attach
This commit fixes an error in exec_file_locate_attach where the main executable could be loaded from outside the sysroot if a nonempty, non-"target:" sysroot was set but the discovered executable filename did not exist in that sysroot and did exist on the main filesystem. gdb/ChangeLog: * exec.c (exec_file_locate_attach): Do not attempt to locate main executable locally if not found in sysroot. gdb/testsuite/ChangeLog: * gdb.base/attach-pie-noexec.exp: Do not expect an error message on attach.
This commit is contained in:
@ -156,9 +156,12 @@ exec_file_locate_attach (int pid, int from_tty)
|
||||
/* If gdb_sysroot is not empty and the discovered filename
|
||||
is absolute then prefix the filename with gdb_sysroot. */
|
||||
if (*gdb_sysroot != '\0' && IS_ABSOLUTE_PATH (exec_file))
|
||||
full_exec_path = exec_file_find (exec_file, NULL);
|
||||
|
||||
if (full_exec_path == NULL)
|
||||
{
|
||||
full_exec_path = exec_file_find (exec_file, NULL);
|
||||
if (full_exec_path == NULL)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's possible we don't have a full path, but rather just a
|
||||
filename. Some targets, such as HP-UX, don't provide the
|
||||
|
Reference in New Issue
Block a user