asm2cfg icon indicating copy to clipboard operation
asm2cfg copied to clipboard

Cannot run view control-flow graph on main(int, char**) function

Open Kazhuu opened this issue 2 years ago • 0 comments

When you have a C/C++ project with a source code and you simple break in main function that has a signature of main(int, char**) and run viewcfg. Following is printed and no control-flow graph is displayed:

(gdb) viewcfg
Unexpected assembly at line 1:
  Dump of assembler code for function main(int, char**):
Python Exception <class 'SystemExit'>: 1
Error occurred in Python: 1

It seems that the python code cannot handle function names on the fist line of the disassembly and fails. Following disassembly will fail for example:

Dump of assembler code for function main(int, char**):
   0x0000555555769de9 <+0>:     push   %rbp
   0x0000555555769dea <+1>:     mov    %rsp,%rbp
   0x0000555555769ded <+4>:     push   %r13
   0x0000555555769def <+6>:     push   %r12
   0x0000555555769df1 <+8>:     push   %rbx

Kazhuu avatar May 27 '23 13:05 Kazhuu