This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path
- From: mbilal <mbilal at codesourcery dot com>
- To: <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>, <jan dot kratochvil at redhat dot com>
- Date: Tue, 7 May 2013 17:43:54 +0500
- Subject: Re: [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path
- References: <51877A32 dot 1030503 at codesourcery dot com> <51877A99 dot 4060503 at codesourcery dot com> <5188AA15 dot 5010904 at codesourcery dot com>
please find updated patch .
I made new 'set_history_filename' function to solve this problem
and thanks Pedro for review this patch.
diff --git a/gdb/top.c b/gdb/top.c
index 480b67e..20aecc9 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -48,6 +48,7 @@
#include "interps.h"
#include "observer.h"
#include "maint.h"
+#include "filenames.h"
/* readline include files. */
#include "readline/readline.h"
@@ -1607,6 +1608,14 @@ set_verbose (char *args, int from_tty, struct
cmd_list_element *c)
}
}
+static void
+set_history_filename (char *args, int from_tty, struct cmd_list_element *c)
+{
+ if (!IS_ABSOLUTE_PATH (*(char **) c->var))
+ *(char **) c->var = concat (current_directory, "/", *(char **) c->var,
+ (char *)NULL);
+}
+
/* Init the history buffer. Note that we are called after the init
file(s)
have been read so that the user can change the history file via his
.gdbinit file (for instance). The GDBHISTFILE environment variable
@@ -1777,7 +1786,7 @@ variable \"HISTSIZE\", or to 256 if this variable
is not set."),
Set the filename in which to record the command history"), _("\
Show the filename in which to record the command history"), _("\
(the list of previous commands of which a record is kept)."),
- NULL,
+ set_history_filename,
show_history_filename,
&sethistlist, &showhistlist);
Thanks,
-Bilal