[LLVMdev] viewing CFG in debugging

Török Edwin edwintorok at gmail.com
Sun Apr 13 23:02:16 PDT 2008


Lu Zhao wrote:
> Hi,
>
> I tried to view the CFG when debugging a pass by "gdb opt," but the gdb
> does not have DAG.viewGraph function, which is indicated at
> http://www.llvm.org/docs/ProgrammersManual.html#ViewGraph. Could anyone
> tell me how to make DAG* functions available in gdb?
>   

If you want a CFG use Function::viewCFG(), for example if you are inside
runOnFunction(Function &F):
(gdb) call F.viewCFG()

DAG is used during code generation (llc), and not by opt AFAIK, so there
is no DAG variable there.

Best regards,
--Edwin



More information about the llvm-dev mailing list