Пример #1
0
    def dispatch_request(self, symbol_name=None):
        if request.method == "POST":
            helper = BacktraceHelper(self.collector)

            snippet = request.form["snippet"]
            self.template_vars["snippet"] = snippet
            self.template_vars["functions"] = helper.derive_function_symbols(snippet)

        return self.render_template("rack.html.jinja", "rack")
Пример #2
0
    def dispatch_request(self, symbol_name=None):
        if request.method == "POST":
            helper = BacktraceHelper(self.collector)

            snippet = request.form["snippet"]
            self.template_vars["snippet"] = snippet
            self.template_vars["functions"] = helper.derive_function_symbols(snippet)

        return self.render_template("rack.html.jinja", "rack")
Пример #3
0
    def test_returns_known_symbols(self):
        r = BacktraceHelper(TestBacktraceHelper.FakeCollector([
            "codepoint_get_horizontal_advance", "text_walk_lines",
        ]))
        actual = r.derive_function_symbols("""
    fontinfo=0x200010ec <s_system_fonts_info_table+200>) 16 at ../src/fw/applib/graphics/text_resources.c:347
#4  0x08012220 in codepoint_get_horizontal_advance () 16
#5  0x08012602 in walk_line () 112
#6  0x080128d6 in text_walk_lines.constprop.8 () (inlined)
        """)

        self.assertEqual(["codepoint_get_horizontal_advance", "text_walk_lines"], [f[collector.NAME] for f in actual])
Пример #4
0
 def test_returns_empty_list(self):
     r = BacktraceHelper(None)
     self.assertEqual([], r.derive_function_symbols(""))