Skip to content

Commit 9a0b1a0

Browse files
rsundahlRoy Sundahl
authored and
Roy Sundahl
committed
Remove LLDB introspection entrypoints from the shim (llvm#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 (cherry picked from commit 07d2e90)
1 parent 94becb7 commit 9a0b1a0

File tree

4 files changed

+12
-67
lines changed

4 files changed

+12
-67
lines changed

compiler-rt/lib/asan_abi/asan_abi.cpp

-18
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,4 @@ void *__asan_abi_stack_malloc_always_n(size_t scale, size_t size) {
8686

8787
// Functions concerning fake stack free
8888
void __asan_abi_stack_free_n(int scale, void *p, size_t n) {}
89-
90-
// Functions concerning introspection (including lldb support)
91-
void *__asan_abi_get_alloc_stack(void *addr, void **trace, size_t size,
92-
int *thread_id) {
93-
return NULL;
94-
}
95-
void __asan_abi_report_error(void *pc, void *bp, void *sp, void *addr,
96-
bool is_write, size_t access_size, int exp) {}
97-
void __asan_abi_set_error_report_callback(void (*callback)(const char *)) {}
98-
void __asan_abi_describe_address(void *addr) {}
99-
bool __asan_abi_report_present(void) { return false; }
100-
void *__asan_abi_get_report_pc(void) { return NULL; }
101-
void *__asan_abi_get_report_bp(void) { return NULL; }
102-
void *__asan_abi_get_report_sp(void) { return NULL; }
103-
void *__asan_abi_get_report_address(void) { return NULL; }
104-
int __asan_abi_get_report_access_type(void) { return 0; }
105-
size_t __asan_abi_get_report_access_size(void) { return 0; }
106-
const char *__asan_abi_get_report_description(void) { return NULL; }
10789
}

compiler-rt/lib/asan_abi/asan_abi.h

-16
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,5 @@ void *__asan_abi_stack_malloc_always_n(size_t scale, size_t size);
8787
// Functions concerning fake stack free
8888
void __asan_abi_stack_free_n(int scale, void *p, size_t n);
8989

90-
// Functions concerning introspection (including lldb support)
91-
void *__asan_abi_get_alloc_stack(void *addr, void **trace, size_t size,
92-
int *thread_id);
93-
void __asan_abi_report_error(void *pc, void *bp, void *sp, void *addr,
94-
bool is_write, size_t access_size, int exp);
95-
void __asan_abi_set_error_report_callback(void (*callback)(const char *));
96-
void __asan_abi_describe_address(void *addr);
97-
bool __asan_abi_report_present(void);
98-
void *__asan_abi_get_report_pc(void);
99-
void *__asan_abi_get_report_bp(void);
100-
void *__asan_abi_get_report_sp(void);
101-
void *__asan_abi_get_report_address(void);
102-
int __asan_abi_get_report_access_type(void);
103-
size_t __asan_abi_get_report_access_size(void);
104-
const char *__asan_abi_get_report_description(void);
105-
10690
__END_DECLS
10791
#endif // ASAN_ABI_H

compiler-rt/lib/asan_abi/asan_abi_shim.cpp

-33
Original file line numberDiff line numberDiff line change
@@ -478,37 +478,4 @@ void __asan_stack_free_9(uptr ptr, uptr size) {
478478
void __asan_stack_free_10(uptr ptr, uptr size) {
479479
__asan_abi_stack_free_n(10, (void *)ptr, size);
480480
}
481-
482-
// Functions concerning introspection (including lldb support)
483-
uptr __asan_get_alloc_stack(uptr addr, uptr *trace, uptr size, u32 *thread_id) {
484-
return (uptr)__asan_abi_get_alloc_stack((void *)addr, (void **)trace,
485-
(size_t)size, (int *)thread_id);
486-
}
487-
void __asan_report_error(uptr pc, uptr bp, uptr sp, uptr addr, int is_write,
488-
uptr access_size, u32 exp) {
489-
__asan_abi_report_error((void *)pc, (void *)bp, (void *)sp, (void *)addr,
490-
(bool)is_write, (size_t)access_size, (int)exp);
491-
}
492-
void __asan_set_error_report_callback(void (*callback)(const char *)) {
493-
__asan_abi_set_error_report_callback(callback);
494-
}
495-
void __asan_describe_address(uptr addr) {
496-
__asan_abi_describe_address((void *)addr);
497-
}
498-
int __asan_report_present(void) { return __asan_abi_report_present(); }
499-
uptr __asan_get_report_pc(void) { return (uptr)__asan_abi_get_report_pc(); }
500-
uptr __asan_get_report_bp(void) { return (uptr)__asan_abi_get_report_bp(); }
501-
uptr __asan_get_report_sp(void) { return (uptr)__asan_abi_get_report_sp(); }
502-
uptr __asan_get_report_address(void) {
503-
return (uptr)__asan_abi_get_report_address();
504-
}
505-
int __asan_get_report_access_type(void) {
506-
return __asan_abi_get_report_access_type();
507-
}
508-
uptr __asan_get_report_access_size(void) {
509-
return (uptr)__asan_abi_get_report_access_size();
510-
}
511-
const char *__asan_get_report_description(void) {
512-
return __asan_abi_get_report_description();
513-
}
514481
}

compiler-rt/lib/asan_abi/asan_abi_tbd.txt

+12
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@ __asan_on_error
88
__asan_print_accumulated_stats
99
__asan_set_death_callback
1010
__asan_update_allocation_context
11+
__asan_describe_address
12+
__asan_get_alloc_stack
13+
__asan_get_report_access_size
14+
__asan_get_report_access_type
15+
__asan_get_report_address
16+
__asan_get_report_bp
17+
__asan_get_report_description
18+
__asan_get_report_pc
19+
__asan_get_report_sp
20+
__asan_report_error
21+
__asan_report_present
22+
__asan_set_error_report_callback

0 commit comments

Comments
 (0)