Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hlc stack trace to Linux/Mac #634

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

yuxiaomao
Copy link
Collaborator

Following #632 , I tried some implementation for hlc stack trace on Linux/MacOS using <execinfo.h>.

I did not use libunwind, as it does not seems to be adapted to the current structure: uwn_backtrace does not have more collaboration with other functions; resolve symbol of a single address would require to iterate though the stack.

I made a simple test with main() calling SimpleTest.hx, try catch and display the stack.

On Linux (gcc parameter -rdynamic is necessary to resolve function name):

Called from module ./bin/c/hlout/a.out(haxe_Exception_thrown+0x13d) [0x55f5d42fa5ed]
Called from module ./bin/c/hlout/a.out(SimpleTest_runThrowTest+0x617) [0x55f5d43024e7]
Called from module ./bin/c/hlout/a.out(fun$init+0x2156) [0x55f5d4306236]

On Mac:

Called from module 0   a.out                               0x0000000102f6aeb9 hlc_capture_stack + 9
Called from module 0   libhl.dylib                         0x000000010b639c07 hl_throw + 151
Called from module 0   a.out                               0x0000000102f76635 SimpleTest_runThrowTest + 661
Called from module 0   a.out                               0x0000000102f7c87f fun$init + 2447

@yuxiaomao yuxiaomao merged commit a21544c into HaxeFoundation:master Nov 27, 2023
8 checks passed
@skial skial mentioned this pull request Nov 28, 2023
1 task
crazyjul pushed a commit to playdigious/hashlink that referenced this pull request Jan 18, 2024
@yuxiaomao yuxiaomao deleted the dev-stacktrace branch February 8, 2024 13:36
RandomityGuy pushed a commit to RandomityGuy/hashlink that referenced this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant