mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert backtrace ban and start printing backtraces from the runtime again (#9528)
* Revert "[strip -ST] Disable runtime stack trace dumping on Darwin when asserts are disabled." This reverts commit6bc28ff1c9. * Bring back important fixes from the revert of6bc28ff1c9. * Change swift::swift_reportError to only print the backtrace in assert builds (swift::warning prints backtrace always).
This commit is contained in:
committed by
GitHub
parent
da08005c06
commit
fc7dbefcf8
@@ -27,10 +27,6 @@
|
||||
#include <link.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef SWIFT_RUNTIME_DLADDR_ALLOW
|
||||
#error "SWIFT_RUNTIME_DLADDR_ALLOW must be defined!"
|
||||
#endif
|
||||
|
||||
using namespace swift;
|
||||
|
||||
/// The symbol name in the image that identifies the beginning of the
|
||||
@@ -162,7 +158,6 @@ void swift_addNewDSOImage(const void *addr) {
|
||||
}
|
||||
|
||||
int swift::lookupSymbol(const void *address, SymbolInfo *info) {
|
||||
#if SWIFT_RUNTIME_DLADDR_ALLOW
|
||||
Dl_info dlinfo;
|
||||
if (dladdr(address, &dlinfo) == 0) {
|
||||
return 0;
|
||||
@@ -173,9 +168,6 @@ int swift::lookupSymbol(const void *address, SymbolInfo *info) {
|
||||
info->symbolName = dlinfo.dli_sname;
|
||||
info->symbolAddress = dlinfo.dli_saddr;
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // defined(__ELF__) || defined(__ANDROID__)
|
||||
|
||||
Reference in New Issue
Block a user