Merge "Teach debuggerd to pass the secondary ring buffer to __scudo_get_error_info()."

This commit is contained in:
Peter Collingbourne 2021-03-11 01:15:49 +00:00 committed by Gerrit Code Review
commit 03e961e392
3 changed files with 4 additions and 0 deletions

View file

@ -370,6 +370,7 @@ static bool InstallHooks(libc_globals* globals, const char* options, const char*
extern "C" const char* __scudo_get_stack_depot_addr(); extern "C" const char* __scudo_get_stack_depot_addr();
extern "C" const char* __scudo_get_region_info_addr(); extern "C" const char* __scudo_get_region_info_addr();
extern "C" const char* __scudo_get_ring_buffer_addr();
// Initializes memory allocation framework once per process. // Initializes memory allocation framework once per process.
static void MallocInitImpl(libc_globals* globals) { static void MallocInitImpl(libc_globals* globals) {
@ -381,6 +382,7 @@ static void MallocInitImpl(libc_globals* globals) {
#if defined(USE_SCUDO) #if defined(USE_SCUDO)
__libc_shared_globals()->scudo_stack_depot = __scudo_get_stack_depot_addr(); __libc_shared_globals()->scudo_stack_depot = __scudo_get_stack_depot_addr();
__libc_shared_globals()->scudo_region_info = __scudo_get_region_info_addr(); __libc_shared_globals()->scudo_region_info = __scudo_get_region_info_addr();
__libc_shared_globals()->scudo_ring_buffer = __scudo_get_ring_buffer_addr();
#endif #endif
// Prefer malloc debug since it existed first and is a more complete // Prefer malloc debug since it existed first and is a more complete

View file

@ -109,6 +109,7 @@ struct libc_shared_globals {
const char* scudo_stack_depot = nullptr; const char* scudo_stack_depot = nullptr;
const char* scudo_region_info = nullptr; const char* scudo_region_info = nullptr;
const char* scudo_ring_buffer = nullptr;
HeapTaggingLevel initial_heap_tagging_level = M_HEAP_TAGGING_LEVEL_NONE; HeapTaggingLevel initial_heap_tagging_level = M_HEAP_TAGGING_LEVEL_NONE;
}; };

View file

@ -42,6 +42,7 @@ static debugger_process_info get_process_info() {
.gwp_asan_metadata = __libc_shared_globals()->gwp_asan_metadata, .gwp_asan_metadata = __libc_shared_globals()->gwp_asan_metadata,
.scudo_stack_depot = __libc_shared_globals()->scudo_stack_depot, .scudo_stack_depot = __libc_shared_globals()->scudo_stack_depot,
.scudo_region_info = __libc_shared_globals()->scudo_region_info, .scudo_region_info = __libc_shared_globals()->scudo_region_info,
.scudo_ring_buffer = __libc_shared_globals()->scudo_ring_buffer,
}; };
} }
#endif #endif