Skip to content

[Bug] GEF installation error with GDB 8.2 with Python3.6 bindings #1049

@krithikasb

Description

@krithikasb

GEF+GDB version

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

Operating System

Ubuntu 16.04.6 LTS

Describe the issue you encountered

Installing gef with gdb 8.2 with Python 3.6 bindings results in this error:

After this when I do gdb -q, I get:

Traceback (most recent call last):
  File "~/.gef-.py", line 86, in <module>
ImportError: cannot import name 'Literal'

image

However, it works if I use a previous version of gef:

image

Possible cause

It could have been caused by this change: cf824ac#diff-938d7f70ced09ad19db4c7483448b0814adafb564d10c9a3c04ed5e8a6357123L86-R88 since from typing import Literal will not work for Python versions less than 3.8

Do you read the docs and look at previously closed issues/PRs for similar cases?

Yes

Architecture impacted

  • X86
  • X64
  • ARM
  • ARM64
  • MIPS
  • MIPS64
  • PPC
  • PPC64
  • RISCV

Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.

Download gdb 8.2 from https://ftp.gnu.org/gnu/gdb/gdb-8.2.tar.gz, then unpack using tar -xzvf gdb-8.2.tar.gz and cd to the folder.

./configure --with-python=/usr/bin/python3.6

make

sudo make install

bash -c "$(curl -fsSL https://gef.blah.cat/sh)"

After this when I do gdb -q, I get:

Traceback (most recent call last):
  File "~/.gef-.py", line 86, in <module>
ImportError: cannot import name 'Literal'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions