<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6665402724213797607</id><updated>2011-09-28T15:24:08.761-07:00</updated><category term='search'/><category term='Vm'/><category term='visualization'/><category term='cfg'/><category term='Sun'/><category term='0 matches'/><category term='graphviz'/><category term='dot files'/><category term='soot'/><category term='Eclipse'/><title type='text'>framepointer</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6665402724213797607.post-3834340407025100245</id><published>2010-12-30T09:24:00.000-08:00</published><updated>2010-12-30T10:39:48.476-08:00</updated><title type='text'>Adding Options to control LLVM CodeGen</title><content type='html'>This post shows how to add a command line option to &lt;i&gt;clang &lt;/i&gt; which can be used to gate code in LLVM CodeGen. It took me a while, using gdb and grep, to figure out how this can be done.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The details : I wanted to add an option &lt;i&gt;-random-stack-layout &lt;/i&gt;which&lt;i&gt; &lt;/i&gt;would set a global option variable that&lt;i&gt; &lt;/i&gt;I could read to turn on/off my stack layout randomization code in PrologEpilogInserter.cpp.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Before I talk about the changes, let me give you a quick introduction to how &lt;i&gt;clang&lt;/i&gt; works. clang can work in the 'driver' mode and in the 'cc1' mode. The following command-line output, generated using the &lt;i&gt;-v&lt;/i&gt; option,  shows how this works.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;km:~/projects/llvm-obj/Debug$&lt;b&gt;&lt;i&gt; ./bin/clang  -v  ~/test/llvm/stack.c -o st&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;clang version 2.8 (tags/RELEASE_28)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Target: i386-pc-linux-gnu&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Thread model: posix&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;"/home/km/projects/llvm-obj/Debug/bin/&lt;i&gt;clang&lt;/i&gt;" &lt;i&gt;-cc1&lt;/i&gt;&lt;/b&gt; -triple i386-pc-linux-gnu -S          -disable-free -disable-llvm-verifier -main-file-name stack.c -mrelocation-model static -                mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4 -target-linker-version                    2.20.1 -v -resource-dir /home/km/projects/llvm-obj/Debug/lib/clang/2.8 -ferror-limit              19 -fmessage-length 237 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o              /tmp/cc-uTVPpH.s -x c /home/km/test/llvm/stack.c&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;clang -cc1 version 2.8 based upon llvm 2.8 hosted on i386-pc-linux-gnu&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;............&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;.............&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;"/usr/bin/as" --32 -o /tmp/cc-cFqgsc.o /tmp/cc-uTVPpH.s&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;"/usr/bin/gcc" -v -m32 -o st /tmp/cc-cFqgsc.o&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;when &lt;i&gt;clang&lt;/i&gt; is invoked in the driver mode it invokes itself again with a list of arguments. The &lt;i&gt;-cc1&lt;/i&gt; is the argument that makes it behave like a compiler. This makes &lt;i&gt;clang&lt;/i&gt; produce a .s file from the input .c file and then &lt;i&gt;as&lt;/i&gt;, and &lt;i&gt;gcc&lt;/i&gt; are invoked to produce the final executable (&lt;i&gt;st&lt;/i&gt; in this example)&lt;i&gt;.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note how the -v option is passed to &lt;i&gt;gcc&lt;/i&gt; also. This is because -v is parsed and interpreted by the driver-mode &lt;i&gt;clang&lt;/i&gt;. To avoid this behavior, the -Xclang switch can be used to send arguments to only cc1-mode &lt;i&gt;clang&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following changes illustrate the necessary changes to add an option that can be passed in with the -Xclang switch  :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Edit  &lt;i&gt;/llvm/tools/clang/include/clang/Driver/CC1Options.td&lt;/i&gt; to add your option string under the appropriate section. In my case, I wanted to add a CodeGen option so I added the following line under the CodeGen options section.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;          def random_stack_layout : Flag&lt;"-random-stack-layout"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;              HelpText&lt;"Enables stack layout randomization"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;          The LLVM build infrastructure generates a &lt;i&gt;clang/Driver/Options.inc&lt;/i&gt; out of this and                   includes it in /llvm/tools/clang/include/clang/Driver/Options.h. Here, the option we                 added gets translated to OPT_ random_stack_layout. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The option variable to set/unset is&lt;i&gt; &lt;span class="Apple-tab-span" style="white-space: pre; "&gt;m&lt;/span&gt;ulticompiler::RandomStackLayout. &lt;/i&gt;It is an unsigned integer that is declared in&lt;i&gt;/llvm/include/llvm/MultiCompiler/MultiCompilerOptions.h&lt;/i&gt;,&lt;i&gt; &lt;/i&gt;and is defined in&lt;i&gt;/llvm/lib/CodeGen/MultiCompilerOptions.cpp&lt;/i&gt; that gets compiled into the CodeGen library.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The OPT_ random_stack_layout flag can be checked in the ParseCodeGenArgs() method in  &lt;i&gt;/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small; "&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;#include "llvm/MultiCompiler/MultiCompilerOptions.h"&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;..........&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;...........&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;static void ParseCodeGenArgs( ...) {&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"&gt;    &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;.........&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"&gt;    &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;......... &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"&gt;     &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;i&gt;&lt;b&gt;multicompiler::RandomStackLayout = Args.hasArg(OPT_random_stack_layout);&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;.&lt;/span&gt;.........&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The &lt;i&gt;R&lt;/i&gt;&lt;span class="Apple-style-span" style="white-space: pre; font-size: medium; "&gt;&lt;i&gt;andomStackLayout&lt;/i&gt; variable can now be accessed in any CodeGen file by including the MultiCompilerOptions.h header file. &lt;/span&gt;The option can be specified in the command line as shown below&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;./bin/clang  -Xclang -random-stack-layout  ~/test/llvm/stack.c -o st&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6665402724213797607-3834340407025100245?l=framepointer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/3834340407025100245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6665402724213797607&amp;postID=3834340407025100245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/3834340407025100245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/3834340407025100245'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/2010/12/adding-options-to-control-llvm-codegen.html' title='Adding Options to control LLVM CodeGen'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6665402724213797607.post-1718786163427975390</id><published>2010-09-10T12:24:00.000-07:00</published><updated>2010-09-10T12:27:56.111-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dot files'/><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='graphviz'/><category scheme='http://www.blogger.com/atom/ns#' term='soot'/><category scheme='http://www.blogger.com/atom/ns#' term='cfg'/><title type='text'>Visualizing Soot graphs</title><content type='html'>Notes on visualizing Soot CFGs:&lt;br /&gt;&lt;br /&gt;Run Soot with appropriate dump options. e.g.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;-pp &lt;b&gt;-dump-cfg jap.sjenvanalyse&lt;/b&gt; -p jap.sjenvanalyse enabled:true -p tag.sjenvaggregator enabled:true -cp /home/karthik/projects/sjenv/bin test.basic.CFG&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;for the command line shown above, the generated .dot file can be found in the sub folders of sootOutput/test.basic.CFG&lt;br /&gt;&lt;br /&gt;to generate a pdf out of the .dot file using graphviz , use&lt;br /&gt;&lt;br /&gt;&lt;i&gt;dot jap.sjenvanalyse-BriefUnitGraph-0.dot &lt;/i&gt;&lt;b&gt;&lt;i&gt;-T pdf -o whiledo.pdf&lt;/i&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6665402724213797607-1718786163427975390?l=framepointer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/1718786163427975390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6665402724213797607&amp;postID=1718786163427975390' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/1718786163427975390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/1718786163427975390'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/2010/09/visualizing-soot-graphs.html' title='Visualizing Soot graphs'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6665402724213797607.post-8486164889861141099</id><published>2007-12-27T11:03:00.001-08:00</published><updated>2007-12-27T11:12:45.537-08:00</updated><title type='text'>Scroll wheel issue in Ubuntu guest on Vmware Fusion</title><content type='html'>The scroll wheel on my Logitech USB mouse was not working in the Ubuntu 7.10 guest running on VMware Fusion.&lt;br /&gt;&lt;br /&gt;Fix: change the driver in the mouse section of /etc/X11/xorg.conf from ps/2 to imps/2&lt;br /&gt;&lt;br /&gt;Ref : http://communities.vmware.com/message/780209&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6665402724213797607-8486164889861141099?l=framepointer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/8486164889861141099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6665402724213797607&amp;postID=8486164889861141099' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/8486164889861141099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/8486164889861141099'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/2007/12/scroll-wheel-issue-in-ubuntu-guest-on_27.html' title='Scroll wheel issue in Ubuntu guest on Vmware Fusion'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6665402724213797607.post-6563857528931369246</id><published>2007-09-05T15:39:00.000-07:00</published><updated>2007-09-05T15:40:13.766-07:00</updated><title type='text'>uid and gid</title><content type='html'>use the &lt;span style="font-style: italic;"&gt;id&lt;/span&gt; command to find out the uid and the gid of a user.&lt;br /&gt;   example:&lt;br /&gt;&lt;br /&gt;   % id root&lt;br /&gt;   uid=0(root) gid=0(root) groups=0(root)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6665402724213797607-6563857528931369246?l=framepointer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/6563857528931369246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6665402724213797607&amp;postID=6563857528931369246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/6563857528931369246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/6563857528931369246'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/2007/09/uid-and-gid.html' title='uid and gid'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6665402724213797607.post-8641223693875158558</id><published>2007-06-29T14:43:00.000-07:00</published><updated>2008-01-31T14:56:39.830-08:00</updated><title type='text'>Printing code at a PC value in gdb</title><content type='html'>&lt;span style="font-weight: bold;"&gt; x /i $pc&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Then you can &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;si&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;to continue stepping, along with a display of the instruction corresponding to the PC &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6665402724213797607-8641223693875158558?l=framepointer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/8641223693875158558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6665402724213797607&amp;postID=8641223693875158558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/8641223693875158558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/8641223693875158558'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/2007/06/printing-code-at-pc-value.html' title='Printing code at a PC value in gdb'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6665402724213797607.post-704911664216664983</id><published>2007-05-12T15:23:00.000-07:00</published><updated>2007-10-18T13:42:08.592-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Sun'/><category scheme='http://www.blogger.com/atom/ns#' term='search'/><category scheme='http://www.blogger.com/atom/ns#' term='0 matches'/><category scheme='http://www.blogger.com/atom/ns#' term='Vm'/><title type='text'>Problem in searching with Eclipse</title><content type='html'>Workspace/Project search for text, on my Eclipse CDT projects, returned "0 matches" in spite of the searched text being present.&lt;br /&gt;&lt;br /&gt;The problem was that my default VM was set to the GNU Java VM.&lt;br /&gt;Setting this to the Sun VM solved the problem.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ubuntuforums.org/showthread.php?t=201378"&gt;http://ubuntuforums.org/showthread.php?t=201378&lt;/a&gt; shows how to install the Sun VM on Ubutnu and make Eclipse use it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6665402724213797607-704911664216664983?l=framepointer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/704911664216664983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6665402724213797607&amp;postID=704911664216664983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/704911664216664983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/704911664216664983'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/2007/05/search-problem-in-eclipse.html' title='Problem in searching with Eclipse'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6665402724213797607.post-2430301801520013260</id><published>2007-05-09T16:00:00.000-07:00</published><updated>2007-05-09T16:01:40.427-07:00</updated><title type='text'>Intel syntax in gdb</title><content type='html'>You can get &lt;span style="font-style: italic;"&gt;gdb&lt;/span&gt; to use Intel syntax to display assembly code by using&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-weight: bold;"&gt;set disassembly-flavor intel&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6665402724213797607-2430301801520013260?l=framepointer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/2430301801520013260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6665402724213797607&amp;postID=2430301801520013260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/2430301801520013260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/2430301801520013260'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/2007/05/intel-syntax-in-gdb.html' title='Intel syntax in gdb'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6665402724213797607.post-4733743845848457090</id><published>2007-05-09T00:28:00.000-07:00</published><updated>2007-06-26T11:47:35.169-07:00</updated><title type='text'>Disassembing an elf binary on x86 Linux</title><content type='html'>An ELF binary can be disassembled on an x86 Linux machine  using &lt;span style="font-style: italic;"&gt;objdump&lt;/span&gt; .&lt;br /&gt;&lt;br /&gt;1. compile your file using gcc&lt;br /&gt;&lt;br /&gt;&gt; gcc test.c -o test&lt;br /&gt;&lt;br /&gt;2. get the objdump&lt;br /&gt;&lt;br /&gt;&gt;&lt;span style="font-weight: bold;"&gt;objdump test -f -D --disassembler-options intel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This would print the assembly equivalent of the elf binary &lt;span style="font-style: italic;"&gt;test&lt;/span&gt; .&lt;br /&gt;&lt;br /&gt;The -f option displays summary information from the section headers of the object file. This displays the starting address from where the program would begin execution.&lt;br /&gt;&lt;br /&gt;--disassembler-options intel prints the output assembly in &lt;span style="font-style: italic;"&gt;intel&lt;/span&gt; format&lt;br /&gt;&lt;br /&gt;See the man pages of objdump for a comprehensive explanation of the options.&lt;br /&gt;&lt;br /&gt;The target of instructions like&lt;br /&gt;&lt;br /&gt;jmp    DWORD PTR ds:0x80496b0&lt;br /&gt;&lt;br /&gt;can be obtained by&lt;br /&gt;&lt;br /&gt;&gt;objdump -R test&lt;br /&gt;&lt;br /&gt;I will post more information about disassembling in a future post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6665402724213797607-4733743845848457090?l=framepointer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://framepointer.blogspot.com/feeds/4733743845848457090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6665402724213797607&amp;postID=4733743845848457090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/4733743845848457090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6665402724213797607/posts/default/4733743845848457090'/><link rel='alternate' type='text/html' href='http://framepointer.blogspot.com/2007/05/disassembing-elf-binary-on-x86-linux.html' title='Disassembing an elf binary on x86 Linux'/><author><name>Karthik M</name><uri>http://www.blogger.com/profile/06089486435828991859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
