Skip to content

Commit

Permalink
Merge "Skip adding value lines for accidental matches."
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Sep 19, 2016
2 parents 79a71c5 + 5f1b4f0 commit 42f4d98
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
36 changes: 23 additions & 13 deletions scripts/stack_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,19 +409,21 @@ def ProcessLine(self, line):
else:
info = symbol.SymbolInformation(area, value)
(source_symbol, source_location, object_symbol_with_offset) = info.pop()
if not source_symbol:
if symbol_present:
source_symbol = symbol.CallCppFilt(symbol_name)
else:
source_symbol = "<unknown>"
if not source_location:
source_location = area
if not object_symbol_with_offset:
object_symbol_with_offset = source_symbol
self.value_lines.append((addr,
value,
object_symbol_with_offset,
source_location))
# If there is no information, skip this.
if source_symbol or source_location or object_symbol_with_offset:
if not source_symbol:
if symbol_present:
source_symbol = symbol.CallCppFilt(symbol_name)
else:
source_symbol = "<unknown>"
if not source_location:
source_location = area
if not object_symbol_with_offset:
object_symbol_with_offset = source_symbol
self.value_lines.append((addr,
value,
object_symbol_with_offset,
source_location))

return ret

Expand Down Expand Up @@ -499,5 +501,13 @@ def test_long_asan_crash(self):
self.assertGreater(trace_line_count, 10)
tc.PrintOutput(tc.trace_lines, tc.value_lines)

class ValueLinesTest(unittest.TestCase):
def test_value_line_skipped(self):
tc = TraceConverter()
symbol.SetAbi(["ABI: 'arm'"])
tc.UpdateAbiRegexes()
tc.ProcessLine(" 12345678 00001000 .")
self.assertEqual([], tc.value_lines)

if __name__ == '__main__':
unittest.main()
4 changes: 4 additions & 0 deletions scripts/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ def CallAddr2LineForSet(lib, unique_addrs):
if not os.path.exists(symbols):
return None

# Make sure the symbols path is not a directory.
if os.path.isdir(symbols):
return None

cmd = [ToolPath("addr2line"), "--functions", "--inlines",
"--demangle", "--exe=" + symbols]
child = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
Expand Down

0 comments on commit 42f4d98

Please sign in to comment.