On 24/03/14 09:37, Subhashish Pradhan wrote:

> 1 - It was mentioned "it may well be that no memory is read/written,
> but you'd have to look at the kernel and see what that ioctl does to
> be sure." Does it mean using strace or looking at kernel logs using
> dmesg?

It means reading the kernel source to see what that ioctl does and what 
memory it accesses.

> 2 - These ARG1, ARG2 and ARG3 in that source - what's their relation
> to the syscall that's being wrapped?

They are the system call arguments.

> 3 - The PRINT(), PRE_MEM_READ(), PRE_REG_READ(), POST_MEM_WRITE  -
> where in the source is their definition? I need to understand what
> they do - I get the context that they are the read/write primitives of
> valgrind or am I wrong here?

Well PRINT prints a message and the others tell valgrind what registers 
and/or memory the system call is going to read/write so that it can 
check that things that will be read are initialised, and mark things 
which are written as initialised.

> 4 - I would be  porting valgrind to GNUMach based Hurd - so I'd have
> to handle RPCs there, so basically I'd need to implement
> syswrap-platform.c, and maybe syscall-platform.S, am I right?

Porting valgrind to a new platform is a major undertaking so you really 
need to start by reading the code carefully and understanding it all 
works. If you try and understand it by asking questions about every 
little detail here it will be very painful...

> 5 - What's the speciality about the syscall-platform.S - why's it so
> "magical" as referred in syswrap-main.c?

Because it has to understand exactly how a system call happens on the 
platform, how to setup the arguments and make the call and collect the 
result, all the while making any registers which may be trampled on are 
saved, that the signal state is manipulated correctly and so on.

All that should have been pretty obvious from reading one of them 
though, which is exactly what I just had to do to answer your question, 
as they have lots of comments in explaining what is going on.

Tom

-- 
Tom Hughes (t...@compton.nu)
http://compton.nu/

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to