|
49 | 49 |
|
50 | 50 | #include <cstdint> |
51 | 51 | #include <cstring> |
52 | | -#include <regex> |
53 | 52 | #include <utility> |
54 | 53 |
|
55 | 54 | #include <cassert> |
@@ -740,28 +739,16 @@ void Instruction::Dump(lldb_private::Stream *s, uint32_t max_opcode_byte_size, |
740 | 739 | if (auto entryOrErr = expr_list.GetExpressionEntryAtAddress(func_load_addr, current_pc)) { |
741 | 740 | auto entry = *entryOrErr; |
742 | 741 |
|
743 | | - // Translate file-range to load-space start. |
744 | | - addr_t file_base = entry.file_range.GetBaseAddress().GetFileAddress(); |
745 | | - addr_t start_load_addr = file_base + (func_load_addr - expr_list.GetFuncFileAddress()); |
| 742 | + // Check if entry has a file_range, and filter on address if so. |
| 743 | + if (!entry.file_range || entry.file_range->ContainsFileAddress( |
| 744 | + (current_pc - func_load_addr) + expr_list.GetFuncFileAddress())) { |
746 | 745 |
|
747 | | - if (current_pc >= start_load_addr) { |
748 | 746 | StreamString loc_str; |
749 | 747 | ABI *abi = exe_ctx->GetProcessPtr()->GetABI().get(); |
750 | 748 | entry.expr->DumpLocation(&loc_str, eDescriptionLevelBrief, abi); |
751 | 749 |
|
752 | 750 | std::string loc_output = loc_str.GetString().str(); |
753 | 751 |
|
754 | | - // // Remove ", <decoding error> ..." segments. |
755 | | - // std::regex decoding_err_re(", <decoding error>[^,]*"); |
756 | | - // loc_output = std::regex_replace(loc_output, decoding_err_re, ""); |
757 | | - |
758 | | - // llvm::StringRef cleaned_output = llvm::StringRef(loc_output).trim(); |
759 | | - |
760 | | - // // Only keep this annotation if there is still something useful left. |
761 | | - // if (!cleaned_output.empty()) { |
762 | | - // annotations.push_back(llvm::formatv("{0} = {1}", name, cleaned_output)); |
763 | | - // } |
764 | | - |
765 | 752 | llvm::SmallVector<llvm::StringRef, 4> parts; |
766 | 753 | llvm::StringRef(loc_str.GetString()).split(parts, ", "); |
767 | 754 |
|
|
0 commit comments