MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / parse_debug_info

Method parse_debug_info

python/debuginfo.py:225–248  ·  view source on GitHub ↗

Returns a ``DebugInfo`` object populated with debug info by this debug-info parser. Only provide a ``DebugInfo`` object if you wish to append to the existing debug info. Some debug file formats need both the original :py:class:`binaryview.BinaryView` (the binary being analyzed/having debug inf

(self, view: 'binaryview.BinaryView', debug_view: 'binaryview.BinaryView', debug_info: Optional["DebugInfo"] = None, progress: ProgressFuncType = None)

Source from the content-addressed store, hash-verified

223 return core.BNIsDebugInfoParserValidForView(self.handle, view.handle)
224
225 def parse_debug_info(self, view: 'binaryview.BinaryView', debug_view: 'binaryview.BinaryView', debug_info: Optional["DebugInfo"] = None, progress: ProgressFuncType = None) -> Optional["DebugInfo"]:
226 """
227 Returns a ``DebugInfo`` object populated with debug info by this debug-info parser. Only provide a ``DebugInfo`` object if you wish to append to the existing debug info.
228
229 Some debug file formats need both the original :py:class:`binaryview.BinaryView` (the binary being analyzed/having debug information applied to it) in addition to the :py:class:`binaryview.BinaryView` of the file containing the debug information.
230 For formats where you can get all the information you need from a single file, calls to ``parse_debug_info`` are required to provide that file for both arguments.
231 For formats where you can get all the information you need from a single file, implementations of `parse` should only read from the second `debug_file` parameter and ignore the former.
232 """
233 if progress is None:
234 progress = lambda cur, max: True
235 progress_c = ctypes.CFUNCTYPE(ctypes.c_bool, ctypes.c_void_p, ctypes.c_size_t, ctypes.c_size_t)(lambda ctxt, cur, max: progress(cur, max))
236
237 if isinstance(debug_info, DebugInfo):
238 parser = core.BNParseDebugInfo(self.handle, view.handle, debug_view.handle, debug_info.handle, progress_c, None)
239 if parser is None:
240 return None
241 parser_ref = core.BNNewDebugInfoReference(parser)
242 assert parser_ref is not None, "core.BNNewDebugInfoReference returned None"
243 return DebugInfo(parser_ref)
244 else:
245 parser = core.BNParseDebugInfo(self.handle, view.handle, debug_view.handle, None, progress_c, None)
246 if parser is None:
247 return None
248 return DebugInfo(parser)
249
250
251@dataclass(frozen=True)

Callers

nothing calls this directly

Calls 1

DebugInfoClass · 0.70

Tested by

no test coverage detected