File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121#include " src/stirling/source_connectors/socket_tracer/uprobe_symaddrs.h"
2222
2323using px::StatusOr;
24+ using px::stirling::GoOffsetLocator;
2425using px::stirling::PopulateGoTLSDebugSymbols;
2526using px::stirling::obj_tools::DwarfReader;
2627using px::stirling::obj_tools::ElfReader;
28+ using px::stirling::obj_tools::ReadGoBuildInfo;
2729
2830// -----------------------------------------------------------------------------
2931// This utility is designed to isolate parsing the debug symbols of a Go binary. This
@@ -62,8 +64,13 @@ int main(int argc, char** argv) {
6264 }
6365 std::unique_ptr<DwarfReader> dwarf_reader = dwarf_reader_status.ConsumeValueOrDie ();
6466
67+ auto build_info_s = ReadGoBuildInfo (elf_reader.get ());
68+ const auto & [go_version, build_info] = build_info_s.ConsumeValueOrDie ();
69+ std::unique_ptr<GoOffsetLocator> go_offset_locator =
70+ std::make_unique<GoOffsetLocator>(dwarf_reader.get (), build_info, go_version);
71+
6572 struct go_tls_symaddrs_t symaddrs;
66- auto status = PopulateGoTLSDebugSymbols (elf_reader.get (), dwarf_reader .get (), &symaddrs);
73+ auto status = PopulateGoTLSDebugSymbols (elf_reader.get (), go_offset_locator .get (), &symaddrs);
6774
6875 if (!status.ok ()) {
6976 LOG (ERROR) << absl::Substitute (" debug symbol parsing failed with: $0" , status.msg ());
You can’t perform that action at this time.
0 commit comments