Ability to tell the difference between normal and syscall traps
John Baldwin
jhb at FreeBSD.org
Fri May 14 11:53:22 UTC 2010
Ali Polatel wrote:
> Kostik Belousov yazmış:
>> On Mon, May 10, 2010 at 07:48:47PM +0300, Ali Polatel wrote:
>>> Another question is how hard is it to implement PL_EVENT_EXEC?
>>> This could be useful for truss as it updates the execution type of the
>>> process after successful execve() calls afaict.
>> Is this needed ? The question is not rhetorical, I am trying to
>> understand what prevents use of PT_TO_SCE and checking the syscall
>> number ? You would screen for SYS_execve or SYS_fexecve and
>> reset the debugger state on SIGTRAP that is supplied to the debugger
>> before first instruction of new image is executed.
>>
>
> Not really needed, just cleaner imo. As system call numbers may be
> different for different execution types and you need to look it up from
> a table using a string as argument which is slow.
I agree that this would be cleaner. Having worked on the ptrace/procfs
stuff in other tools like strace and truss, exec truly is an important
event to a debugger aside from just being another system call as it
signals that the address space has been changed.
--
John Baldwin
More information about the freebsd-hackers
mailing list