Skip to content

Draft: Working towards pdb debugging support. #499

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

andrewleech
Copy link
Contributor

@andrewleech andrewleech commented Jun 16, 2022

Details TBD

Requires: micropython/micropython#8767

@andrewleech
Copy link
Contributor Author

andrewleech commented Jun 16, 2022

BDB Tested with bdb-example-1.zip / https://gist.github.com/Averroes/a208c5883c601992de08
Output doesn't quite match cpython at this stage, but seems to mostly work.

@andrewleech
Copy link
Contributor Author

andrewleech commented Jun 21, 2022

anl@STEP: ~/micropython/ports/unix $ ./micropython-dev -m pdb ../../tests/net_inet/test_tls_sites.py
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(1)<module>()
-> try:
(Pdb) b 48
Breakpoint 1 at /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py:48
(Pdb) c
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(48)main()
-> for site in SITES:
(Pdb) s
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(48)main()
-> for site in SITES:
(Pdb) unt 50
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(50)main()
-> if isinstance(site, dict):
(Pdb) s
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(54)main()
-> try:
(Pdb) s
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(55)main()
-> test_one(site, opts)
(Pdb) s
--Call--
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(14)test_one()
-> def test_one(site, opts):
(Pdb) s
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(15)test_one()
-> ai = _socket.getaddrinfo(site, 443)
(Pdb) s
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(16)test_one()
-> addr = ai[0][-1]
(Pdb) s
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(18)test_one()
-> s = _socket.socket()
(Pdb) s
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(20)test_one()
-> try:
(Pdb) s
> /home/anl/micropython/ports/unix/../../tests/net_inet/test_tls_sites.py(21)test_one()
-> s.connect(addr)
(Pdb) p addr
*** NameError("name 'addr' isn't defined",)
(Pdb) 

@andrewleech
Copy link
Contributor Author

  • As expected, printing a local variable fails.
  • breakpoints seem to be stopped on the previous line... breaking on a function name main didn't work (presumably because it tried to break on previous line number`
  • pretty easy to crash
(Pdb) exit
FATAL: uncaught NLR 0x7f68a6961fa0

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants