Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

jdemeyer
Copy link
Contributor

@jdemeyer jdemeyer commented Jun 24, 2019

@jdemeyer
Copy link
Contributor Author

CC @encukou

@jdemeyer
Copy link
Contributor Author

Bugfix, so should be backported to all earlier versions.

Copy link
Member

@vstinner vstinner left a 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.

@bedevere-bot
Copy link

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@jdemeyer
Copy link
Contributor Author

jdemeyer commented Jun 26, 2019

So how would you suggest to fix bpo-37382?

@vstinner
Copy link
Member

https://bugs.python.org/issue37382 is not a bug.

@jdemeyer
Copy link
Contributor Author

At least part of it is a bug: test_gdb fails when compiling CPython with -O0 -g0.

But the real issue for me is that test_gdb is not run by default. This PR addresses that.

@csabella csabella requested a review from encukou January 16, 2020 11:41
@encukou encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 11, 2020
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @encukou for commit c964c18 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 11, 2020
Copy link
Member

@vstinner vstinner left a 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
Copy link
Member

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'
Copy link
Member

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``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add ".. versionadded:: 3.9".

@encukou
Copy link
Member

encukou commented Jan 15, 2024

Sorry for missing the ping back in 2019.
This PR has been superseded by #110026 (and others).
The current settings probably skip more than they need to, so the issue might still be relevant -- but a PR for that should now skip fewer tests rather than more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants