Merge "Plumb scudo_ring_buffer_size to debuggerd_process_info"

This commit is contained in:
Florian Mayer 2023-01-10 21:23:33 +00:00 committed by Gerrit Code Review
commit eae797db66
3 changed files with 4 additions and 0 deletions

View File

@ -371,6 +371,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_region_info_addr();
extern "C" const char* __scudo_get_ring_buffer_addr();
extern "C" size_t __scudo_get_ring_buffer_size();
// Initializes memory allocation framework once per process.
static void MallocInitImpl(libc_globals* globals) {
@ -383,6 +384,7 @@ static void MallocInitImpl(libc_globals* globals) {
__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_ring_buffer = __scudo_get_ring_buffer_addr();
__libc_shared_globals()->scudo_ring_buffer_size = __scudo_get_ring_buffer_size();
#endif
// Prefer malloc debug since it existed first and is a more complete

View File

@ -111,6 +111,7 @@ struct libc_shared_globals {
const char* scudo_stack_depot = nullptr;
const char* scudo_region_info = nullptr;
const char* scudo_ring_buffer = nullptr;
size_t scudo_ring_buffer_size = 0;
HeapTaggingLevel initial_heap_tagging_level = M_HEAP_TAGGING_LEVEL_NONE;
bool initial_memtag_stack = false;

View File

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