Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

aarch64-none-linux-gnu-gdb ( version 12.3) cannot run, with python errors

Hi,

I download the newest aarch64 linux toolchain(version 12.3) from:

https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-eabi.tar.xz?rev=420215e7c8d14d90b5227eb5486d8c75&hash=315EF6A79273453E2306E2E9F52D80E1

When I exec the command

aarch64-none-linux-gnu-gdb

It shows:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python'
sys.base_prefix = '/usr'
sys.base_exec_prefix = '/usr'
sys.executable = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python'
sys.prefix = '/usr'
sys.exec_prefix = '/usr'
sys.path = [
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
'/usr/lib/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f1c07ce7c00 (most recent call first):
<no Python frame>

My machine is ubuntu2204 and the default python is 3.10.12.

So I set the PYTHONPATH and PATHONHOME to:

export  PYTHONPATH=/usr/bin/:~/.local/lib/python3.10/:/usr/lib/python3.10/

export PYTHONHOME=/usr/bin/

Then it shows:

Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
Traceback (most recent call last):
File "/usr/lib/python3.10/io.py", line 54, in <module>
ImportError: cannot import name 'text_encoding' from 'io' (unknown location)

Does Anybody have ideas? Thanks a lot.

Br,

Yingchun Li

Parents
  • Just more info, I used 

    strace aarch64-none-linux-gnu-gdb

    There are a lot of info shows that aarch64-none-linux-gnu-gdb try to use the specific version python3.8?

    some infos like this:

    openat(AT_FDCWD, "/home/user/toolchain/gcc/arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu/share/gdb/python/gdb/__pycache__/types.cpython-38.pyc", O_RDONLY|O_CLOEXEC)

    So I  change the default version to python3.8,  Now it run into another problem when exec the command

    aarch64-none-linux-gnu-gdb vmlinux

    "

    Reading symbols from vmlinux...
    Traceback (most recent call last):
    File "/home/user/work/mainline-linux/linux/vmlinux-gdb.py", line 30, in <module>
    import linux.config
    File "/home/user/work/mainline-linux/linux/scripts/gdb/linux/config.py", line 6, in <module>
    import zlib
    ModuleNotFoundError: No module named 'zlib'

    "

    Br,

    Yingchun Li

Reply
  • Just more info, I used 

    strace aarch64-none-linux-gnu-gdb

    There are a lot of info shows that aarch64-none-linux-gnu-gdb try to use the specific version python3.8?

    some infos like this:

    openat(AT_FDCWD, "/home/user/toolchain/gcc/arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu/share/gdb/python/gdb/__pycache__/types.cpython-38.pyc", O_RDONLY|O_CLOEXEC)

    So I  change the default version to python3.8,  Now it run into another problem when exec the command

    aarch64-none-linux-gnu-gdb vmlinux

    "

    Reading symbols from vmlinux...
    Traceback (most recent call last):
    File "/home/user/work/mainline-linux/linux/vmlinux-gdb.py", line 30, in <module>
    import linux.config
    File "/home/user/work/mainline-linux/linux/scripts/gdb/linux/config.py", line 6, in <module>
    import zlib
    ModuleNotFoundError: No module named 'zlib'

    "

    Br,

    Yingchun Li

Children