Skip to content

Commit

Permalink
Generalize AXE parser's regular experssions.
Browse files Browse the repository at this point in the history
Fixes issue jrfonseca#81 comment 4
  • Loading branch information
jrfonseca committed Jul 3, 2013
1 parent 4d8eae4 commit 97c0082
Show file tree
Hide file tree
Showing 2 changed files with 6,331 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gprof2dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,9 +1224,11 @@ def translate(self, mo):

_cg_header_re = re.compile(
'^Index |'
'^----- '
'^-----+ '
)

_cg_footer_re = re.compile('^Index\s+Function\s*$')

_cg_ignore_re = re.compile(
# internal calls (such as "mcount")
# FIXME: is this applicable?
Expand Down Expand Up @@ -1375,7 +1377,7 @@ def parse_cg(self):
# process call graph entries
entry_lines = []
# An EOF in readline terminates the program without returning.
while line != 'Index Function':
while not self._cg_footer_re.match(line):
if line.isspace():
self.parse_cg_entry(entry_lines)
entry_lines = []
Expand Down
Loading

0 comments on commit 97c0082

Please sign in to comment.