From d5848d8c944f0c08abc760b8cb7aa42ee224131a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1zaro=20Clapp=20Jim=C3=A9nez=20Labora?= Date: Mon, 1 Aug 2016 17:37:28 -0700 Subject: [PATCH] Add parsing of native methods on the stacktrace. Reviewed By: sblackshear Differential Revision: D3642937 fbshipit-source-id: 43f5ed3 --- infer/src/harness/stacktrace.ml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/infer/src/harness/stacktrace.ml b/infer/src/harness/stacktrace.ml index a0571c8c7..cec7be205 100644 --- a/infer/src/harness/stacktrace.ml +++ b/infer/src/harness/stacktrace.ml @@ -9,6 +9,8 @@ (** Module for parsing stack traces and using them to guide Infer analysis *) +open! Utils + module F = Format type frame = { @@ -42,11 +44,16 @@ let parse_stack_frame frame_str = ignore(Str.string_match (Str.regexp "\\(.*\\)\\.\\(.*\\)") qualified_procname 0); let class_str = Str.matched_group 1 qualified_procname in let method_str = Str.matched_group 2 qualified_procname in - (* separate the filename and line number *) - ignore(Str.string_match (Str.regexp "\\(.*\\):\\([0-9]+\\)") file_and_line 0); - let file_str = Str.matched_group 1 file_and_line in - let line_num = int_of_string (Str.matched_group 2 file_and_line) in - make_frame class_str method_str file_str line_num + (* Native methods don't have debugging info *) + if string_equal file_and_line "Native Method" then + make_frame class_str method_str "Native Method" (-1) + else begin + (* separate the filename and line number *) + ignore(Str.string_match (Str.regexp "\\(.*\\):\\([0-9]+\\)") file_and_line 0); + let file_str = Str.matched_group 1 file_and_line in + let line_num = int_of_string (Str.matched_group 2 file_and_line) in + make_frame class_str method_str file_str line_num + end let parse_exception_line exception_line = ignore(Str.string_match