Remove LLDB introspection entrypoints from the shim (#68450)

Rather than forwarding the LLDB entrypoints into asan_abi stable ABI,
leave them unimplemented for now. Doing so allows the shim and asan_abi
to be solely constrained to the entrypoints expected by the
instrumentation. We will take up a model for other stable ABIs (tsan,
ubsan, common, etc.) at a later date after choosing an inter-sanitizer
stable abi pattern after discussion and RFC. This commit modifies
https://reviews.llvm.org/D159545 by simply eliminating them from the
shim entirely.

rdar://115974403
This commit is contained in:
Roy Sundahl 2023-10-09 14:32:29 -07:00 committed by GitHub
parent 561fbe441e
commit 07d2e90f28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 67 deletions

View File

@ -86,22 +86,4 @@ void *__asan_abi_stack_malloc_always_n(size_t scale, size_t size) {
// Functions concerning fake stack free
void __asan_abi_stack_free_n(int scale, void *p, size_t n) {}
// Functions concerning introspection (including lldb support)
void *__asan_abi_get_alloc_stack(void *addr, void **trace, size_t size,
int *thread_id) {
return NULL;
}
void __asan_abi_report_error(void *pc, void *bp, void *sp, void *addr,
bool is_write, size_t access_size, int exp) {}
void __asan_abi_set_error_report_callback(void (*callback)(const char *)) {}
void __asan_abi_describe_address(void *addr) {}
bool __asan_abi_report_present(void) { return false; }
void *__asan_abi_get_report_pc(void) { return NULL; }
void *__asan_abi_get_report_bp(void) { return NULL; }
void *__asan_abi_get_report_sp(void) { return NULL; }
void *__asan_abi_get_report_address(void) { return NULL; }
int __asan_abi_get_report_access_type(void) { return 0; }
size_t __asan_abi_get_report_access_size(void) { return 0; }
const char *__asan_abi_get_report_description(void) { return NULL; }
}

View File

@ -87,21 +87,5 @@ void *__asan_abi_stack_malloc_always_n(size_t scale, size_t size);
// Functions concerning fake stack free
void __asan_abi_stack_free_n(int scale, void *p, size_t n);
// Functions concerning introspection (including lldb support)
void *__asan_abi_get_alloc_stack(void *addr, void **trace, size_t size,
int *thread_id);
void __asan_abi_report_error(void *pc, void *bp, void *sp, void *addr,
bool is_write, size_t access_size, int exp);
void __asan_abi_set_error_report_callback(void (*callback)(const char *));
void __asan_abi_describe_address(void *addr);
bool __asan_abi_report_present(void);
void *__asan_abi_get_report_pc(void);
void *__asan_abi_get_report_bp(void);
void *__asan_abi_get_report_sp(void);
void *__asan_abi_get_report_address(void);
int __asan_abi_get_report_access_type(void);
size_t __asan_abi_get_report_access_size(void);
const char *__asan_abi_get_report_description(void);
__END_DECLS
#endif // ASAN_ABI_H

View File

@ -478,37 +478,4 @@ void __asan_stack_free_9(uptr ptr, uptr size) {
void __asan_stack_free_10(uptr ptr, uptr size) {
__asan_abi_stack_free_n(10, (void *)ptr, size);
}
// Functions concerning introspection (including lldb support)
uptr __asan_get_alloc_stack(uptr addr, uptr *trace, uptr size, u32 *thread_id) {
return (uptr)__asan_abi_get_alloc_stack((void *)addr, (void **)trace,
(size_t)size, (int *)thread_id);
}
void __asan_report_error(uptr pc, uptr bp, uptr sp, uptr addr, int is_write,
uptr access_size, u32 exp) {
__asan_abi_report_error((void *)pc, (void *)bp, (void *)sp, (void *)addr,
(bool)is_write, (size_t)access_size, (int)exp);
}
void __asan_set_error_report_callback(void (*callback)(const char *)) {
__asan_abi_set_error_report_callback(callback);
}
void __asan_describe_address(uptr addr) {
__asan_abi_describe_address((void *)addr);
}
int __asan_report_present(void) { return __asan_abi_report_present(); }
uptr __asan_get_report_pc(void) { return (uptr)__asan_abi_get_report_pc(); }
uptr __asan_get_report_bp(void) { return (uptr)__asan_abi_get_report_bp(); }
uptr __asan_get_report_sp(void) { return (uptr)__asan_abi_get_report_sp(); }
uptr __asan_get_report_address(void) {
return (uptr)__asan_abi_get_report_address();
}
int __asan_get_report_access_type(void) {
return __asan_abi_get_report_access_type();
}
uptr __asan_get_report_access_size(void) {
return (uptr)__asan_abi_get_report_access_size();
}
const char *__asan_get_report_description(void) {
return __asan_abi_get_report_description();
}
}

View File

@ -8,3 +8,15 @@ __asan_on_error
__asan_print_accumulated_stats
__asan_set_death_callback
__asan_update_allocation_context
__asan_describe_address
__asan_get_alloc_stack
__asan_get_report_access_size
__asan_get_report_access_type
__asan_get_report_address
__asan_get_report_bp
__asan_get_report_description
__asan_get_report_pc
__asan_get_report_sp
__asan_report_error
__asan_report_present
__asan_set_error_report_callback