Before this patch, this fails:
(gdb) generate-core-file ~/core
Failed to open '~/core' for output.
After the patch:
(gdb) generate-core-file ~/core
Saved corefile ~/core
gdb/
2013-08-08 Azat Khuzhin <a3at.mail@gmail.com> (tiny change)
* gcore.c (create_gcore_bfd): Use tilde_expand.
+2013-08-08 Azat Khuzhin <a3at.mail@gmail.com> (tiny change)
+
+ * gcore.c (create_gcore_bfd): Use tilde_expand.
+
2013-08-08 Yao Qi <yao@codesourcery.com>
* frame.h (read_frame_local): Declare.
#include "regcache.h"
#include "regset.h"
#include "gdb_bfd.h"
+#include "readline/tilde.h"
/* The largest amount of memory to read from the target at once. We
must throttle it to limit the amount of memory used by GDB during
bfd *
create_gcore_bfd (const char *filename)
{
- bfd *obfd = gdb_bfd_openw (filename, default_gcore_target ());
+ char *fullname;
+ bfd *obfd;
+
+ fullname = tilde_expand (filename);
+ obfd = gdb_bfd_openw (fullname, default_gcore_target ());
+ xfree (fullname);
if (!obfd)
error (_("Failed to open '%s' for output."), filename);