Skip to content

Commit

Permalink
Merge branch 'main' into dsn/crashtracker-receiver-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsn authored Nov 1, 2024
2 parents e599682 + fb66952 commit 9c74207
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 123 deletions.
27 changes: 11 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 33 additions & 38 deletions LICENSE-3rdparty.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crashtracker/src/crash_info/stacktrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mod unix {
anyhow::ensure!(normed.outputs.len() == 1);
let (file_offset, meta_idx) = normed.outputs[0];
let meta = &normed.meta[meta_idx];
let elf = meta.elf().ok_or(anyhow::anyhow!("Not elf"))?;
let elf = meta.as_elf().ok_or(anyhow::anyhow!("Not elf"))?;
let resolver = ElfResolver::open(&elf.path)?;
let virt_address = resolver
.file_offset_to_virt_offset(file_offset)?
Expand Down
14 changes: 7 additions & 7 deletions examples/ffi/symbolizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

void symbolize_and_print_abs(blaze_symbolizer* symbolizer, uintptr_t addr) {
std::vector<uintptr_t> addrs = {addr};

blaze_symbolize_src_process src = {
.type_size = sizeof(blaze_symbolize_src_process),
.pid = static_cast<uint32_t>(getpid()),
Expand All @@ -27,19 +27,19 @@ void symbolize_and_print_abs(blaze_symbolizer* symbolizer, uintptr_t addr) {
.map_files = false,
.reserved = {},
};
const blaze_result* results = blaze_symbolize_process_abs_addrs(
const blaze_syms* syms = blaze_symbolize_process_abs_addrs(
symbolizer, &src, addrs.data(), addrs.size());
assert(results);
assert(syms);
bool found = false;
for (size_t i = 0; i < addrs.size(); ++i) {
std::cout << "Address: " << addrs[i] << ", Symbolized: " << results->syms[i].name << std::endl;
if (std::string(results->syms[i].name).find("test_symbolizer") != std::string::npos){
std::cout << "Address: " << addrs[i] << ", Symbolized: " << syms->syms[i].name << std::endl;
if (std::string(syms->syms[i].name).find("test_symbolizer") != std::string::npos){
found = true;
}
}
assert(found);
// Free the results
blaze_result_free(results);
// Free the syms
blaze_syms_free(syms);
}

void test_symbolizer() {
Expand Down
2 changes: 1 addition & 1 deletion symbolizer-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ bench = false

[target.'cfg(not(target_os = "windows"))'.dependencies]
# Should be kept in sync with the libdatadog crashtracker crate (also using blasesym)
blazesym-c = "0.1.0-rc.0"
blazesym-c = "0.1.0-rc.1"
Loading

0 comments on commit 9c74207

Please sign in to comment.