viewing CFG in debugging

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?

Thanks in advance.
Lu

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