textual-debugger 0.2.16__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. textual_debugger-0.3.0/PKG-INFO +165 -0
  2. textual_debugger-0.3.0/README.md +92 -0
  3. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/pyproject.toml +11 -4
  4. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/__init__.py +1 -1
  5. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/_timeouts.py +24 -0
  6. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/Devel/TdbRemote.pm +12 -0
  7. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/session.py +16 -0
  8. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/app.py +121 -11
  9. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/app_handlers/dap_events.py +10 -1
  10. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/app_helpers.py +4 -40
  11. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/breakpoint_hook.py +1 -0
  12. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/cli.py +154 -47
  13. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/dap/client.py +61 -3
  14. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/dap/messages.py +42 -12
  15. textual_debugger-0.3.0/src/tdb/docs/about.md +48 -0
  16. textual_debugger-0.3.0/src/tdb/docs/automation/json-rpc.md +100 -0
  17. textual_debugger-0.3.0/src/tdb/docs/automation/mcp.md +101 -0
  18. textual_debugger-0.3.0/src/tdb/docs/automation/record-replay.md +49 -0
  19. textual_debugger-0.3.0/src/tdb/docs/index.md +83 -0
  20. textual_debugger-0.3.0/src/tdb/docs/installation.md +25 -0
  21. textual_debugger-0.3.0/src/tdb/docs/languages/bash.md +27 -0
  22. textual_debugger-0.3.0/src/tdb/docs/languages/c-cpp-fortran.md +153 -0
  23. textual_debugger-0.3.0/src/tdb/docs/languages/go.md +113 -0
  24. textual_debugger-0.3.0/src/tdb/docs/languages/index.md +214 -0
  25. textual_debugger-0.3.0/src/tdb/docs/languages/ocaml.md +148 -0
  26. textual_debugger-0.3.0/src/tdb/docs/languages/perl.md +170 -0
  27. textual_debugger-0.3.0/src/tdb/docs/languages/powershell.md +67 -0
  28. textual_debugger-0.3.0/src/tdb/docs/languages/ruby.md +53 -0
  29. textual_debugger-0.3.0/src/tdb/docs/languages/rust.md +111 -0
  30. textual_debugger-0.3.0/src/tdb/docs/languages/tcsh.md +32 -0
  31. textual_debugger-0.3.0/src/tdb/docs/python/async-tasks.md +38 -0
  32. textual_debugger-0.3.0/src/tdb/docs/python/attach-to-process.md +134 -0
  33. textual_debugger-0.3.0/src/tdb/docs/python/breakpoint-hook.md +51 -0
  34. textual_debugger-0.3.0/src/tdb/docs/python/post-mortem.md +47 -0
  35. textual_debugger-0.3.0/src/tdb/docs/python/processes.md +32 -0
  36. textual_debugger-0.3.0/src/tdb/docs/python/pytest.md +44 -0
  37. textual_debugger-0.3.0/src/tdb/docs/python/threads.md +21 -0
  38. textual_debugger-0.3.0/src/tdb/docs/quickstart.md +97 -0
  39. textual_debugger-0.3.0/src/tdb/docs/reference/cli.md +93 -0
  40. textual_debugger-0.3.0/src/tdb/docs/reference/configuration.md +100 -0
  41. textual_debugger-0.3.0/src/tdb/docs/tutorial-mcp-debugging.md +314 -0
  42. textual_debugger-0.3.0/src/tdb/docs/using/breakpoints.md +26 -0
  43. textual_debugger-0.3.0/src/tdb/docs/using/call-stack.md +4 -0
  44. textual_debugger-0.3.0/src/tdb/docs/using/console.md +33 -0
  45. textual_debugger-0.3.0/src/tdb/docs/using/crash-detection.md +10 -0
  46. textual_debugger-0.3.0/src/tdb/docs/using/debugging-controls.md +47 -0
  47. textual_debugger-0.3.0/src/tdb/docs/using/eval-mode.md +46 -0
  48. textual_debugger-0.3.0/src/tdb/docs/using/evaluate-console.md +70 -0
  49. textual_debugger-0.3.0/src/tdb/docs/using/external-terminal.md +34 -0
  50. textual_debugger-0.3.0/src/tdb/docs/using/keybindings.md +116 -0
  51. textual_debugger-0.3.0/src/tdb/docs/using/layout.md +22 -0
  52. textual_debugger-0.3.0/src/tdb/docs/using/remote-attach.md +67 -0
  53. textual_debugger-0.3.0/src/tdb/docs/using/run-mode.md +119 -0
  54. textual_debugger-0.3.0/src/tdb/docs/using/variables.md +47 -0
  55. textual_debugger-0.3.0/src/tdb/docs/using/vim-edit-mode.md +165 -0
  56. textual_debugger-0.3.0/src/tdb/documentation.py +149 -0
  57. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/eval_mode.py +1 -1
  58. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/inspection.py +8 -0
  59. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/keybindings/__init__.py +17 -13
  60. textual_debugger-0.3.0/src/tdb/languages/_python_adapter.py +114 -0
  61. textual_debugger-0.3.0/src/tdb/languages/_python_gdb_helper.py +327 -0
  62. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/base.py +31 -0
  63. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/bash.py +1 -1
  64. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/cpp.py +1 -0
  65. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/errors.py +1 -1
  66. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/go.py +2 -1
  67. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/ocaml.py +2 -1
  68. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/perl.py +1 -1
  69. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/powershell.py +1 -1
  70. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/python.py +116 -4
  71. textual_debugger-0.3.0/src/tdb/languages/python_attach.py +1005 -0
  72. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/registry.py +7 -1
  73. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/ruby.py +1 -1
  74. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/rust.py +1 -0
  75. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/tcsh.py +2 -1
  76. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/mcp/session.py +1 -1
  77. textual_debugger-0.3.0/src/tdb/mkdocs.yml +114 -0
  78. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/post_mortem.py +1 -1
  79. textual_debugger-0.3.0/src/tdb/pytest_debugger.py +169 -0
  80. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/run_mode.py +67 -28
  81. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/probes/base.py +4 -1
  82. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/server/runner.py +39 -14
  83. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/controller.py +131 -23
  84. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/state.py +16 -7
  85. textual_debugger-0.3.0/src/tdb/source_discovery.py +163 -0
  86. textual_debugger-0.3.0/src/tdb/terminal_text.py +140 -0
  87. textual_debugger-0.3.0/src/tdb/vi/__init__.py +31 -0
  88. textual_debugger-0.3.0/src/tdb/vi/bindings.py +1673 -0
  89. textual_debugger-0.3.0/src/tdb/vi/engine.py +2257 -0
  90. textual_debugger-0.3.0/src/tdb/vi/ex.py +591 -0
  91. textual_debugger-0.3.0/src/tdb/vi/global_cmd.py +513 -0
  92. textual_debugger-0.3.0/src/tdb/vi/marks.py +192 -0
  93. textual_debugger-0.3.0/src/tdb/vi/search.py +86 -0
  94. textual_debugger-0.3.0/src/tdb/vi/substitute.py +267 -0
  95. textual_debugger-0.3.0/src/tdb/vi/textedit.py +109 -0
  96. textual_debugger-0.3.0/src/tdb/vi/textobjects.py +593 -0
  97. textual_debugger-0.3.0/src/tdb/widgets/code_editor.py +708 -0
  98. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/code_view.py +57 -16
  99. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/console_view.py +5 -3
  100. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/modals.py +1 -1
  101. textual_debugger-0.3.0/src/tdb/widgets/source_modal.py +105 -0
  102. textual_debugger-0.3.0/src/textual_debugger.egg-info/PKG-INFO +165 -0
  103. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/textual_debugger.egg-info/SOURCES.txt +60 -1
  104. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/textual_debugger.egg-info/requires.txt +2 -1
  105. textual_debugger-0.2.16/PKG-INFO +0 -2702
  106. textual_debugger-0.2.16/README.md +0 -2630
  107. textual_debugger-0.2.16/src/tdb/README.md +0 -2630
  108. textual_debugger-0.2.16/src/tdb/widgets/code_editor.py +0 -738
  109. textual_debugger-0.2.16/src/textual_debugger.egg-info/PKG-INFO +0 -2702
  110. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/LICENSE +0 -0
  111. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/setup.cfg +0 -0
  112. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/__main__.py +0 -0
  113. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/__init__.py +0 -0
  114. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/bash/__init__.py +0 -0
  115. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/bash/__main__.py +0 -0
  116. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/bash/arith_for.py +0 -0
  117. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/bash/declares.py +0 -0
  118. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/bash/server.py +0 -0
  119. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/bash/session.py +0 -0
  120. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/bash/tdb_harness.sh +0 -0
  121. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/native/__init__.py +0 -0
  122. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/native/gdb_stl_printers.py +0 -0
  123. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/native/tdb.h +0 -0
  124. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/ocaml/__init__.py +0 -0
  125. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/ocaml/lldb_formatters.py +0 -0
  126. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/Devel/TdbCompile.pm +0 -0
  127. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/__init__.py +0 -0
  128. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/__main__.py +0 -0
  129. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/helpers.pl +0 -0
  130. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/padwalker.py +0 -0
  131. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/padwalker_src/Makefile.PL +0 -0
  132. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/padwalker_src/PadWalker.pm +0 -0
  133. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/padwalker_src/PadWalker.xs +0 -0
  134. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/protocol.py +0 -0
  135. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/refs.py +0 -0
  136. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/perl/server.py +0 -0
  137. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/powershell/__init__.py +0 -0
  138. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/powershell/__main__.py +0 -0
  139. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/powershell/locate.py +0 -0
  140. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/powershell/output.py +0 -0
  141. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/powershell/server.py +0 -0
  142. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/powershell/tdb_launch.ps1 +0 -0
  143. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/ruby/__init__.py +0 -0
  144. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/ruby/__main__.py +0 -0
  145. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/ruby/server.py +0 -0
  146. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/ruby/tdb.rb +0 -0
  147. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/seqs.py +0 -0
  148. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/__init__.py +0 -0
  149. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/__main__.py +0 -0
  150. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/breakpoints.py +0 -0
  151. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/cli.py +0 -0
  152. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/guardian.py +0 -0
  153. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/inspect.py +0 -0
  154. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/instrumenter.py +0 -0
  155. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/models.py +0 -0
  156. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/protocol.py +0 -0
  157. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/runtime.py +0 -0
  158. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/scanner.py +0 -0
  159. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/server.py +0 -0
  160. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/session.py +0 -0
  161. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/adapters/tcsh/transport.py +0 -0
  162. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/app_handlers/__init__.py +0 -0
  163. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/app_handlers/inspection.py +0 -0
  164. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/app_handlers/routing.py +0 -0
  165. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/app_handlers/ui_panels.py +0 -0
  166. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/dap/__init__.py +0 -0
  167. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/dap/protocol.py +0 -0
  168. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/dap/reverse.py +0 -0
  169. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/dap/types.py +0 -0
  170. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examine.py +0 -0
  171. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/C/breakpoint_hook_demo.c +0 -0
  172. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/C/pi_digits.c +0 -0
  173. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/C++/breakpoint_hook_demo.cpp +0 -0
  174. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/C++/pi_digits.cpp +0 -0
  175. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Fortran/breakpoint_hook_demo.f90 +0 -0
  176. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Fortran/pi_digits.f90 +0 -0
  177. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Go/breakpoint_hook_demo/go.mod +0 -0
  178. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Go/breakpoint_hook_demo/main.go +0 -0
  179. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Go/pi_digits.go +0 -0
  180. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/OCaml/breakpoint_hook_demo.ml +0 -0
  181. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/OCaml/pi_digits.ml +0 -0
  182. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Perl/breakpoint_hook_demo.pl +0 -0
  183. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Perl/pi_digits.pl +0 -0
  184. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/PowerShell/pi_digits.ps1 +0 -0
  185. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Python/pi_digits.py +0 -0
  186. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Ruby/breakpoint_hook_demo.rb +0 -0
  187. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Ruby/pi_digits.rb +0 -0
  188. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Rust/breakpoint_hook_demo/Cargo.toml +0 -0
  189. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Rust/breakpoint_hook_demo/src/main.rs +0 -0
  190. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/Rust/pi_digits.rs +0 -0
  191. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/bash/pi_digits.sh +0 -0
  192. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/examples/tcsh/pi_digits.tcsh +0 -0
  193. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/go_concurrency/__init__.py +0 -0
  194. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/go_concurrency/analyzer.py +0 -0
  195. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/go_concurrency/classifier.py +0 -0
  196. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/go_concurrency/collector.py +0 -0
  197. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/go_concurrency/models.py +0 -0
  198. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/info.py +0 -0
  199. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/inspection_full.py +0 -0
  200. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/__init__.py +0 -0
  201. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/languages/native_tools.py +0 -0
  202. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/mcp/__init__.py +0 -0
  203. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/mcp/__main__.py +0 -0
  204. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/mcp/server.py +0 -0
  205. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/persist.py +0 -0
  206. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/processes_cache.py +0 -0
  207. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/replay.py +0 -0
  208. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/replay_tui.py +0 -0
  209. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/__init__.py +0 -0
  210. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/analyzer.py +0 -0
  211. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/classifier.py +0 -0
  212. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/collector.py +0 -0
  213. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/models.py +0 -0
  214. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/probes/__init__.py +0 -0
  215. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/probes/gdb.py +0 -0
  216. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/probes/gdb_script.py +0 -0
  217. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/probes/lldb.py +0 -0
  218. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/rust_concurrency/probes/lldb_script.py +0 -0
  219. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/server/__init__.py +0 -0
  220. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/server/app.py +0 -0
  221. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/server/event_handler.py +0 -0
  222. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/server/handlers.py +0 -0
  223. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/server/rpc_types.py +0 -0
  224. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/__init__.py +0 -0
  225. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/breakpoint_sync.py +0 -0
  226. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/child_processes.py +0 -0
  227. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/errors.py +0 -0
  228. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/event_bus.py +0 -0
  229. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/inspect_service.py +0 -0
  230. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/messages.py +0 -0
  231. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/post_mortem_loader.py +0 -0
  232. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/recorder.py +0 -0
  233. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/statement_stepper.py +0 -0
  234. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/terminal.py +0 -0
  235. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/session/textual_handler.py +0 -0
  236. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/source_analysis.py +0 -0
  237. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/source_edit.py +0 -0
  238. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/__init__.py +0 -0
  239. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/_inspection_modal.py +0 -0
  240. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/async_tasks_modal.py +0 -0
  241. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/breakpoint_view.py +0 -0
  242. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/evaluate_console.py +0 -0
  243. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/full_contents_modal.py +0 -0
  244. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/goroutines_modal.py +0 -0
  245. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/menu_bar.py +0 -0
  246. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/processes_modal.py +0 -0
  247. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/rust_concurrency_modal.py +0 -0
  248. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/stack_view.py +0 -0
  249. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/status_bar.py +0 -0
  250. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/threads_modal.py +0 -0
  251. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/tdb/widgets/variable_view.py +0 -0
  252. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/textual_debugger.egg-info/dependency_links.txt +0 -0
  253. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/textual_debugger.egg-info/entry_points.txt +0 -0
  254. {textual_debugger-0.2.16 → textual_debugger-0.3.0}/src/textual_debugger.egg-info/top_level.txt +0 -0
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.4
2
+ Name: textual-debugger
3
+ Version: 0.3.0
4
+ Summary: A TUI debugger for Python, Perl, and other languages. Based on textual.
5
+ Author-email: Al Danial <al.danial@gmail.com>
6
+ License: textual-debugger is licensed to you under the MIT/X Consortium license:
7
+
8
+ Copyright (c) 2026 Albert Danial
9
+
10
+ Permission is hereby granted, free of charge, to any person
11
+ obtaining a copy of this software and associated documentation
12
+ files (the "Software"), to deal in the Software without
13
+ restriction, including without limitation the rights to use,
14
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the
16
+ Software is furnished to do so, subject to the following
17
+ conditions:
18
+
19
+ The above copyright notice and this permission notice shall be
20
+ included in all copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
24
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
27
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29
+ OTHER DEALINGS IN THE SOFTWARE.
30
+
31
+
32
+ Project-URL: Homepage, https://github.com/AlDanial/tdb
33
+ Project-URL: Issues, https://github.com/AlDanial/tdb/issues
34
+ Project-URL: Source, https://github.com/AlDanial/tdb
35
+ Keywords: debugger,tui,textual,debugpy,debug,DAP
36
+ Classifier: Development Status :: 4 - Beta
37
+ Classifier: Environment :: Console
38
+ Classifier: Intended Audience :: Developers
39
+ Classifier: License :: OSI Approved :: MIT License
40
+ Classifier: Operating System :: POSIX :: Linux
41
+ Classifier: Programming Language :: Python :: 3
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Programming Language :: Python :: 3.13
45
+ Classifier: Programming Language :: Python :: 3.14
46
+ Classifier: Programming Language :: Python :: 3.15
47
+ Classifier: Topic :: Software Development :: Debuggers
48
+ Requires-Python: >=3.11
49
+ Description-Content-Type: text/markdown
50
+ License-File: LICENSE
51
+ Requires-Dist: textual>=8.0.0
52
+ Requires-Dist: debugpy>=1.8.20
53
+ Requires-Dist: pygments>=2.17.0
54
+ Requires-Dist: fastapi>=0.115.0
55
+ Requires-Dist: uvicorn>=0.30.0
56
+ Requires-Dist: prompt_toolkit<3.1,>=3.0.52
57
+ Provides-Extra: edit
58
+ Requires-Dist: textual[syntax]>=8.0.0; extra == "edit"
59
+ Provides-Extra: mcp
60
+ Requires-Dist: mcp<3.0.0,>=2.0.0; extra == "mcp"
61
+ Provides-Extra: dev
62
+ Requires-Dist: textual-debugger[mcp]; extra == "dev"
63
+ Requires-Dist: pytest; extra == "dev"
64
+ Requires-Dist: pytest-cov; extra == "dev"
65
+ Requires-Dist: pytest-asyncio; extra == "dev"
66
+ Requires-Dist: httpx; extra == "dev"
67
+ Requires-Dist: matplotlib; extra == "dev"
68
+ Requires-Dist: pyyaml; extra == "dev"
69
+ Requires-Dist: toml; extra == "dev"
70
+ Requires-Dist: ruff; extra == "dev"
71
+ Requires-Dist: ipython; extra == "dev"
72
+ Dynamic: license-file
73
+
74
+ # `textual-debugger`
75
+
76
+ `textual-debugger` (the package) provides `tdb` (the command-line tool and module),
77
+ a full-featured terminal-based debugger for Python and other languages
78
+ with a Debug Adapter Protocol (DAP) implementation. In addition to Python,
79
+ `tdb` comes with built-in support for
80
+ - C, C++, Fortran (via `gdb` or `lldb-dap`)
81
+ - Rust (via `gdb` or `lldb-dap`, selected explicitly)
82
+ - Perl (via `perl -d`)
83
+ - Bash (via bash's own `DEBUG` trap; bash ≥ 4.4)
84
+ - Tcsh (via source instrumentation of a stock `tcsh`)
85
+ - Ruby (via the [debug gem](https://github.com/ruby/debug)'s `rdbg`; debug ≥ 1.9)
86
+ - OCaml (native via `lldb-dap`/`gdb`, bytecode via [ocamlearlybird](https://github.com/hackwaly/ocamlearlybird))
87
+ - Go (via [Delve](https://github.com/go-delve/delve)'s `dlv dap`)
88
+ - PowerShell 7 (via [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices); Linux/macOS, Windows experimental)
89
+
90
+ **Documentation: https://textual-debugger.readthedocs.io/**
91
+ (also available offline with `tdb --doc`, or as plain text with `tdb --doc-text`)
92
+
93
+ - PyPI: https://pypi.org/project/textual-debugger/
94
+ - GitHub: https://github.com/AlDanial/tdb
95
+
96
+ MIT License. Copyright 2026 by Al Danial.
97
+
98
+ ## Highlights
99
+
100
+ - Debugs synchronous, asynchronous, multi-threaded, and multi-process Python,
101
+ with inspectors for `asyncio` tasks (including a task wait graph), threads,
102
+ and `multiprocessing` / `concurrent.futures` children
103
+ - Attach to a running Python (3.11+), C/C++, Go, Rust, or OCaml program
104
+ by PID, with no preparation
105
+ - Remote attach to Python, Perl, Ruby, Rust, C/C++, and Go programs
106
+ - JSON-RPC server, MCP (v2) server, and a `SKILL.md` for headless and
107
+ AI-assisted debugging
108
+ - Can run the debuggee in an external terminal to debug TUI applications
109
+ - Post-mortem exception hook and live breakpoint hooks (`tdb.breakpoint()` and
110
+ its counterparts in Perl, Ruby, Go, C/C++/Fortran, Rust, and OCaml)
111
+ - `pytest --pdbcls=tdb.pytest_debugger:Debugger` integration
112
+ - Run mode (`--run`) to attach the TUI to a running job on Ctrl-C, and eval
113
+ mode (`--eval`) to print expressions at chosen lines without the TUI
114
+ - Entirely keyboard-driven, with vim, emacs, and Notepad-style keybindings;
115
+ mouse support in graphical environments
116
+
117
+ ## Gallery
118
+
119
+ <p align="center">
120
+ <img src="https://raw.githubusercontent.com/AlDanial/tdb/main/gallery/async_breakpoint.png" alt="at breakpoint" width="300">
121
+ <img src="https://raw.githubusercontent.com/AlDanial/tdb/main/gallery/async_task_graph.png" alt="task graph" width="300">
122
+ <img src="https://raw.githubusercontent.com/AlDanial/tdb/main/gallery/multiprocessing_process_3.png" alt="multiple processes" width="300">
123
+ <img src="https://raw.githubusercontent.com/AlDanial/tdb/main/gallery/threading_list.png" alt="thread list" width="300">
124
+ </p>
125
+
126
+ Videos:
127
+ - [tdb basics](https://youtu.be/2_qf2WZDHuA) views, keybindings, breakpoints, stepping, variable modification, call stack
128
+ - [asyncio tasks](https://youtu.be/vM4tODuqMGg) inspect asyncio tasks and their wait graph; code mod to allow pause
129
+ - [threads and processes](https://youtu.be/J8LOARLs2oQ) inspect variables and call stacks in multiple threads and processes
130
+ - [external terminal](https://youtu.be/121aihjAQ8g) run the debuggee in a separate terminal--ideal for debugging TUI applications
131
+
132
+ ## Installation
133
+
134
+ ```bash
135
+ uv pip install textual-debugger # or: pip install textual-debugger
136
+ uvx --from textual-debugger tdb my_program.py # run without installing
137
+ pip install "textual-debugger[mcp]" # add the optional MCP server
138
+ ```
139
+
140
+ ## Quick Start
141
+
142
+ ```bash
143
+ tdb --doc # full documentation in a terminal Markdown viewer
144
+ tdb --info # versions and locations of tdb, its config, and every debugger it would use
145
+ tdb my_program.py arg1 arg2 # debug a Python program (stops at the first line)
146
+ tdb -k 20 -k module.py:14 my_program.py # run to breakpoints
147
+ tdb -k module.py:27 --if "a > 7" my_program.py # ... stopping only when a > 7
148
+ tdb ./myprog # debug a native executable built with -g
149
+ tdb script.pl # ... or a Perl, Bash, Tcsh, Ruby, PowerShell script
150
+ tdb -a 12345 # attach to a running Python program by PID
151
+ tdb -r remotehost:5678 # attach to a remote debugpy server
152
+ ```
153
+
154
+ See the [Quick Start](https://textual-debugger.readthedocs.io/quickstart/)
155
+ page for many more examples, and the
156
+ [CLI Reference](https://textual-debugger.readthedocs.io/reference/cli/)
157
+ for every option.
158
+
159
+ ## Acknowledgments
160
+
161
+ `tdb` is built with Will McGugan's [textual](https://github.com/Textualize/textual)
162
+ and Microsoft's [debugpy](https://github.com/microsoft/debugpy), and was
163
+ inspired by Andreas Klöckner's [pudb](https://pypi.org/project/pudb/).
164
+ See [About](https://textual-debugger.readthedocs.io/about/) for the full
165
+ acknowledgments.
@@ -0,0 +1,92 @@
1
+ # `textual-debugger`
2
+
3
+ `textual-debugger` (the package) provides `tdb` (the command-line tool and module),
4
+ a full-featured terminal-based debugger for Python and other languages
5
+ with a Debug Adapter Protocol (DAP) implementation. In addition to Python,
6
+ `tdb` comes with built-in support for
7
+ - C, C++, Fortran (via `gdb` or `lldb-dap`)
8
+ - Rust (via `gdb` or `lldb-dap`, selected explicitly)
9
+ - Perl (via `perl -d`)
10
+ - Bash (via bash's own `DEBUG` trap; bash ≥ 4.4)
11
+ - Tcsh (via source instrumentation of a stock `tcsh`)
12
+ - Ruby (via the [debug gem](https://github.com/ruby/debug)'s `rdbg`; debug ≥ 1.9)
13
+ - OCaml (native via `lldb-dap`/`gdb`, bytecode via [ocamlearlybird](https://github.com/hackwaly/ocamlearlybird))
14
+ - Go (via [Delve](https://github.com/go-delve/delve)'s `dlv dap`)
15
+ - PowerShell 7 (via [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices); Linux/macOS, Windows experimental)
16
+
17
+ **Documentation: https://textual-debugger.readthedocs.io/**
18
+ (also available offline with `tdb --doc`, or as plain text with `tdb --doc-text`)
19
+
20
+ - PyPI: https://pypi.org/project/textual-debugger/
21
+ - GitHub: https://github.com/AlDanial/tdb
22
+
23
+ MIT License. Copyright 2026 by Al Danial.
24
+
25
+ ## Highlights
26
+
27
+ - Debugs synchronous, asynchronous, multi-threaded, and multi-process Python,
28
+ with inspectors for `asyncio` tasks (including a task wait graph), threads,
29
+ and `multiprocessing` / `concurrent.futures` children
30
+ - Attach to a running Python (3.11+), C/C++, Go, Rust, or OCaml program
31
+ by PID, with no preparation
32
+ - Remote attach to Python, Perl, Ruby, Rust, C/C++, and Go programs
33
+ - JSON-RPC server, MCP (v2) server, and a `SKILL.md` for headless and
34
+ AI-assisted debugging
35
+ - Can run the debuggee in an external terminal to debug TUI applications
36
+ - Post-mortem exception hook and live breakpoint hooks (`tdb.breakpoint()` and
37
+ its counterparts in Perl, Ruby, Go, C/C++/Fortran, Rust, and OCaml)
38
+ - `pytest --pdbcls=tdb.pytest_debugger:Debugger` integration
39
+ - Run mode (`--run`) to attach the TUI to a running job on Ctrl-C, and eval
40
+ mode (`--eval`) to print expressions at chosen lines without the TUI
41
+ - Entirely keyboard-driven, with vim, emacs, and Notepad-style keybindings;
42
+ mouse support in graphical environments
43
+
44
+ ## Gallery
45
+
46
+ <p align="center">
47
+ <img src="https://raw.githubusercontent.com/AlDanial/tdb/main/gallery/async_breakpoint.png" alt="at breakpoint" width="300">
48
+ <img src="https://raw.githubusercontent.com/AlDanial/tdb/main/gallery/async_task_graph.png" alt="task graph" width="300">
49
+ <img src="https://raw.githubusercontent.com/AlDanial/tdb/main/gallery/multiprocessing_process_3.png" alt="multiple processes" width="300">
50
+ <img src="https://raw.githubusercontent.com/AlDanial/tdb/main/gallery/threading_list.png" alt="thread list" width="300">
51
+ </p>
52
+
53
+ Videos:
54
+ - [tdb basics](https://youtu.be/2_qf2WZDHuA) views, keybindings, breakpoints, stepping, variable modification, call stack
55
+ - [asyncio tasks](https://youtu.be/vM4tODuqMGg) inspect asyncio tasks and their wait graph; code mod to allow pause
56
+ - [threads and processes](https://youtu.be/J8LOARLs2oQ) inspect variables and call stacks in multiple threads and processes
57
+ - [external terminal](https://youtu.be/121aihjAQ8g) run the debuggee in a separate terminal--ideal for debugging TUI applications
58
+
59
+ ## Installation
60
+
61
+ ```bash
62
+ uv pip install textual-debugger # or: pip install textual-debugger
63
+ uvx --from textual-debugger tdb my_program.py # run without installing
64
+ pip install "textual-debugger[mcp]" # add the optional MCP server
65
+ ```
66
+
67
+ ## Quick Start
68
+
69
+ ```bash
70
+ tdb --doc # full documentation in a terminal Markdown viewer
71
+ tdb --info # versions and locations of tdb, its config, and every debugger it would use
72
+ tdb my_program.py arg1 arg2 # debug a Python program (stops at the first line)
73
+ tdb -k 20 -k module.py:14 my_program.py # run to breakpoints
74
+ tdb -k module.py:27 --if "a > 7" my_program.py # ... stopping only when a > 7
75
+ tdb ./myprog # debug a native executable built with -g
76
+ tdb script.pl # ... or a Perl, Bash, Tcsh, Ruby, PowerShell script
77
+ tdb -a 12345 # attach to a running Python program by PID
78
+ tdb -r remotehost:5678 # attach to a remote debugpy server
79
+ ```
80
+
81
+ See the [Quick Start](https://textual-debugger.readthedocs.io/quickstart/)
82
+ page for many more examples, and the
83
+ [CLI Reference](https://textual-debugger.readthedocs.io/reference/cli/)
84
+ for every option.
85
+
86
+ ## Acknowledgments
87
+
88
+ `tdb` is built with Will McGugan's [textual](https://github.com/Textualize/textual)
89
+ and Microsoft's [debugpy](https://github.com/microsoft/debugpy), and was
90
+ inspired by Andreas Klöckner's [pudb](https://pypi.org/project/pudb/).
91
+ See [About](https://textual-debugger.readthedocs.io/about/) for the full
92
+ acknowledgments.
@@ -23,10 +23,11 @@
23
23
  ]
24
24
  dependencies = [
25
25
  "textual>=8.0.0",
26
- "debugpy>=1.8.12",
26
+ "debugpy>=1.8.20",
27
27
  "pygments>=2.17.0",
28
28
  "fastapi>=0.115.0",
29
29
  "uvicorn>=0.30.0",
30
+ "prompt_toolkit>=3.0.52,<3.1",
30
31
  ]
31
32
 
32
33
  # extras needed to run the examples and tests
@@ -62,11 +63,17 @@
62
63
  [tool.setuptools.packages.find]
63
64
  where = ["src"]
64
65
  include = ["tdb", "tdb.*"]
65
- # examples/ is package data (see below), not importable modules.
66
- exclude = ["tdb.examples", "tdb.examples.*"]
66
+ # examples/ and docs/ are package data (see below), not importable modules.
67
+ exclude = ["tdb.examples", "tdb.examples.*", "tdb.docs", "tdb.docs.*"]
67
68
 
68
69
  [tool.setuptools.package-data]
69
- tdb = ["README.md", "adapters/perl/helpers.pl", "adapters/perl/padwalker_src/PadWalker.pm", "adapters/perl/padwalker_src/PadWalker.xs", "adapters/perl/padwalker_src/Makefile.PL", "adapters/perl/Devel/TdbRemote.pm", "adapters/perl/Devel/TdbCompile.pm", "adapters/ruby/tdb.rb", "adapters/bash/tdb_harness.sh", "adapters/powershell/tdb_launch.ps1", "adapters/native/tdb.h", "rust_concurrency/probes/gdb_script.py", "rust_concurrency/probes/lldb_script.py",
70
+ tdb = [
71
+ # Documentation pages shown by `tdb --doc` / `--doc-text` (tdb.documentation).
72
+ # src/tdb/docs and src/tdb/mkdocs.yml are symlinks to the repository's
73
+ # docs/ and mkdocs.yml; per-directory globs keep docs/superpowers/ out.
74
+ "mkdocs.yml", "docs/*.md", "docs/languages/*.md", "docs/using/*.md",
75
+ "docs/python/*.md", "docs/automation/*.md", "docs/reference/*.md",
76
+ "adapters/perl/helpers.pl", "adapters/perl/padwalker_src/PadWalker.pm", "adapters/perl/padwalker_src/PadWalker.xs", "adapters/perl/padwalker_src/Makefile.PL", "adapters/perl/Devel/TdbRemote.pm", "adapters/perl/Devel/TdbCompile.pm", "adapters/ruby/tdb.rb", "adapters/bash/tdb_harness.sh", "adapters/powershell/tdb_launch.ps1", "adapters/native/tdb.h", "rust_concurrency/probes/gdb_script.py", "rust_concurrency/probes/lldb_script.py",
70
77
  # Per-language examples, shown by `tdb --info` ("examples dir").
71
78
  # src/tdb/examples is a symlink to the repository's examples/;
72
79
  # extension globs keep build outputs (Rust target/, binaries) out.
@@ -1,6 +1,6 @@
1
1
  from tdb.breakpoint_hook import breakpoint
2
2
  from tdb.post_mortem import exception_hook
3
3
 
4
- __version__ = "0.2.16" # trailing digit odd == dev version
4
+ __version__ = "0.3.0" # trailing digit odd == dev version
5
5
 
6
6
  __all__ = ["breakpoint", "exception_hook"]
@@ -60,6 +60,10 @@ ADAPTER_LISTEN = 15.0
60
60
  ADAPTER_EXIT_GRACE = 2.0
61
61
  """Timeout for spawn_tcp adapter to announce its listening port."""
62
62
 
63
+ # How long a stopping adapter gets to exit after SIGTERM, then again after
64
+ # SIGKILL. A wedged gdb takes SIGTERM and never acts on it.
65
+ ADAPTER_STOP_GRACE = 5.0
66
+
63
67
  # Run-mode examine reads each child process's threads and stacks in
64
68
  # turn. A child that is mid-fork or wedged in native code can leave
65
69
  # `threads` unanswered; bound it so one slow child can't stall the
@@ -75,3 +79,23 @@ EXAMINE_CHILD = 2.0
75
79
  # arbitrary-but-comfortable for typical interactive sessions.
76
80
  RPC_STEP_WAIT = 600.0
77
81
  """How long the RPC `_step_action` blocks awaiting the next stop."""
82
+
83
+ # `tdb -a PID` on Python. `sys.remote_exec` reports success as soon as the
84
+ # script is queued, and the script never runs while the main thread is
85
+ # blocked, so tdb waits this long for it to connect and then falls back.
86
+ # The slowest success measured was 3.9s, behind a C call holding the GIL.
87
+ PID_ATTACH_REMOTE_EXEC = 5.0
88
+ # How long the adapter gets to start listening before tdb gives up without
89
+ # injecting anything.
90
+ PID_ATTACH_LISTEN = 10.0
91
+ # Ceiling for injection as a whole, whichever method is used.
92
+ PID_ATTACH_TOTAL = 30.0
93
+ # Quitting mid-injection first lets the handshake finish, for this long:
94
+ # pydevd waits for it forever if the adapter goes away.
95
+ PID_ATTACH_QUIT = 5.0
96
+ # An injected target must answer `threads` within this; if it can't, no
97
+ # later request will get a reply either.
98
+ PID_ATTACH_RESPONSE = 5.0
99
+ # With no stop by this long after attaching, the program isn't running
100
+ # Python code and a pause can't land; the TUI says so.
101
+ PID_ATTACH_BLOCKED_NOTICE = 3.0
@@ -51,7 +51,19 @@ BEGIN {
51
51
  $^P = 0x73f unless $^P & 0x02;
52
52
  unless ( defined &DB::DB ) {
53
53
  package DB;
54
+ # perl5db runs any .perldb in the current directory; see
55
+ # PERL5DB_FROM_ROOT in session.py.
56
+ require Cwd;
57
+ my ($here) = ( Cwd::getcwd() // '' ) =~ /\A(.*)\z/s; # Untainted.
58
+ opendir( my $back, '.' );
59
+ my $can_return = length $here || $back;
60
+ chdir '/' if $can_return;
54
61
  require 'perl5db.pl';
62
+ if ($can_return) {
63
+ ( length $here && chdir $here )
64
+ or eval { $back && chdir $back }
65
+ or warn "Devel::TdbRemote: cannot return to $here: $!\n";
66
+ }
55
67
  }
56
68
  }
57
69
 
@@ -27,6 +27,20 @@ log = logging.getLogger(__name__)
27
27
  RunInTerminal = Callable[[list[str], str, dict[str, str]], Awaitable[None]]
28
28
 
29
29
 
30
+ # perl -d runs this in place of its plain require. perl5db runs any .perldb in
31
+ # the current directory, and tdb may be started in a directory that has nothing
32
+ # to do with the program. The directory comes as a path because all chdir then
33
+ # needs is search permission, and it works the same on Windows; a directory
34
+ # handle covers a path that can't be followed. Both variables go, so that a
35
+ # perl the program starts is left as it would be.
36
+ PERL5DB_FROM_ROOT = (
37
+ "BEGIN { my ($here) = delete($ENV{TDB_PERL_CWD}) =~ /\\A(.*)\\z/s; "
38
+ "delete $ENV{PERL5DB}; opendir(my $back, '.'); chdir '/'; "
39
+ "require 'perl5db.pl'; chdir $here or eval { $back && chdir $back } "
40
+ 'or die "cannot return to $here: $!\\n"; }'
41
+ )
42
+
43
+
30
44
  class PerlProtocolError(Exception):
31
45
  def __init__(self, message: str, tail: str = "") -> None:
32
46
  super().__init__(message)
@@ -184,6 +198,8 @@ class PerlSession:
184
198
  adapters_dir = os.path.dirname(helpers_path())
185
199
  shim_path = compile_shim_path()
186
200
  compile_shim_available = os.path.isfile(shim_path)
201
+ child_env["PERL5DB"] = PERL5DB_FROM_ROOT
202
+ child_env["TDB_PERL_CWD"] = os.path.abspath(cwd)
187
203
  argv = [perl, "-d"]
188
204
  if compile_shim_available:
189
205
  child_env["TDB_COMPILE_FILE"] = program
@@ -16,13 +16,19 @@ from textual.message import Message
16
16
  from textual.widgets import Footer, Header, OptionList
17
17
  from textual.widgets._tree import TreeNode
18
18
 
19
+ from tdb import _timeouts
19
20
  from tdb.app_handlers.routing import _AppMessageRoutes
20
21
  from tdb.languages.base import AdapterNotFoundError
22
+ from tdb.languages.python_attach import PidAttachCancelled, PidAttachError
21
23
  from tdb.session.controller import DebugController
24
+ from tdb.terminal_text import keep_writer_draining, terminal_hung_up
22
25
  from tdb.session.messages import DapStopped
26
+ from tdb.session.state import SessionPhase
23
27
  from tdb.session.textual_handler import TextualEventHandler
24
28
  from tdb.keybindings import KeybindingConfig, Mode
25
29
  from tdb.source_edit import remap_breakpoints
30
+ from tdb.source_discovery import discover_sources
31
+ from tdb.widgets.source_modal import SourceModal
26
32
  from tdb.widgets.breakpoint_view import BreakpointView
27
33
  from tdb.widgets.code_editor import _UnsavedChangesModal
28
34
  from tdb.widgets.code_view import CodeView, _BreakpointConditionModal, looks_binary
@@ -44,7 +50,7 @@ from tdb.widgets.modals import (
44
50
  from tdb.widgets.full_contents_modal import FullContentsModal
45
51
  from tdb.widgets.stack_view import StackView
46
52
  from tdb.widgets.status_bar import StatusBar
47
- from tdb.app_helpers import about_text, find_readme, unquote_dap_string
53
+ from tdb.app_helpers import about_text, unquote_dap_string
48
54
  from tdb.persist import (
49
55
  TdbConfig,
50
56
  load_breakpoints,
@@ -146,6 +152,7 @@ class TdbApp(_AppMessageRoutes, App):
146
152
  # convention. So we bind both forms for File; a user pressing Alt+F
147
153
  # gets ctrl+right delivered to tdb, which still opens the menu.
148
154
  Binding("alt+f,ctrl+right", "menu_file", "File menu", show=False),
155
+ Binding("alt+s", "menu_source", "Source files", show=False, priority=True),
149
156
  Binding("alt+c", "menu_configure", "Configure menu", show=False),
150
157
  Binding("alt+e", "menu_edit", "Edit menu", show=False),
151
158
  Binding("alt+t", "menu_threads", "Threads", show=False),
@@ -186,7 +193,7 @@ class TdbApp(_AppMessageRoutes, App):
186
193
  python: str | None = None,
187
194
  terminal: str | None = None,
188
195
  config: TdbConfig | None = None,
189
- cli_breakpoints: list[tuple[str, int, bool]] | None = None,
196
+ cli_breakpoints: list[tuple[str, int, bool, str | None]] | None = None,
190
197
  attach_host: str | None = None,
191
198
  attach_port: int | None = None,
192
199
  path_mappings: list[tuple[str, str]] | None = None,
@@ -200,9 +207,12 @@ class TdbApp(_AppMessageRoutes, App):
200
207
  adopted_handler: "SwappableEventHandler | None" = None,
201
208
  adopted_stop: tuple | None = None,
202
209
  replay_driver: "ReplayDriver | None" = None,
210
+ source_files: list[Path] | None = None,
203
211
  ) -> None:
204
212
  super().__init__()
213
+ keep_writer_draining()
205
214
  self._program = program
215
+ self._source_files = source_files or []
206
216
  self._replay_driver = replay_driver
207
217
  # Set by the DAP stopped/terminated handlers once the panels
208
218
  # reflect a *final* stop (statement-mode intermediate stops never
@@ -315,7 +325,7 @@ class TdbApp(_AppMessageRoutes, App):
315
325
  action_labels["async-tasks-label"] = "Async Tasks"
316
326
  # File > Open is language-aware: the picker filters to the
317
327
  # profile's extensions and validates the pick (action_open_file).
318
- leading_action_labels = {"open-file-label": "File"}
328
+ leading_action_labels = {"open-file-label": "File", "source-label": "Source"}
319
329
  yield MenuBar(
320
330
  {
321
331
  "Edit": [
@@ -348,6 +358,7 @@ class TdbApp(_AppMessageRoutes, App):
348
358
  yield Footer()
349
359
 
350
360
  def on_mount(self) -> None:
361
+ self.set_interval(2.0, self._exit_if_terminal_hung_up)
351
362
  if self._config.theme and self._config.theme in self.available_themes:
352
363
  self.theme = self._config.theme
353
364
 
@@ -682,11 +693,13 @@ class TdbApp(_AppMessageRoutes, App):
682
693
  log.exception("Failed to start debug session")
683
694
  self._startup_error = f"tdb: {exc.hint}"
684
695
  self.exit(return_code=2)
685
- except ConnectionError as exc:
696
+ except PidAttachCancelled:
697
+ self.exit()
698
+ except (ConnectionError, PidAttachError) as exc:
686
699
  # The adapter was found but died before serving DAP (a gdb
687
- # without a DAP interpreter, a debugpy import failure, ...).
688
- # DAPClient folds its stderr and any diagnosis into the
689
- # message; an empty TUI titled "Failed to start" would hide
700
+ # without a DAP interpreter, a debugpy import failure, ...),
701
+ # or injection into a Python target failed. The message says
702
+ # why; an empty TUI titled "Failed to start" would hide
690
703
  # exactly the line the user needs.
691
704
  log.exception("Failed to start debug session")
692
705
  self._startup_error = f"tdb: {exc}"
@@ -695,6 +708,27 @@ class TdbApp(_AppMessageRoutes, App):
695
708
  log.exception("Failed to start debug session")
696
709
  self.sub_title = "Failed to start"
697
710
 
711
+ def announce_pid_attach(self) -> None:
712
+ """Say how a Python target was reached, and warn later if it
713
+ never stops: a blocked program can't be paused."""
714
+ method = self.controller.attach_method
715
+ if method is None:
716
+ return
717
+ self.notify(f"Attached using {method}.", title="Attach")
718
+ if self._pause_on_attach:
719
+ self.set_timer(_timeouts.PID_ATTACH_BLOCKED_NOTICE, self._warn_if_blocked)
720
+
721
+ def _warn_if_blocked(self) -> None:
722
+ if self.controller.state.phase is SessionPhase.RUNNING:
723
+ self.notify(
724
+ "The program is not running Python code, so pause can't land "
725
+ "yet; it is probably blocked in a system call. Breakpoints "
726
+ "fire when it next runs Python.",
727
+ title="Attach",
728
+ severity="warning",
729
+ timeout=15,
730
+ )
731
+
698
732
  @work(group="remote-source")
699
733
  async def _fetch_remote_source(self, path: str) -> None:
700
734
  """Ask the adapter for `path`'s content via DAP `source`.
@@ -1741,15 +1775,17 @@ class TdbApp(_AppMessageRoutes, App):
1741
1775
  self.push_screen(_StepModeModal(self.controller.step_mode, on_mode_change))
1742
1776
 
1743
1777
  def action_documentation(self) -> None:
1744
- readme = find_readme()
1745
- if readme is None:
1778
+ from tdb.documentation import load_docs
1779
+
1780
+ docs = load_docs()
1781
+ if docs is None:
1746
1782
  self.notify(
1747
- "README.md not found in the installation.",
1783
+ "Documentation not found in the installation.",
1748
1784
  title="Documentation",
1749
1785
  severity="warning",
1750
1786
  )
1751
1787
  return
1752
- self.push_screen(_DocumentationModal(readme))
1788
+ self.push_screen(_DocumentationModal(docs))
1753
1789
 
1754
1790
  def action_about(self) -> None:
1755
1791
  self.push_screen(_AboutModal(about_text(markup=True)))
@@ -1761,6 +1797,8 @@ class TdbApp(_AppMessageRoutes, App):
1761
1797
  ) -> None:
1762
1798
  if message.label_id == "open-file-label":
1763
1799
  self.action_open_file()
1800
+ elif message.label_id == "source-label":
1801
+ self.action_menu_source()
1764
1802
  elif message.label_id == "threads-label":
1765
1803
  self._open_threads()
1766
1804
  elif message.label_id == "processes-label":
@@ -1781,6 +1819,58 @@ class TdbApp(_AppMessageRoutes, App):
1781
1819
  self._close_open_menu()
1782
1820
  self.action_open_file()
1783
1821
 
1822
+ @work(group="source-navigation")
1823
+ async def action_menu_source(self) -> None:
1824
+ # A second shortcut must not stack pickers or cancel an edit prompt.
1825
+ if any(
1826
+ isinstance(screen, (SourceModal, _UnsavedChangesModal))
1827
+ for screen in self.screen_stack
1828
+ ):
1829
+ return
1830
+ self._close_open_menu()
1831
+ paths = await asyncio.to_thread(
1832
+ discover_sources,
1833
+ self._program,
1834
+ self._cwd,
1835
+ self._source_files,
1836
+ python=self.controller.profile.id == "python",
1837
+ )
1838
+ if any(
1839
+ isinstance(screen, (SourceModal, _UnsavedChangesModal))
1840
+ for screen in self.screen_stack
1841
+ ):
1842
+ return
1843
+ path = await self.push_screen(
1844
+ SourceModal(paths, Path(self._cwd or Path.cwd()).resolve()),
1845
+ wait_for_dismiss=True,
1846
+ )
1847
+ if not path:
1848
+ return
1849
+ code_view = self.query_one("#code-view", CodeView)
1850
+ if path == code_view.source_path:
1851
+ code_view.focus()
1852
+ return
1853
+ if not await self._confirm_discard_edits():
1854
+ return
1855
+ if code_view.is_editing:
1856
+ code_view.leave_edit_mode(discard=True)
1857
+ code_view.load_file(path)
1858
+ state = self.controller.state
1859
+ code_view.set_breakpoints(state.breakpoints.get(path, []))
1860
+ code_view.set_breakpoints_disabled(state.breakpoints_disabled)
1861
+ frame = next(
1862
+ (f for f in state.stack_frames if f.id == state.current_frame_id), None
1863
+ )
1864
+ code_view.current_line = (
1865
+ frame.line
1866
+ if frame
1867
+ and frame.source
1868
+ and frame.source.path
1869
+ and Path(frame.source.path).resolve() == Path(path)
1870
+ else None
1871
+ )
1872
+ code_view.focus()
1873
+
1784
1874
  def action_menu_configure(self) -> None:
1785
1875
  self.query_one("#menu-bar", MenuBar).open_menu("Configure")
1786
1876
 
@@ -1966,6 +2056,22 @@ class TdbApp(_AppMessageRoutes, App):
1966
2056
  # `controller.stop()` can take a moment when many child DAP
1967
2057
  # sessions need to be torn down — without this guard, a second
1968
2058
  # keypress would spawn another concurrent shutdown.
2059
+ await self._finish_quit()
2060
+
2061
+ def _exit_if_terminal_hung_up(self) -> None:
2062
+ """Nobody can answer a prompt now, so this skips them. Unsaved edits
2063
+ are lost, as they are when a signal ends tdb."""
2064
+ if not terminal_hung_up():
2065
+ return
2066
+ if self._adopted:
2067
+ # Run mode: detaching would reopen a TUI on the dead terminal at
2068
+ # the next stop, so the program ends, as it would on that
2069
+ # terminal without tdb.
2070
+ self.run_worker(self._terminate_now(), name="terminal-gone")
2071
+ else:
2072
+ self.run_worker(self._finish_quit(), name="terminal-gone")
2073
+
2074
+ async def _finish_quit(self) -> None:
1969
2075
  if self._is_quitting:
1970
2076
  return
1971
2077
  self._is_quitting = True
@@ -1995,6 +2101,10 @@ class TdbApp(_AppMessageRoutes, App):
1995
2101
  async def _terminate_and_exit(self) -> None:
1996
2102
  if not await self._confirm_discard_edits():
1997
2103
  return
2104
+ await self._terminate_now()
2105
+
2106
+ async def _terminate_now(self) -> None:
2107
+ # Run mode ignores breakpoints.json, so it never overwrites it.
1998
2108
  if self._is_quitting:
1999
2109
  return
2000
2110
  self._is_quitting = True
@@ -14,6 +14,7 @@ import logging
14
14
  import os
15
15
  from typing import TYPE_CHECKING
16
16
 
17
+ from tdb.languages.python_attach import PidAttachError
17
18
  from tdb.session.messages import DapOutput, DapStopped
18
19
  from tdb.widgets.console_view import ConsoleView
19
20
  from tdb.widgets.modals import DEFAULT_TRACEBACK_HEADER, _TracebackModal
@@ -57,6 +58,10 @@ class DapEventCoordinator:
57
58
  await self.app.controller.do_configure()
58
59
  log.info("do_configure completed")
59
60
  self.app._update_ui_state()
61
+ self.app.announce_pid_attach()
62
+ except PidAttachError as exc:
63
+ self.app._startup_error = f"tdb: {exc}"
64
+ self.app.exit(return_code=2)
60
65
  except Exception as exc:
61
66
  log.exception("Failed to launch")
62
67
  self.app.sub_title = "Launch failed"
@@ -274,7 +279,11 @@ class DapEventCoordinator:
274
279
  if parse_error is None:
275
280
  return
276
281
 
277
- stderr = "".join(self.app._stderr_buffer)
282
+ from tdb.terminal_text import strip_terminal_controls
283
+
284
+ # The debuggee writes stderr; what the dialog shows must not reach
285
+ # tdb's terminal as commands (the console decodes its own copy).
286
+ stderr = strip_terminal_controls("".join(self.app._stderr_buffer))
278
287
  parsed = parse_error(stderr, exit_code)
279
288
  if parsed is None:
280
289
  return