Thank you , James. But this way needs to determine whether the instruction is a LOAD/STORE ,and if I want to preserve the operations on these variables for further dynamic symbolic execution usage(just like KLEE ,but it's a static analysis ,not dynamic),I had to backtrace instructions ,this may be not very efficient if the operation is very complex! -Jin Huang 2014/1/3 Jin Huang <54jin.huang at gmail.com>> Thank You ! John and Swarup. I have already downloaded the code! > > > > > 2014/1/3 Sahoo, Swarup Kumar <ssahoo2 at illinois.edu> > > Hi Jin Huang, >> >> The updated Giri code is available at https://github.com/liuml07/giri<https://github.com/liuml07/giri.>. >> This will give you an idea of how to instrument the program to trace >> different values. You can modify the code to achieve your goals. >> >> -Swarup. >> >> ------------------------------ >> *From:* Criswell, John T >> *Sent:* Thursday, January 02, 2014 2:12 PM >> *To:* Jin Huang; llvmdev at cs.uiuc.edu; Sahoo, Swarup Kumar >> *Subject:* Re: [LLVMdev] Tracing values in llvm IR >> >> On 1/1/14 11:39 PM, Jin Huang wrote: >> >> Hi, everyone. >> >> I want to writing a Pass to get the variable value while the program is >> running ,the basic idea is to insert an STL map in the program ,and get >> every value and address a program use ,but whether it's possible to do this >> by transforming the llvm IR? >> >> I didn't find any useful functions to get a variable's address in LLVM >> IR .It seems that the IR is an SSA form and we can not get a value's >> address in compiling time.Is that right? But how can I dynamically get the >> variable's value in run time by writing a Pass ? >> >> >> The giri project does dynamic tracing of values stored to and loaded from >> memory. It stores the trace of memory accesses on disk because they get >> very large very quickly. You can either reuse the Giri code or modify it >> to suit your purposes. >> >> Swarup, is there a place where people can download the updated Giri code >> that your Google Summer of Code student worked on? >> >> -- John T. >> >> >> >> _______________________________________________ >> LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140103/65722b63/attachment.html>
Thank you,Micah. This way sounds good, Do you mean writing a function to trace the value and insert a callinst to call this function in the entry of the program ? How can I insert a function writing by myself? Is there any code examples? -Jin Huang 2014/1/3 Jin Huang <54jin.huang at gmail.com>> Thank you , James. > > But this way needs to determine whether the instruction is a LOAD/STORE > ,and if I want to preserve the operations on these variables for further > dynamic symbolic execution usage(just like KLEE ,but it's a static analysis > ,not dynamic),I had to backtrace instructions ,this may be not very > efficient if the operation is very complex! > > -Jin Huang > > > 2014/1/3 Jin Huang <54jin.huang at gmail.com> > >> Thank You ! John and Swarup. I have already downloaded the code! >> >> >> >> >> 2014/1/3 Sahoo, Swarup Kumar <ssahoo2 at illinois.edu> >> >> Hi Jin Huang, >>> >>> The updated Giri code is available at https://github.com/liuml07/giri<https://github.com/liuml07/giri.>. >>> This will give you an idea of how to instrument the program to trace >>> different values. You can modify the code to achieve your goals. >>> >>> -Swarup. >>> >>> ------------------------------ >>> *From:* Criswell, John T >>> *Sent:* Thursday, January 02, 2014 2:12 PM >>> *To:* Jin Huang; llvmdev at cs.uiuc.edu; Sahoo, Swarup Kumar >>> *Subject:* Re: [LLVMdev] Tracing values in llvm IR >>> >>> On 1/1/14 11:39 PM, Jin Huang wrote: >>> >>> Hi, everyone. >>> >>> I want to writing a Pass to get the variable value while the program >>> is running ,the basic idea is to insert an STL map in the program ,and get >>> every value and address a program use ,but whether it's possible to do this >>> by transforming the llvm IR? >>> >>> I didn't find any useful functions to get a variable's address in LLVM >>> IR .It seems that the IR is an SSA form and we can not get a value's >>> address in compiling time.Is that right? But how can I dynamically get the >>> variable's value in run time by writing a Pass ? >>> >>> >>> The giri project does dynamic tracing of values stored to and loaded >>> from memory. It stores the trace of memory accesses on disk because they >>> get very large very quickly. You can either reuse the Giri code or modify >>> it to suit your purposes. >>> >>> Swarup, is there a place where people can download the updated Giri code >>> that your Google Summer of Code student worked on? >>> >>> -- John T. >>> >>> >>> >>> _______________________________________________ >>> LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >>> >>> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140103/ef0ed73e/attachment.html>
You will have to insert callinst to tracing functions immediately after the value is produced, not at the entry points. Giri code has many such examples of how to do this. Thanks, Swarup. ________________________________ From: llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] on behalf of Jin Huang [54jin.huang at gmail.com] Sent: Thursday, January 02, 2014 9:47 PM To: llvmdev at cs.uiuc.edu; micah.villmow at smachines.com Subject: Re: [LLVMdev] Tracing values in llvm IR Thank you,Micah. This way sounds good, Do you mean writing a function to trace the value and insert a callinst to call this function in the entry of the program ? How can I insert a function writing by myself? Is there any code examples? -Jin Huang 2014/1/3 Jin Huang <54jin.huang at gmail.com<mailto:54jin.huang at gmail.com>> Thank you , James. But this way needs to determine whether the instruction is a LOAD/STORE ,and if I want to preserve the operations on these variables for further dynamic symbolic execution usage(just like KLEE ,but it's a static analysis ,not dynamic),I had to backtrace instructions ,this may be not very efficient if the operation is very complex! -Jin Huang 2014/1/3 Jin Huang <54jin.huang at gmail.com<mailto:54jin.huang at gmail.com>> Thank You ! John and Swarup. I have already downloaded the code! 2014/1/3 Sahoo, Swarup Kumar <ssahoo2 at illinois.edu<mailto:ssahoo2 at illinois.edu>> Hi Jin Huang, The updated Giri code is available at https://github.com/liuml07/giri<https://github.com/liuml07/giri.>. This will give you an idea of how to instrument the program to trace different values. You can modify the code to achieve your goals. -Swarup. ________________________________ From: Criswell, John T Sent: Thursday, January 02, 2014 2:12 PM To: Jin Huang; llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu>; Sahoo, Swarup Kumar Subject: Re: [LLVMdev] Tracing values in llvm IR On 1/1/14 11:39 PM, Jin Huang wrote: Hi, everyone. I want to writing a Pass to get the variable value while the program is running ,the basic idea is to insert an STL map in the program ,and get every value and address a program use ,but whether it's possible to do this by transforming the llvm IR? I didn't find any useful functions to get a variable's address in LLVM IR .It seems that the IR is an SSA form and we can not get a value's address in compiling time.Is that right? But how can I dynamically get the variable's value in run time by writing a Pass ? The giri project does dynamic tracing of values stored to and loaded from memory. It stores the trace of memory accesses on disk because they get very large very quickly. You can either reuse the Giri code or modify it to suit your purposes. Swarup, is there a place where people can download the updated Giri code that your Google Summer of Code student worked on? -- John T. _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140103/17404eb1/attachment.html>