-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Suggestions for implementing flang's built-in functions "backtrace" #117434
Comments
Does |
@tarunprabhu You can see the description of abort in gfortran here https://gcc.gnu.org/onlinedocs/gfortran/ABORT.html. The version I implemented is based on backtrace and backtrace_symbol. I directly output all the backtrace content. Therefore, my version of the implementation seems to have a lot more content than the gfortran version. And you need to add -rdynamic to output the function name (because only in this way will the connector called by flang add the required symbols to the dynamic symbol table, while gfortran adds symbol debugging information through -g) |
What kind of feedback are you looking for? Do you intend to contribute your code to flang? |
@tarunprabhu Oh, my bad, I didn't make it clear enough at first. I just plan to contribute code to flang, and now all I need is a pull request. But I'm a newbie and have never made a pull request. Therefore, in order to avoid causing trouble to everyone, I plan to ask for your opinions in advance. The output difference between gfortran's implementation and my implementation is compared at the top. You can find that I have implemented the core function of outputting backtrace, but the format and content are somewhat different from gfortran, so the suggestions I want are about the output content and format. For example, you can give me suggestions like: "Your output format is not regular, you should add a line number to each line, like gfortran, so it will look clearer.", or suggestions like: "Your output is a bit redundant, you don't need to output content related to function addresses." |
Thank you for being considerate and asking first. The Flang discourse is a better place to get feedback such as this. You can post an RFC there asking if the format is reasonable or if the community would prefer a different output and that you intend to contribute the code to flang. Once get feedback saying that it is ok to proceed with a PR, please do so. There may be more discussion on the PR as well, and several rounds of revisions may be necessary. These are sometimes quick, but can also take some time, so please be prepared for that. |
I notice that gfortran's have a intrinsic function "abort" that can abort and print a backtrace when called.
flang also has it, but it only aborts without printing a backtrace.
So, I modified it for flang, and my implemention is different from gfortran's. So I would like to get some suggestions...
the source is
And, gfortran's backtrace print like:
And my implemention print like:
The text was updated successfully, but these errors were encountered: