Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'cmdebug' when sourcing in gdb #40

Open
EarthLord opened this issue Jan 18, 2022 · 2 comments
Open

Comments

@EarthLord
Copy link

Hello @bnahill and co developers

Thanks for this tool. I came across it in this Interrupt blog. So I cloned the repo, installed it with python3 with setup.py. Then in gdb I tried

source ~/PyCortexDebug/cmdebug/svd_gdb.py

which gives the following error

Traceback (most recent call last):
  File "~/PyCortexDebug/cmdebug/svd_gdb.py", line 26, in <module>
ModuleNotFoundError: No module named 'cmdebug'

Any obvious thing that I am missing? Thanks.

@bnahill
Copy link
Owner

bnahill commented Jan 19, 2022

Is there a chance your GDB is built with Python2? This is surprisingly common still these days. Try installing the python2 branch and see if it picks it up.

@lukebayes
Copy link

Just reporting here in case someone else bumps into this error.

After seeing this response, I verified that my gdb-multiarch is built with Python3.x.

To verify, I ran the following inside my gdb prompt:

(gdb) py
>import sys
>print(sys.version)
>end
3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0]

To fix the issue, I had to run the following in this project directory:

pip3 install ./

After that, I was able to load the python file from GDB and got past this step.

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

No branches or pull requests

3 participants