4

When I try to run gdb, i see below python exceptions. wanted to know 1. what these python exceptions mean 2. will it impact anyway in gdb debugging or bt analysis. 3. How to resolve these errors.

Traceback (most recent call last):
  File "/usr/share/gdb/python/gdb/__init__.py", line 144, in auto_load_packages
    __import__(modname)
  File "/usr/share/gdb/python/gdb/function/strfns.py", line 105, in <module>
    _MemEq()
  File "/usr/share/gdb/python/gdb/function/strfns.py", line 33, in __init__
    super(_MemEq, self).__init__("_memeq")
LookupError: no codec search functions registered: can't find encoding

Python Exception <type 'exceptions.LookupError'> no codec search functions registered: can't find encoding:
Python Exception <type 'exceptions.LookupError'> no codec search functions registered: can't find encoding:
Python Exception <type 'exceptions.LookupError'> no codec search functions registered: can't find encoding:
Traceback (most recent call last):
  File "/usr/share/gdb/python/gdb/__init__.py", line 144, in auto_load_packages
    __import__(modname)
  File "/usr/share/gdb/python/gdb/command/prompt.py", line 65, in <module>
    _ExtendedPrompt()
  File "/usr/share/gdb/python/gdb/command/prompt.py", line 44, in __init__
    self.value = ''
LookupError: no codec search functions registered: can't find encoding


GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-none-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
2
  • What is the origin of this GDB? Did you build it yourself? Commented Apr 28, 2020 at 13:53
  • @Employed Russian, GDB is built as part of our yocto build for custom embedded board Commented Apr 28, 2020 at 14:09

1 Answer 1

3

what these python exceptions mean

GDB (when compiled with --enable-python (default)) loads certain builtin embedded Python scripts. This loading fails, because either the GDB make install wasn't performed, or (more likely here) the Python install is incomplete.

will it impact anyway in gdb debugging or bt analysis.

Yes: GDB relies on a lot of embedded Python functionality, and it's likely that you will get these exceptions for almost every command.

How to resolve these errors.

Make sure that you copied complete installation (including data subdirectories and .pyc files) for both the GDB and Python to the system on which you are running GDB.

Alternatively, configuring GDB with --disable-python should clear these errors as well.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.