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

arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi gdb fails on Ubuntu 22.04

gdb not working on Ubuntu 22.04 is a well known issue.

[This topic](community.arm.com/.../gcc-arm-11-2-2022-02-x86_64-arm-none-eabi-gdb-fails-on-ubuntu) is focused on gcc-arm-11.2-2022.02-x86_64-arm-none-eabi where gdb doesn'tt work for some missing dependencies.

[The solution](https://community.arm.com/support-forums/f/compilers-and-libraries-forum/52805/gcc-arm-11-2-2022-02-x86_64-arm-none-eabi-gdb-fails-on-ubuntu/178088#178088) said that next release would have a better compatiblity with newer Linux distros.

And so I downloaded the new arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.

gdb doesn't work, but now the error message from`gdb --version`is different:

```

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 0x00007fed232c0c00 (most recent call first):

<no Python frame>

```

This seems related to [this bug](https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1992947)

Is there any workaround?

Parents
  • For Ubuntu, specifically, do you have python installed? Do you have python alternatives configured? It may be a workaround that will allow gdb to find the python dependencies.

    For example (assuming you have /usr/bin/python3.8 and /usr/bin/python3 installed).

    --

    sudo update-alternatives --install /usr/local/bin/python python /usr/bin/python3.8 1

    sudo update-alternatives --install /usr/local/bin/python python /usr/bin/python3 2

    sudo update-alternatives --install /usr/local/bin/python python

    --

    Then, to select a default python, use the following:

    sudo update-alternatives --config python

Reply
  • For Ubuntu, specifically, do you have python installed? Do you have python alternatives configured? It may be a workaround that will allow gdb to find the python dependencies.

    For example (assuming you have /usr/bin/python3.8 and /usr/bin/python3 installed).

    --

    sudo update-alternatives --install /usr/local/bin/python python /usr/bin/python3.8 1

    sudo update-alternatives --install /usr/local/bin/python python /usr/bin/python3 2

    sudo update-alternatives --install /usr/local/bin/python python

    --

    Then, to select a default python, use the following:

    sudo update-alternatives --config python

Children