python / python/cpython

remote pdb can not attach when breakpoint() and exit

オープン
#139,688 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

stdlib type-bug
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:

reproduce

on terminal

./python.exe
breakpoint()
# ctrl + D

another terminal

sudo ./python.exe -m pdb -p $(pid)

more can check png below
Image

Image

debug:

Pdb._last_pdb_instance still when do_quit in repl so remote pdb can not exec in it

fix:

diff --git a/Lib/pdb.py b/Lib/pdb.py
index f695a39332..3e32c50f96 100644
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -2008,6 +2008,7 @@ def do_quit(self, arg):
                     return
 
         self._user_requested_quit = True
+        Pdb._last_pdb_instance = None
         self.set_quit()
         return 1
 

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs
  • gh-139690

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Lib/pdb.py の Pdb.do_quit から始め、提案された変更を確認する前に、issue にある breakpoint() と exit のシーケンスを再現してください。ローカルデバッガを終了すると、後から remote pdb attach できることを検証し、すでに進行中の作業についてリンクされた PR gh-139690 を確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
devtools
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。