Skip to content

Commit e863aaa

Browse files
committed
Fix compilation issues with src/stirling/binaries/go_binary_parse_profiling
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent b2bf6c2 commit e863aaa

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/stirling/binaries/go_binary_parse_profiling.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
#include "src/stirling/source_connectors/socket_tracer/uprobe_symaddrs.h"
2222

2323
using px::StatusOr;
24+
using px::stirling::GoOffsetLocator;
2425
using px::stirling::PopulateGoTLSDebugSymbols;
2526
using px::stirling::obj_tools::DwarfReader;
2627
using 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());

0 commit comments

Comments
 (0)