|
@@ -52,13 +52,19 @@ BASELINE_JIT_ORIGIN_NAME = "baseline-jit"
|
|
|
FAST_JIT_ORIGIN_NAME = "fast-jit"
|
|
|
"""The origin name for functions that were produced by the fast JIT."""
|
|
|
|
|
|
+UNKNOWN_FUNCTION_REPR = "unknown function"
|
|
|
+"""The representation used for unknown functions in stack traces."""
|
|
|
+
|
|
|
+UNKNOWN_LOCATION_REPR = "[unknown location] "
|
|
|
+"""The representation used for unknown locations in stack traces."""
|
|
|
+
|
|
|
def format_stack_frame(function_name, debug_info, origin='unknown'):
|
|
|
"""Formats a stack frame, which consists of a function name, debug
|
|
|
information and an origin."""
|
|
|
if function_name is None:
|
|
|
- function_name = 'unknown function'
|
|
|
+ function_name = UNKNOWN_FUNCTION_REPR
|
|
|
if debug_info is None:
|
|
|
- debug_info = '[unknown location] '
|
|
|
+ debug_info = UNKNOWN_LOCATION_REPR
|
|
|
|
|
|
return '%sin %s (%s)' % (debug_info, function_name, origin)
|
|
|
|