[panda-users] Obtaining LLVM bitcode from PANDA plugin

Whelan, Ryan - 0559 - MITLL rwhelan at ll.mit.edu
Wed Feb 18 10:40:12 EST 2015


You can also check out the llvm_trace plugin, which also includes all
important QEMU helper functions.  There's a chance it's in a state of
disrepair since I haven't used it in a while, but definitely worth a try.

If you're interested in translation, that occurs (thanks to S2E) in
qemu/tcg/tcg-llvm.cpp.

-Ryan

From:  frank adkins <brisngrfreak at hotmail.com>
Date:  Wednesday, February 18, 2015 at 10:06 AM
To:  "Federico \"fox\" Scrinzi" <fox91 at anche.no>, "panda-users at mit.edu"
<panda-users at mit.edu>
Subject:  Re: [panda-users] Obtaining LLVM bitcode from PANDA plugin

Hi Federico! 
As far as I know, if you're just looking for a string representation then
I've used the following:

1. to dump the IR straight to stdout:
      tb->llvm_function->dump()
2. to do something more precise with it:
      std::string some_string;
      llvm::raw_string_ostream fcn_string(some_string);
      auto current_func = tb->llvm_function;
      fcn_string << *current_func;
      std::cout << fcn_string.str() << std::endl; // whatever you want with
a string representation

Both 1. and 2. require #include "llvm/IR/Function.h", while 2. also requires
#include "llvm/Support/raw_ostream.h".

If you're looking for something else, then there are a number of different
ostreams in that family that might suit your needs.

Hope that helps!
-Frank
 
Date: Tue, 17 Feb 2015 17:25:58 +0100
From: fox91 at anche.no
To: panda-users at mit.edu
Subject: [panda-users] Obtaining LLVM bitcode from PANDA plugin

Hi!
I would like to know if there is some code I can look at or maybe some
documentation about the translation from TCG to LLVM IR. My goal is to
basically dump the code that is executed for some specific basic blocks
from a plugin for later doing further analysis.
 
 
Cheers,
Federico
 
-- 
f.
 
https://github.com/volpino
 

_______________________________________________ panda-users mailing list
panda-users at mit.edu http://mailman.mit.edu/mailman/listinfo/panda-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/mailman/private/panda-users/attachments/20150218/ba38094e/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5213 bytes
Desc: not available
Url : http://mailman.mit.edu/mailman/private/panda-users/attachments/20150218/ba38094e/attachment.bin


More information about the panda-users mailing list