This is a multi-part message in MIME format.
---------------------------------120852368321755
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
To anyone that can help! I've talked to sun to no avail. The following is a copy of
a dbx session that shows the problem that I'm running into. It seems that kvm_open
using the default parameters gives me a hardware error. I'm confused. What am I
doing wrong? Any help would be GREATLY APPRECIATED! This code is just a test to be
integrated with my project when it works. The system that it was run on is a SPARC
20 running Solaris 2.5.
---------------------------------120852368321755
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
1 /*******************************************************************/
2 /* This will be used to test SUN functions for Orakill, clfp/tcncl.*/
3 /*******************************************************************/
4
5
6 #include <stdio.h>
7 #include <errno.h>
8 #include <kvm.h>
9 #include <sys/param.h>
10 #include <sys/time.h>
11 #include <sys/proc.h>
12 #include <fcntl.h>
13
14 int rc, pid;
15 char *namelist, *corefile, *swapfile, *errstr;
16 struct _kvmd *kd;
17 struct proc *ppt;
18
19
20 int main ()
21 {
22
23 namelist = "/dev/ksyms";
24 corefile = "/dev/kmem";
25 swapfile = "/tmp";
26 errstr = "Joe's process";
27
28 kd = kvm_open(namelist, corefile, swapfile, O_RDONLY, errstr);
(dbx) list
29
30 printf("This is the value of errno = %d \n",errno);
31 printf("This is the value of kd = %x \n",kd);
32
33 ppt = kvm_nextproc(kd);
34
35 rc = kvm_close(kd); /* Close the kernel */
36 exit();
37 }
(dbx) stop at 28
(2) stop at "kvm_test.c":28
(dbx) run
Running: a.out
setuid program exec()ed. Reattaching
(process id 23260)
stopped in main at line 28 in file "kvm_test.c"
28 kd = kvm_open(namelist, corefile, swapfile, O_RDONLY, errstr);
(dbx) step
signal BUS (object specific hardware error) in condensed_setup at 0xef793ae8
condensed_setup+0x60: ld [%i4], %o0
Current function is main
28 kd = kvm_open(namelist, corefile, swapfile, O_RDONLY, errstr);
(dbx) print corefile
corefile = 0x20d78 "/dev/kmem"
(dbx) print namelist
namelist = 0x20d6c "/dev/ksyms"
(dbx) print swapfile
swapfile = 0x20d84 "/tmp"
(dbx) print errstr
errstr = 0x20d8c "Joe's process"
(dbx)
---------------------------------120852368321755--