gh-111744: Support opcode events in bdb#111834
Conversation
|
Hi @brandtbucher , I know you've been busy recently. When you have some time, could you take a look at this? This is the prerequisite for a |
Sorry, something went wrong.
brandtbucher
left a comment
There was a problem hiding this comment.
Thanks a ton for your patience (I really dropped the ball on reviewing this)! I'd love to get your thoughts on a couple of things before merging:
Sorry, something went wrong.
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
Also, I played with this a bit while reviewing, and it's pretty neat. I know time's running out: do you think the rest of the |
Sorry, something went wrong.
|
#103050 was the bigger ambition to directly support instruction level debugging back then. It was not easy to push something that big at that time when I did not have some basic reputation of "this person knows what he's doing". That one was kind of abandoned and the most critical part (supporting opcode event in general) was adopted into this PR. I will try to pursue it again in 3.14, alongwith some other more ambitious targets, but that's after the language summit :) And to your question, I will finish the breakpoint change by the end of tomorrow and see if we can make it in 3.13. |
Sorry, something went wrong.
Let me know if there's anything I can do to help, besides being available for review. I think it's a great change. |
Sorry, something went wrong.
|
I had the prototype working once it should not be too difficult. Although this might break some tests - now that it stopped after the instruction after |
Sorry, something went wrong.
|
I'm ready to land this once |
Sorry, something went wrong.
|
I used |
Sorry, something went wrong.
brandtbucher
left a comment
There was a problem hiding this comment.
Sorry, spotted one more thing:
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot iOS ARM64 Simulator 3.x has failed when building commit f34e965. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/1380/builds/199 Summary of the results of the build (if available): Click to see traceback logsremote: Enumerating objects: 22, done.
remote: Counting objects: 4% (1/22)
remote: Counting objects: 9% (2/22)
remote: Counting objects: 13% (3/22)
remote: Counting objects: 18% (4/22)
remote: Counting objects: 22% (5/22)
remote: Counting objects: 27% (6/22)
remote: Counting objects: 31% (7/22)
remote: Counting objects: 36% (8/22)
remote: Counting objects: 40% (9/22)
remote: Counting objects: 45% (10/22)
remote: Counting objects: 50% (11/22)
remote: Counting objects: 54% (12/22)
remote: Counting objects: 59% (13/22)
remote: Counting objects: 63% (14/22)
remote: Counting objects: 68% (15/22)
remote: Counting objects: 72% (16/22)
remote: Counting objects: 77% (17/22)
remote: Counting objects: 81% (18/22)
remote: Counting objects: 86% (19/22)
remote: Counting objects: 90% (20/22)
remote: Counting objects: 95% (21/22)
remote: Counting objects: 100% (22/22)
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 11% (1/9)
remote: Compressing objects: 22% (2/9)
remote: Compressing objects: 33% (3/9)
remote: Compressing objects: 44% (4/9)
remote: Compressing objects: 55% (5/9)
remote: Compressing objects: 66% (6/9)
remote: Compressing objects: 77% (7/9)
remote: Compressing objects: 88% (8/9)
remote: Compressing objects: 100% (9/9)
remote: Compressing objects: 100% (9/9), done.
remote: Total 12 (delta 10), reused 3 (delta 2), pack-reused 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to 'f34e965e52b9bdf157b829371870edfde45b80bf'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at f34e965e52 GH-111744: Support opcode events in bdb (GH-111834)
Switched to and reset branch 'main'
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
../../Objects/frameobject.c:240:57: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_keys(PyObject *self, PyObject *__unused)
^
../../Objects/frameobject.c:391:59: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_values(PyObject *self, PyObject *__unused)
^
../../Objects/frameobject.c:419:58: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_items(PyObject *self, PyObject *__unused)
^
../../Objects/frameobject.c:568:61: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_reversed(PyObject *self, PyObject *__unused)
^
4 warnings generated.
../../Python/import.c:1057:13: warning: variable 'key' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (_extensions_cache_init() < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Python/import.c:1095:9: note: uninitialized use occurs here
if (key != NULL) {
^~~
../../Python/import.c:1057:9: note: remove the 'if' if its condition is always false
if (_extensions_cache_init() < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Python/import.c:1063:5: note: variable 'key' is declared here
void *key = NULL;
^
../../Python/import.c:1195:1: warning: unused function 'is_core_module' [-Wunused-function]
is_core_module(PyInterpreterState *interp, PyObject *name, PyObject *path)
^
2 warnings generated.
../../Python/pystate.c:1125:1: warning: unused function 'check_interpreter_whence' [-Wunused-function]
check_interpreter_whence(long whence)
^
1 warning generated.
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
../../Objects/frameobject.c:240:57: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_keys(PyObject *self, PyObject *__unused)
^
../../Objects/frameobject.c:391:59: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_values(PyObject *self, PyObject *__unused)
^
../../Objects/frameobject.c:419:58: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_items(PyObject *self, PyObject *__unused)
^
../../Objects/frameobject.c:568:61: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_reversed(PyObject *self, PyObject *__unused)
^
4 warnings generated.
../../Python/import.c:1057:13: warning: variable 'key' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (_extensions_cache_init() < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Python/import.c:1095:9: note: uninitialized use occurs here
if (key != NULL) {
^~~
../../Python/import.c:1057:9: note: remove the 'if' if its condition is always false
if (_extensions_cache_init() < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Python/import.c:1063:5: note: variable 'key' is declared here
void *key = NULL;
^
1 warning generated.
../../Modules/_sqlite/connection.c:1307:14: warning: 'sqlite3_create_window_function' is only available on iOS 13.0 or newer [-Wunguarded-availability-new]
rc = sqlite3_create_window_function(self->db, name, num_params, flags,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk/usr/include/sqlite3.h:5533:16: note: 'sqlite3_create_window_function' has been marked as being introduced in iOS 13.0 here, but the deployment target is iOS 12.0.0
SQLITE_API int sqlite3_create_window_function(
^
../../Modules/_sqlite/connection.c:1307:14: note: enclose 'sqlite3_create_window_function' in a __builtin_available check to silence this warning
rc = sqlite3_create_window_function(self->db, name, num_params, flags,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Modules/_sqlite/connection.c:1315:14: warning: 'sqlite3_create_window_function' is only available on iOS 13.0 or newer [-Wunguarded-availability-new]
rc = sqlite3_create_window_function(self->db, name, num_params, flags,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk/usr/include/sqlite3.h:5533:16: note: 'sqlite3_create_window_function' has been marked as being introduced in iOS 13.0 here, but the deployment target is iOS 12.0.0
SQLITE_API int sqlite3_create_window_function(
^
../../Modules/_sqlite/connection.c:1315:14: note: enclose 'sqlite3_create_window_function' in a __builtin_available check to silence this warning
rc = sqlite3_create_window_function(self->db, name, num_params, flags,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
xcodebuild: error: 'iOSTestbed.arm64-iphonesimulator.1714834279/iOSTestbed.xcodeproj' does not exist.
Traceback (most recent call last):
File "<string>", line 1, in <module>
import sys, json; result = json.load(sys.stdin); print(result['subsections']['_values'][1]['subsections']['_values'][0]['emittedOutput']['_value'])
~~~~~~^^^^^^^^^^^^^^^
KeyError: 'subsections'
make: *** [testios] Error 1 |
Sorry, something went wrong.
This is the first step to solve #111744 . After some discussion in discord, most of the developers like the idea to have
breakpoint()break immediately, rather than on next event. In order to achieve that, we need to use the opcode events.This PR is just to lay the ground for opcode events. In general, the users can use opcode events now with a new set of API -
set_stepinstr()anduser_opcode(). The documentation is not updated on purpose - if we prefer to keep it internal now and just use it as an infra to support newbreakpoint(), we can keep quiet about it. If we decide to make it available to public, I can write the docs.breakpointdoes not enter pdb until the "next event" happens #111744