This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] bsd-kvm.c: get exec file name
- From: "Nathan J. Williams" <nathanw at wasabisystems dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: 06 Aug 2004 14:04:36 -0400
- Subject: [RFA] bsd-kvm.c: get exec file name
- Organization: Wasabi Systems, Inc.
This changes bsd_kvm_open() to pass the exec file in use to
kvm_openfiles() rather than NULL, which improves results when you run
"gdb /some/other/kernel" "target kvm kernel.core".
OK to commit?
- Nathan
2004-08-06 Nathan J. Williams <nathanw@wasabisystems.com>
* bsd-kvm.c: Include "gdbcore.h"
(bsd_kvm_open): Delete variable 'execfile'. Pass return value of
get_exec_file() to kvm_openfiles().
Index: bsd-kvm.c
===================================================================
RCS file: /cvs/src/src/gdb/bsd-kvm.c,v
retrieving revision 1.4
diff -u -r1.4 bsd-kvm.c
--- bsd-kvm.c 3 Jul 2004 13:17:33 -0000 1.4
+++ bsd-kvm.c 6 Aug 2004 17:55:46 -0000
@@ -26,6 +26,7 @@
#include "regcache.h"
#include "target.h"
#include "value.h"
+#include "gdbcore.h" /* for get_exec_file */
#include "gdb_assert.h"
#include <fcntl.h>
@@ -55,7 +56,6 @@
bsd_kvm_open (char *filename, int from_tty)
{
char errbuf[_POSIX2_LINE_MAX];
- char *execfile = NULL;
kvm_t *temp_kd;
target_preopen (from_tty);
@@ -73,7 +73,8 @@
}
}
- temp_kd = kvm_openfiles (execfile, filename, NULL, O_RDONLY, errbuf);
+ temp_kd = kvm_openfiles (get_exec_file (0), filename, NULL, O_RDONLY,
+ errbuf);
if (temp_kd == NULL)
error ("%s", errbuf);