Trepan-Debuggers / Trepan-Debuggers/python3-trepan
Problems with conditional breakpoints defined with "break {...} if {condition}" command.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 176
- Forks
- 17
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hi,
I have been testing conditional breakpoints, but I have found some problems applying the condition directly when defining the breakpoints:
Python script used as example:
import sys
def main(arguments):
for i in range(10):
print(i)
print("Test")
if __name__ == '__main__':
main(sys.argv)
Defining condition in break-point creation:
trepan3k --highlight=plain --different test.py
(/tmp/python_example/test.py:1): <module>
-> 1 import sys
(trepan3k) break 4 if i==5
Breakpoint 1 set at line 4 of file /tmp/python_example/test.py
(trepan3k) break 5 if i==3
Breakpoint 2 set at line 5 of file /tmp/python_example/test.py
(trepan3k) info break
Num Type Disp Enb Where
-----------------------------------
1 breakpoint keep y at /tmp/python_example/test.py:4
stop only if if i==5
2 breakpoint keep y at /tmp/python_example/test.py:5
stop only if if i==3
(trepan3k) continue
(/tmp/python_example/test.py:4 @19): main
xx 4 print(i)
When printing breakpoints information, I have seen that 'if' word appears two times in condition definition information (stop only if if ...).
Defining condition after break-point creation:
trepan3k --highlight=plain --different test.py
(/tmp/python_example/test.py:1): <module>
-> 1 import sys
(trepan3k) break 4
Breakpoint 1 set at line 4 of file /tmp/python_example/test.py
(trepan3k) condition 1 i==5
(trepan3k) break 5
Breakpoint 2 set at line 5 of file /tmp/python_example/test.py
(trepan3k) condition 2 i==3
(trepan3k) info break
Num Type Disp Enb Where
-----------------------------------
1 breakpoint keep y at /tmp/python_example/test.py:4
stop only if i==5
2 breakpoint keep y at /tmp/python_example/test.py:5
stop only if i==3
(trepan3k) continue
0
Test
1
Test
2
Test
3
(/tmp/python_example/test.py:5 @29): main
xx 5 print("Test")
(trepan3k) eval i
3
I hope that this information can be helpful.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduce the issue with the shown test.py script and the break 4 if i==5 command, then compare it with setting the condition afterward using condition. Trace the breakpoint command parsing and reporting path; done means inline conditions are displayed without a duplicated if and behave like conditions set afterward.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100