Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] bsd-kvm.c: get exec file name
@ 2004-08-06 18:13 Nathan J. Williams
  2004-08-06 21:13 ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan J. Williams @ 2004-08-06 18:13 UTC (permalink / raw)
  To: gdb-patches


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);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] bsd-kvm.c: get exec file name
  2004-08-06 18:13 [RFA] bsd-kvm.c: get exec file name Nathan J. Williams
@ 2004-08-06 21:13 ` Mark Kettenis
  2004-08-07 21:25   ` Nathan J. Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2004-08-06 21:13 UTC (permalink / raw)
  To: nathanw; +Cc: gdb-patches

   From: "Nathan J. Williams" <nathanw@wasabisystems.com>
   Date: 06 Aug 2004 14:04:36 -0400


   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".

   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().

   OK to commit?

OK, although I'd prefer to keep using the variable execfile instead of
wrapping the kvm_openfiles call:

  execfile = get_exec_file (0);
  temp_kd = kvm_openfiles (execfile, filename, NULL, O_RDONLY, errbuf);

Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] bsd-kvm.c: get exec file name
  2004-08-06 21:13 ` Mark Kettenis
@ 2004-08-07 21:25   ` Nathan J. Williams
  0 siblings, 0 replies; 3+ messages in thread
From: Nathan J. Williams @ 2004-08-07 21:25 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

Mark Kettenis <kettenis@chello.nl> writes:

> OK, although I'd prefer to keep using the variable execfile instead of
> wrapping the kvm_openfiles call:
> 
>   execfile = get_exec_file (0);
>   temp_kd = kvm_openfiles (execfile, filename, NULL, O_RDONLY, errbuf);

Sure. Committed as follows:

2004-08-07  Nathan J. Williams  <nathanw@wasabisystems.com>

	* bsd-kvm.c: Include "gdbcore.h"
	(bsd_kvm_open): Use get_exec_file() to set 'execfile'.


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	7 Aug 2004 21:21:49 -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>
@@ -73,6 +74,7 @@
 	}
     }
 
+  execfile = get_exec_file (0);
   temp_kd = kvm_openfiles (execfile, filename, NULL, O_RDONLY, errbuf);
   if (temp_kd == NULL)
     error ("%s", errbuf);


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-08-07 21:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-06 18:13 [RFA] bsd-kvm.c: get exec file name Nathan J. Williams
2004-08-06 21:13 ` Mark Kettenis
2004-08-07 21:25   ` Nathan J. Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox