Tag Archives: gdb

[Solved] ldd reports an error: not found (the arm version of gdb is exsited)

1. Linaro-gdb cannot be used in the cross-compilation environment.

Reference: https://stackoverflow.com/questions/25314983/ldd-says-not-found-even-though-library-is-in-my-ld-library-path

In the cross-compilation environment, gdb reports an error and lacks libncurses.so.5. But using ldconfig -p | grep libncurses.so.5 can be found.

It may be caused by a conflict between 32-bit and 64-bit. The library is 64-bit, but the program is 32-bit. You can use file to confirm separately.

$ file libpmsfdcwrt.so
libpmsfdcwrt.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

$ file
/lib64/libz.so.1.2.3 /lib64/libz.so.1.2.3: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

 

Solution: Download the 64-bit version of gdb to solve it (from the official website).

GDB debugging report missing separate debuginfos problem solving

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

##Environment:

os: centos 7.3

Problem description

When debugging with GDB, the following error appears

Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.el7_4.2.x86_64 libgcc-4.8.5-16.el7_4.2.x86_64 libstdc++-4.8.5-16.el7_4.2.x86_64 nss-softokn-freebl-3.28.3-8.el7_4.x86_64

Solutions

1. Open debuginfo repo

Create in/etc/yum.repos.d/ or modify enabled = 1 in the existing CentOS debuginfo. Repo file to enable repo

[debug]
name=CentOS-7 - Debuginfo
baseurl=http://debuginfo.centos.org/7/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7
enabled=1

2. Update yum

yum makecache fast

3. Install Yum utils

debuginfo install this command is included from the yum utils package

yum install yum-utils -y

4. Install debuginfo package

Execute the following command to install

debuginfo-install glibc-2.17-196.el7_4.2.x86_64 libgcc-4.8.5-16.el7_4.2.x86_64 libstdc++-4.8.5-16.el7_4.2.x86_64 nss-softokn-freebl-3.28.3-8.el7_4.x86_64

Please check GDB is coded – see taskgated (8)

Knowledge map advanced must read: read how large-scale map data efficient storage and retrieval>>>

Reprinted from Afan tree’s blog

link address of this article: please check GDB is coded – see taskgated (8))

It’s hard to install GDB with brew. It turns out that it still can’t be debugged and this error is reported>( Please check GDB is coded – see taskgated (8))
for security reasons, Darwin kernel does not allow GDB to debug any program without special authorization, because it can be debugged to control the process. However, if it is root user, there is no such problem, but who is willing to use root to debug the program<
solution:
a common solution is to grant GDB the right to sign code with full trust of the system to other processes

First, you need to create a system code signature trust certificate

Start the “Keychain access” application (/ applications/utilities/Keychain access. APP)
1. Open the menu: Keychain access – Certificate assistant – create Certificate…
2. Enter the name of the certificate, such as GDB cert
3. Select identity type to self signed root
4. Select certificate type to code signing
5. Check: let me override the default signatures
6. Continue all the way. When you choose the time, make it longer, up to 20 years, 7300。
7. Continue all the way until you select the address where the certificate is stored, and select: system
8. After the certificate is created, you need to set the certificate custom trust
9. Right click the GDB cert certificate you just created, and select get info
10. Click trust, The trust options that can be customized will be displayed
11. Select “code signing to always trust” for “code signing”
12 secondly, grant the certificate to GDB and execute the command

1

codesign -s gdb-cert `which gdb`

Well, the above gives GDB a code signature certificate trusted by the system, and GDB can be used normally
to make the newly added certificate effective, you need to restart the taskgated service or restart the system

1

sudo killall taskgated

codeblocks17.12 debug :ERROR: You need to specify a debugger program in the debuggers’s set…

Debug
ERROR: You need to specify a debugger program in the debuggers’s settings.
(For MinGW compilers, it’s ‘gdb.exe’ (without the quotes))
(For MSVC compilers, it’s ‘cdb.exe’ (without the quotes))

Find configurations online at

1:https://stackoverflow.com/questions/21083560/how-do-you-specify-a-debugger-program-in-codeblocks-12-11/33289596

Sorted out, but it will appear that it can only be run once:

Solution reference: http://tieba.baidu.com/p/3491019377

Compiler configuration.

Note: The compiler is not Codeblocks’ own MinGW, but TDM-GCC-64 !!!!!!

Executable path:D:\Program Files (x86)\CodeBlocks\TDM-GCC-64\bin\gdb64.exe (Here is the compiler installation path, note: 32-bit system choose gdb.exe, 64-bit system choose: gdb64.exe)

Run the completed debug interface.