DarkKnight
DarkKnight

Reputation: 657

when running gdb get python exceptions

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"...

Upvotes: 4

Views: 3935

Answers (1)

Employed Russian
Employed Russian

Reputation: 213636

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.

Upvotes: 3

Related Questions