Path to executable of current process?



Hello,

I'm looking for an example that uses kvm_getargv but from just
googling around I can't seem to find an example. Can someone give me a
pointer?

Actually what I'm *really* trying to do is port some code that invokes
GDB to do a backtrace and I need to give GDB the path to the
executable of the current process (e.g. on linux this is
/proc/<pid>/exe) and the pid of the process to trace (easy - getpid).
The first argument is trickey since FreeBSD frequently does not have a
/proc filesystem. So it seems kvm_getargv should have this path no?

Mike
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Panic on CURRENT
    ... GNU gdb 6.1.1 ... page fault while in kernel mode ... instruction pointer = 0x20:0xc0716dd2 ... frame pointer = 0x28:0xf8d80bc4 ...
    (freebsd-current)
  • Re: Shellcode itself segfaults
    ... a pointer to the string '/bin/sh' in the ... ebx register, a pointer to a pointer to char, however this ... You have an option to go with a managed service or an enterprise software. ...
    (Pen-Test)
  • Re: kernel problem
    ... > i have done a kgdb on the dumps it gave out here is the output ... > Unread portion of the kernel message buffer: ... GNU gdb 6.1.1 ... instruction pointer = 0x20:0xc08badd7 ...
    (freebsd-stable)
  • Re: Format of Pointers in Unix
    ... >>All unixes I've seen use a flat memory model for user space applications. ... Pointer Test Code. ... GDB is free software, covered by the GNU General Public License, and you are ... FreeBSD does use a segmented memory model of some sort. ...
    (comp.lang.c)
  • Re: Format of Pointers in Unix
    ... >>All unixes I've seen use a flat memory model for user space applications. ... Pointer Test Code. ... GDB is free software, covered by the GNU General Public License, and you are ... FreeBSD does use a segmented memory model of some sort. ...
    (comp.unix.programmer)