Exemplo n.º 1
0
def has_llvm_symbolizer():
    from symsynd.driver import find_llvm_symbolizer

    try:
        return find_llvm_symbolizer() is not None
    except EnvironmentError:
        return False
Exemplo n.º 2
0
def has_llvm_symbolizer():
    from symsynd.driver import find_llvm_symbolizer

    try:
        return find_llvm_symbolizer() is not None
    except EnvironmentError:
        return False
Exemplo n.º 3
0
            "instruction_addr": "0x100026330",
        }


def patched_symbolize_system_frame(self, frame, sdk_info):
    assert sdk_info == SDK_INFO
    if frame["instruction_addr"] == 4295123360:
        return {
            "object_name": "/usr/lib/whatever.dylib",
            "symbol_name": "whatever_system",
            "symbol_addr": "0x100026110",
            "instruction_addr": "0x1000261a0",
        }


@pytest.mark.skipif(find_llvm_symbolizer() is None, reason="llvm-symbolizer is not installed")
class BasicResolvingFileTest(TestCase):
    @patch("sentry.lang.native.symbolizer.Symbolizer.symbolize_app_frame", new=patched_symbolize_app_frame)
    @patch("sentry.lang.native.symbolizer.Symbolizer.symbolize_system_frame", new=patched_symbolize_system_frame)
    def test_frame_resolution(self):
        event_data = {
            "sentry.interfaces.User": {"ip_address": "31.172.207.97"},
            "extra": {},
            "project": self.project.id,
            "platform": "cocoa",
            "debug_meta": {
                "images": [
                    {
                        "type": "apple",
                        "cpu_subtype": 0,
                        "uuid": "C05B4DDD-69A7-3840-A649-32180D341587",
Exemplo n.º 4
0
import pytest

from mock import patch

from symsynd.driver import find_llvm_symbolizer

from sentry.models import Event
from sentry.testutils import TestCase


@pytest.mark.skipif(find_llvm_symbolizer() is None,
                    reason='llvm-symbolizer is not installed')
class BasicResolvingIntegrationTest(TestCase):

    @patch('sentry.lang.native.symbolizer.Symbolizer.symbolize_app_frame')
    def test_frame_resolution(self, symbolize_frame):
        object_name = (
            "/var/containers/Bundle/Application/"
            "B33C37A8-F933-4B6B-9FFA-152282BFDF13/"
            "SentryTest.app/SentryTest"
        )

        symbolize_frame.return_value = {
            'filename': 'Foo.swift',
            'line': 42,
            'column': 23,
            'object_name': object_name,
            'symbol_name': 'real_main',
            'symbol_addr': '0x1000262a0',
            "instruction_addr": '0x100026330',
        }