Subject: Re: ktrace/kdump fixes to support emulation changes.
To: None <Chris_G_Demetriou@BALVENIE.PDL.CS.CMU.EDU, christos@deshaw.COM>
From: Mike Hibler <mike@cs.utah.edu>
List: tech-kern
Date: 07/19/1995 14:06:29
For HP-UX compat on the hp300 I also just added an option to kdump to
say it was an HP-UX process.  Spitting out an EMUL record is the way to
go, should just need it on exec and "attach".

If you are having fun hacking the ktrace code :-), here is a useful feature
that I added once but it got lost: include the caller PC in the syscall
record.  This is useful if you want to find out, for example, where in your
program that failing "read" is coming from.  Or for emulation, I could use
the address to set a breakpoint after a particular syscall and then single
step to see what it was doing with the values I returned.

Problems: the return address at the time of the syscall is not really what
you want since it most likely tells you that the "read" trap was called from
the "read" syscall stub in libc, you need to back up one more level.
Maybe this whole thing isn't so useful in an enviornment with dynamic shared
libraries since it is harder to correlate the address with a symbol table.
Finally, adding this field changes the size of the syscall record making the
new version incompatible with old ktrace files.

Oh well, just a thought.