ubuntu20 py3.8从源码安装gdb8.1

前言

有人可能觉得我的标题很奇怪,安装gdb8.1和这些版本有什么关系呢?事实上由于开发者的疏忽,这里有很多bug。

下载安装

从官网下载,或
http://www.linuxfromscratch.org/blfs/view/8.2/general/gdb.html

第一个bug

In file included from /data/repos/arcgnu/gdb/gdb/nat/linux-ptrace.c:20:
/data/repos/arcgnu/gdb/gdb/nat/linux-ptrace.h:175:22: error: expected identifier before numeric constant
 # define TRAP_HWBKPT 4
                      ^
/data/repos/arcgnu/gdb/gdb/nat/linux-ptrace.h:175:22: error: expected ‘}’ before numeric constant
In file included from /data/install/arcgnu8-glibc/arc-snps-linux-gnu/sysroot/usr/include/signal.h:58,
                 from build-gnulib/import/signal.h:52,
                 from /data/install/arcgnu8-glibc/arc-snps-linux-gnu/sysroot/usr/include/sys/wait.h:36,
                 from /data/repos/arcgnu/gdb/gdb/common/gdb_wait.h:23,
                 from /data/repos/arcgnu/gdb/gdb/nat/linux-ptrace.c:24:
/data/install/arcgnu8-glibc/arc-snps-linux-gnu/sysroot/usr/include/bits/siginfo-consts.h:156:1: note: to match this ‘{’
 {
 ^
In file included from /data/repos/arcgnu/gdb/gdb/nat/linux-ptrace.c:20:
/data/repos/arcgnu/gdb/gdb/nat/linux-ptrace.h:175:22: error: expected unqualified-id before numeric constant
 # define TRAP_HWBKPT 4
                      ^
In file included from /data/install/arcgnu8-glibc/arc-snps-linux-gnu/sysroot/usr/include/features.h:450,
                 from /data/install/arcgnu8-glibc/arc-snps-linux-gnu/sysroot/usr/include/bits/libc-header-start.h:33,
                 from /data/install/arcgnu8-glibc/arc-snps-linux-gnu/sysroot/usr/include/stdio.h:27,
                 from build-gnulib/import/stdio.h:43,
                 from /data/repos/arcgnu/gdb/gdb/common/common-defs.h:52,
                 from /data/repos/arcgnu/gdb/gdb/nat/linux-ptrace.c:19:
/data/install/arcgnu8-glibc/arc-snps-linux-gnu/sysroot/usr/include/sys/wait.h:158:1: error: expected declaration before ‘}’ token
 __END_DECLS
 ^~~~~~~~~~~

https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/171

第二个bug

error: too few arguments to function '_PyImport_FixupBuiltin'

解决方案
https://sourceware.org/legacy-ml/gdb-patches/2018-05/msg00863.html

第三个bug

cannot find -lreadline

很明显,这是没有readline库的支持

apt-get install libreadline-dev

尾声

没有第四个了,醉了,只是想降级安装一个gdb都如此麻烦,花了我一个小时

你可能感兴趣的:(基础知识,Tools)