Use exec_file_find to prepend gdb_sysroot in follow_exec
This commit updates follow_exec to use exec_file_find to prefix the new executable's filename with gdb_sysroot rather than doing it longhand. gdb/ChangeLog: * infrun.c (solist.h): New include. (follow_exec): Use exec_file_find to prefix execd_pathname with gdb_sysroot.
This commit is contained in:
parent
da7119c99c
commit
ff862be47e
2 changed files with 17 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2015-04-28 Gary Benson <gbenson@redhat.com>
|
||||||
|
|
||||||
|
* infrun.c (solist.h): New include.
|
||||||
|
(follow_exec): Use exec_file_find to prefix execd_pathname
|
||||||
|
with gdb_sysroot.
|
||||||
|
|
||||||
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
|
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
|
||||||
|
|
||||||
* tui/tui-source.c (tui_set_source_content): Avoid calling
|
* tui/tui-source.c (tui_set_source_content): Avoid calling
|
||||||
|
|
18
gdb/infrun.c
18
gdb/infrun.c
|
@ -60,6 +60,7 @@
|
||||||
#include "target-descriptions.h"
|
#include "target-descriptions.h"
|
||||||
#include "target-dcache.h"
|
#include "target-dcache.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#include "solist.h"
|
||||||
|
|
||||||
/* Prototypes for local functions */
|
/* Prototypes for local functions */
|
||||||
|
|
||||||
|
@ -1133,15 +1134,18 @@ follow_exec (ptid_t ptid, char *execd_pathname)
|
||||||
|
|
||||||
breakpoint_init_inferior (inf_execd);
|
breakpoint_init_inferior (inf_execd);
|
||||||
|
|
||||||
if (gdb_sysroot && *gdb_sysroot)
|
if (gdb_sysroot != NULL && *gdb_sysroot != '\0')
|
||||||
{
|
{
|
||||||
char *name = alloca (strlen (gdb_sysroot)
|
int fd = -1;
|
||||||
+ strlen (execd_pathname)
|
char *name;
|
||||||
+ 1);
|
|
||||||
|
|
||||||
strcpy (name, gdb_sysroot);
|
name = exec_file_find (execd_pathname, &fd);
|
||||||
strcat (name, execd_pathname);
|
if (fd >= 0)
|
||||||
execd_pathname = name;
|
close (fd);
|
||||||
|
|
||||||
|
execd_pathname = alloca (strlen (name) + 1);
|
||||||
|
strcpy (execd_pathname, name);
|
||||||
|
xfree (name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset the shared library package. This ensures that we get a
|
/* Reset the shared library package. This ensures that we get a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue