On 8/26/13 4:34 PM, Konstantin Tokarev wrote:
>
> 26.08.2013, 19:18, "Paolo Piselli" <ppise...@csail.mit.edu>:
>> Hi, I'm working on a Valgrind tool targeting 32-bit guests that up to
>> this point we have been running on 32-bit hosts.  I would like to also
>> be able to compile to target 32-bit guest on 64-bit host.  So far, the
>> largest difference that I have found is described in the comments of
>> "doHelperCall" in host_amd64_isel.c:
>>
>> "This function only deals with a tiny set of possibilities, which cover
>> all helpers in practice.  The restrictions are that only arguments in
>> registers are supported, hence only 6x64 integer bits in total can be
>> passed.  In fact the only supported arg type is I64."
>>
>> With this constraint in place, I was wondering if there were any
>> particular best-practices for cross platform tool development.  For
>> instance, we could promote all parameters for all tool callbacks to
>> 64-bit across all platforms to keep the code clean and uniform, or we
>> could maintain parallel platform-specific callback compilation units
>> that must be manually kept consistent across feature changes and bug
>> fixes, or we could throw a bunch of #ifdefs in the source to change the
>> function signatures and IExpr marshaling depending on platform.
>>
>> Any thoughts are appreciated!
> Why not just use 32-bit build of valgrind instead?
>

I have two concerns:

1. I am working on an analysis tool that can be quite memory intensive.  
I would ultimately like to be able to compile on 64-bit in order to 
perform analysis on larger inputs.

2. I have been going over the file 
"docs/internals/multiple-architectures.txt" and it is not clear how to 
force usage of the 32-bit build on dual-arch systems.  From what I 
gather from this doc, the launcher is always built 64-bit on a dual-arch 
system, and the host libraries to use are determined by the nature of 
the guest executable.  I am referring to this section specifically:

"The launcher program (ie the valgrind binary itself) is always built
as a program for the primary target (so a 64 bit program on amd64 and
ppc64) but will peek at the program which it is being asked to run and
decide which of the possible tools to run taking both the requested
tool and the format of the program being run into account."

If this is the case, then how is it possible to, on a 64-bit platform, 
tell valgrind to run as a 32-bit host even when executing a 64-bit 
guest?  Is the only way to do this to force a single-arch 32-bit build?

-Paolo


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to