Skip to content

Commit

Permalink
pw_symbolizer: Expose llvm_symbolizer_binary
Browse files Browse the repository at this point in the history
Allow the caller to specify the llvm_symbolizer_binary to use whenever
initializing the LlvmSymbolizer object.

Bug: 322189439
Change-Id: I19c36494673d57180544ca841edcd6a8d44d1e11
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/189355
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Ted Pudlik <tpudlik@google.com>
  • Loading branch information
tpudlik authored and CQ Bot Account committed Jan 26, 2024
1 parent 0d068e1 commit fa9b84d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pw_snapshot/py/pw_snapshot/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def process_snapshot(
detokenizer: Optional[pw_tokenizer.Detokenizer] = None,
elf_matcher: Optional[ElfMatcher] = None,
symbolizer_matcher: Optional[SymbolizerMatcher] = None,
llvm_symbolizer_binary: Optional[Path] = None,
) -> str:
"""Processes a single snapshot."""

Expand All @@ -77,9 +78,13 @@ def process_snapshot(
if symbolizer_matcher is not None:
symbolizer = symbolizer_matcher(snapshot)
elif elf_matcher is not None:
symbolizer = LlvmSymbolizer(elf_matcher(snapshot))
symbolizer = LlvmSymbolizer(
elf_matcher(snapshot), llvm_symbolizer_binary=llvm_symbolizer_binary
)
else:
symbolizer = LlvmSymbolizer()
symbolizer = LlvmSymbolizer(
llvm_symbolizer_binary=llvm_symbolizer_binary
)

cortex_m_cpu_state = pw_cpu_exception_cortex_m.process_snapshot(
serialized_snapshot, symbolizer
Expand Down

0 comments on commit fa9b84d

Please sign in to comment.