Hi, all:<br> Recently I am debugging the DSA and want to learn how it work, and now I am checking the local datastructure analysis. <br>I use the following command to print the graph:<br>(gdb) p g.dump()<br>digraph DataStructures {<br>
label="Function addG";<br><br> Node0xe1f3a0 [shape=record,shape=Mrecord,label="{ i32: MRE\n|{<g0>}}"];<br> Node0xe1f4d0 [shape=record,shape=Mrecord,label="{ i32*: SMR\n|{<g0>|<g1>}}"];<br>
Node0xe1f4d0:g0 -> Node0xe1f3a0;<br> Node0xe20900 [shape=record,shape=Mrecord,label="{ i32: GR\n @global\n|{<g0>}}"];<br> Node0xe16530[ label =" %x_addr"];<br> Node0xe16530 -> Node0xe1f4d0[arrowtail=tee,color=gray63];<br>
Node0xe162f0[ label =" %x"];<br> Node0xe162f0 -> Node0xe1f3a0[arrowtail=tee,color=gray63];<br> Node0xe16950[ label =" %tmp4"];<br> Node0xe16950 -> Node0xe1f3a0[arrowtail=tee,color=gray63];<br>
Node0xe16730[ label =" %tmp"];<br> Node0xe16730 -> Node0xe1f3a0[arrowtail=tee,color=gray63];<br>}<br><br>then I had to copy these lines out into a .dot file and use dot to convert it into a ps file.<br>
I note that it also provide a lot print and dump functions in Printer.cpp, such as <br>void DSGraph::writeGraphToFile(std::ostream &O,<br> const std::string &GraphName) const {<br><br>
but i don't know how to use it, also there are other functions:<br>// print - Print out the analysis results...<br>void LocalDataStructures::print(std::ostream &O, const Module *M) const {<br> if (DontPrintAnything) return;<br>
printCollection(*this, O, M, "ds.");<br>}<br>..........<br>how these functions can be used in gdb? furthermore, are there any options which i can type in command line for DSA?, such as:<br>opt -load=xxxxxx -print_the_local_analysis_result list.bc -o list-opt.bc<br>
<br>also any suggestions for how to debug DSA efficiently?<br><br>Thanks.<br><br>Tianwei