gcode-mirror / xdebugtoolkit

Automatically exported from code.google.com/p/xdebugtoolkit
0 stars 0 forks source link

malformed cg files cause cg2dot to throw exception. #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use cg2dot.py on a malformed cg file

What is the expected output? What do you see instead?

I would prefer that cg2dot would not crash but continue processing the next
file.  I dont know if its because the cg file was partially written by
xdebug,  but i have 100's of files and it would be ok to skip over ones
that cg2dot.py cannot process.  The problem is it will get through 99 files
and then crash on the 100th because its either malformed or a bug ( i cant
tell ).   No matter what the issue i think a good solution would be to skip
over those,  or provide an option to skip over them.

What version of the product are you using? On what operating system?
1.3
centos 5.2

Please provide any additional information below.

Original issue reported on code.google.com by jondelan...@gmail.com on 8 Oct 2009 at 7:46

GoogleCodeExporter commented 9 years ago
Heres the command and exception

[jon@www2 xdebugtoolkit]$ ./cg2dot.py xdebug/profile._* > xdebug.dot
Traceback (most recent call last):
  File "./cg2dot.py", line 29, in ?
    tree = XdebugCachegrindTreeBuilder(xdebug_parser).get_tree()
  File "/home/jon/tarballs/xdebugtoolkit/reader.py", line 188, in get_tree
    inclusive_time = sum([x.sum_inclusive_time for x in root_node.subcalls])
AttributeError: 'NoneType' object has no attribute 'sum_inclusive_time'

Original comment by jondelan...@gmail.com on 8 Oct 2009 at 7:55

GoogleCodeExporter commented 9 years ago
Hi. I'll try to handle the issue this weekend.

Original comment by Alexey.K...@gmail.com on 21 Oct 2009 at 6:27

GoogleCodeExporter commented 9 years ago
Done in r135.

You can now use -i/--ignore option. It will make cg2dot ignore corrupted files 
and
show warnings into stderr.

Original comment by Alexey.K...@gmail.com on 10 Feb 2010 at 4:13