Re: [fusil] [PATCH] itrace tool

[ Thread Index | Date Index | More lists.tuxfamily.org/fusil Archives ]


Hi,

Le Monday 26 January 2009 22:14:35 Mark Seaborn, vous avez écrit :
> python-ptrace is a useful library - thanks for writing it!

You're welcome.

> Here is a tool which I have been using to debug libc startup code
> where I didn't find gdb very helpful.

Wow. Are you debugging the libc??

> It single steps the process and prints each instruction pointer address.  
> To go faster, it allows a number of syscalls to run before 
> starting single-stepping. 

With no option, your script "skip" all syscalls (just print a counter). Is it 
the expected behaviour?

I don't think that this script would be reused by anyone else, but who knows? 
So I pushed it into examples/itrace.py with your email as the documentation.

> It's possible to pipe the addresses through addr2line to get a very
> simple tracing debugger. :-)

Yeah, but it would be easier to integrate addr2line (or anything else) 
directly into python-ptrace. A friend told me that he wrote an ELF parser in 
Python. We can maybe reuse it... or libbfd, or elfsh, or ...

I'm prefer to work on Fusil than on python-ptrace. Current status of 
python-ptrace is enough for my fuzzer requires. If a need more informations, 
I use gdb.

> I couldn't see a way to catch syscalls and single step at the same
> time.  As a consequence the tool can't handle multiple threads.

I don't know ptrace internals very well, and it looks like ptrace have only a 
few documentation...

---

Note about itrace.py: it's a little strange to reuse the strace.py *program* 
(instead of a Python *library*). But it works, so, it's ok ;-)

-- 
Victor Stinner aka haypo
http://www.haypocalc.com/blog/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/