diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-02-18 08:44:54 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-02-18 08:44:54 +0100 |
| commit | b89ca872800f8f7d20101d976c4b9c5df09741f7 (patch) | |
| tree | 6030e78c02bc5da71b5dc7aa9af6e433811d1c2b | |
| parent | ca84f1092194d302493c419f219712f6e29146fd (diff) | |
| download | box64-b89ca872800f8f7d20101d976c4b9c5df09741f7.tar.gz box64-b89ca872800f8f7d20101d976c4b9c5df09741f7.zip | |
Imrpoved a bit backtrace again
| -rwxr-xr-x | src/elfs/elfloader.c | 18 | ||||
| -rwxr-xr-x | tests/test19 | bin | 24408 -> 20288 bytes | |||
| -rw-r--r-- | tests/test19.c | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c index ec0b344c..9f6a4741 100755 --- a/src/elfs/elfloader.c +++ b/src/elfs/elfloader.c @@ -157,7 +157,7 @@ int CalcLoadAddr(elfheader_t* head) const char* ElfName(elfheader_t* head) { if(!head) - return "(noelf)"; + return "box64"; return head->name; } const char* ElfPath(elfheader_t* head) @@ -1353,6 +1353,22 @@ const char* FindNearestSymbolName(elfheader_t* h, void* p, uintptr_t* start, uin const char* ret = NULL; uintptr_t s = 0; uint64_t size = 0; + #ifdef HAVE_TRACE + if(!h) { + if(getProtection((uintptr_t)p)&(PROT_READ)) { + if(*(uint8_t*)(p)==0xCC && *(uint8_t*)(p+1)=='S' && *(uint8_t*)(p+2)=='C') { + ret = getBridgeName(*(void**)(p+3+8)); + if(ret) { + if(start) + *start = (uintptr_t)p; + if(sz) + *sz = 32; + } + } + } + return ret; + } + #endif if(!h || h->fini_done) return ret; diff --git a/tests/test19 b/tests/test19 index c3ab3033..6155399c 100755 --- a/tests/test19 +++ b/tests/test19 Binary files differdiff --git a/tests/test19.c b/tests/test19.c index 545f8f99..f65137d1 100644 --- a/tests/test19.c +++ b/tests/test19.c @@ -42,6 +42,8 @@ void myfunc3() p = strchr(strings[j], ':'); if(!p) p = strings[j]; + if(!strcmp(p, ":ExitEmulation")) + p = "???"; printf("%s\n", p); } free(strings); |