Page MenuHomePhabricator

[JITLoaderGDB] Pack the jit entry struct according to the target arch.

Authored by sivachandra on Mar 21 2016, 2:26 PM.

Diff Detail

Event Timeline

sivachandra retitled this revision from to [JITLoaderGDB] Pack the jit entry struct according to the target arch..
sivachandra updated this object.
sivachandra added a reviewer: clayborg.

This fixes an issue we are seeing with i386 JIT entry handling.

I have chosen a least disruptive change. However, since alignment is actually determined by the ABI, one could add some API to the ABI interface to determine the packing. However, it seemed like an overkill for doing something special only for i386.

clayborg accepted this revision.Mar 21 2016, 2:32 PM
clayborg edited edge metadata.

Looks fine. One other alternative is to get the type from the program if it exists in the debug info and explore the struct using ValueObject. This would get you out of the fixed alignment issue by using the debug info to get the info. If the debug info is missing, you can always fall back to this code. I will leave that up to you.

This revision is now accepted and ready to land.Mar 21 2016, 2:32 PM
sivachandra edited edge metadata.

Explicitly set the alignment of the size field in the unpacked struct
to 8 bytes. This should take care of the case where in the host is i386
and the target is arm (for example).

Thanks for the quick review.
I will put this in for now. Will revisit if a need for an elaborate solution arises.

sivachandra closed this revision.Mar 21 2016, 5:40 PM