Skip to content

strip ?? functions. #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions gen_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,33 @@ def __str__(self):
format_str = 'Len(frames) = {}, 1st frame={}'.format(len(self.parsed_frame_dict), self.parsed_frame_dict[list(self.parsed_frame_dict.keys())[0]])
return format_str

@staticmethod
def clear_unknown_frames(current_frame_list):
cleared = []
for frame in current_frame_list:
if frame.fn_name.strip() == '??':
continue
cleared.append(frame)
for i, ele in enumerate(cleared):
ele.frame_no = i
if i > 0:
ele.callees = [cleared[i-1]]
else:
ele.callees = []
if i < len(cleared) - 1:
ele.callers = [cleared[i+1]]
else:
ele.callers = []
return cleared

def fix_up_global_dict(self, new_bt):
logger.debug('fix up, #ofFrames={}'.format(len(new_bt)))

new_bt = GenGraph.clear_unknown_frames(new_bt)

if len(new_bt) == 0:
return

for frame in new_bt:
if frame.fn_name in self.parsed_frame_dict:
existing_frame = self.parsed_frame_dict[frame.fn_name]
Expand Down