-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-37382: check for debug info before testing GDB #14331
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
Conversation
CC @encukou |
Bugfix, so should be backported to all earlier versions. |
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.
The tests should be skipped if Python is optimized: see the issue.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
So how would you suggest to fix bpo-37382? |
https://bugs.python.org/issue37382 is not a bug. |
At least part of it is a bug: But the real issue for me is that |
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.
Please don't backport this change to Python 3.8 :-) test_gdb is giving me too many headaches :-) For example, it fails if Python is built with -Os.
final_opt = "" | ||
for opt in cflags.split(): | ||
if opt.startswith('-g'): | ||
final_opt = opt |
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.
Why not just returning True here? (and "return False" outside the loop)
for opt in cflags.split(): | ||
if opt.startswith('-g'): | ||
final_opt = opt | ||
return final_opt == '-g' |
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.
Why do you reject "-ggdb"? I heard that it's even better than "-g".
@@ -414,6 +414,11 @@ The :mod:`test.support` module defines the following functions: | |||
Return ``True`` if Python was not built with ``-O0`` or ``-Og``. | |||
|
|||
|
|||
.. function:: python_has_debug_info() | |||
|
|||
Return ``True`` if Python was built with ``-g``. |
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.
Add ".. versionadded:: 3.9".
Sorry for missing the ping back in 2019. |
https://bugs.python.org/issue37382