-
Notifications
You must be signed in to change notification settings - Fork 171
Implement runtime stacktraces #1344
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
Merged
Thirumalai-Shaktivel
merged 41 commits into
lcompilers:main
from
Thirumalai-Shaktivel:runtime_stacktrace
Jan 13, 2023
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
3a77c13
Add unwind_callback in lfortran intrinsics
Thirumalai-Shaktivel 8df8fae
Implement get_stacktrace_addresses()
certik 9a17532
Add print_stacktrace_addresses()
certik b1a930d
Implement call_print_stacktrace_addresses()
certik 4f9c936
Implement get_local_addresses
Thirumalai-Shaktivel 4c5f769
Add emit_loc for Assert in LLVM
Thirumalai-Shaktivel 21868bd
Store binary_filename in the struct Stacktrace
Thirumalai-Shaktivel 4d2fb08
Implement get_local_info_dwarfdump
Thirumalai-Shaktivel aa7a36b
Implement dat_convert.py
Thirumalai-Shaktivel d71d05c
Print Stacktrace
Thirumalai-Shaktivel 400a591
Add colors and format the stacktrace
Thirumalai-Shaktivel ea7d029
Move link.h into the .c file
certik 12e9f7f
Use HAVE_LFORTRAN_LINK in the .c file
certik 60f9786
Fix a warning with %lld
certik d4fae4b
Put the increment on a separate line
certik 2646e26
Move all the stacktrace related items to .c file,
Thirumalai-Shaktivel 5375e0b
Print stacktrace in assert during the exit
Thirumalai-Shaktivel 5b5afaf
Add print_stacktrace for the Stop and ErrorStop node
Thirumalai-Shaktivel 66f28cc
Update gitignore
Thirumalai-Shaktivel d09f7e6
Use command line argument to get the filename in dat_convert
Thirumalai-Shaktivel ab405e7
Generate the stacktrace files using a function
Thirumalai-Shaktivel 63064ab
Print stacktrace without color and styles
Thirumalai-Shaktivel 03fe068
Add debug_emit_loc in Stop and ErrorStop
Thirumalai-Shaktivel d9622a6
Add run_with_dbg in run_tests
Thirumalai-Shaktivel 044b898
Pass the `filename` to `get_base_name` function
Thirumalai-Shaktivel c655231
Use `strtol` to convert string to long int
Thirumalai-Shaktivel 485cfd7
Use `dsymutil` to generate the required files for stacktrace in macOS
Thirumalai-Shaktivel 66d017d
Implement `get_local_address` for macOS
Thirumalai-Shaktivel 338eb0a
Define the arguments for the print_stacktrace function
Thirumalai-Shaktivel bb56119
Store the source_filename and use it to get the base_name
Thirumalai-Shaktivel a547e64
Get only the executable file's local_pc
Thirumalai-Shaktivel cb6f365
Fix the format specifier warnings
Thirumalai-Shaktivel 268c430
Print the correct the stacktrace information,
Thirumalai-Shaktivel 4dc7c2d
Use Libasr as a target_include_directories for lpython_runtime
Thirumalai-Shaktivel b8f648b
Increase the malloc size for the command
Thirumalai-Shaktivel 58f133a
Enclose the runtime stacktrace handling within the HAVE_RUNTIME_STACK…
Thirumalai-Shaktivel 59df7fd
Enable Runtime Stacktrace in the CI
Thirumalai-Shaktivel 3708557
Generate the runtime_stacktrace related files during the compile-time
Thirumalai-Shaktivel b9d0738
Add a warning to use an option to print correct location info
Thirumalai-Shaktivel f00fe46
Add a test and update refs.
Thirumalai-Shaktivel 70323bb
[MacOS] Ignore other file information except the source binary
Thirumalai-Shaktivel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from struct import unpack | ||
from sys import argv | ||
from re import sub | ||
|
||
lines = "" | ||
with open(argv[1], "rb") as f: | ||
lines = f.read() | ||
|
||
list = [] | ||
for i in range(0, len(lines), 24): | ||
list.append(sub('[(),]', '', str(unpack("3Q", lines[i:i+24])))) | ||
|
||
with open(argv[1] + ".txt", "w") as f: | ||
j = 0 | ||
for i in list: | ||
f.write(i+'\n') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test here that we are running on Linux. Otherwise let's not run this test, since it doesn't work yet on other platforms.