Understanding the Working Principle of GDB in 4 Diagrams

Understanding the Working Principle of GDB in 4 Diagrams

Hello everyone, this is IoT Heart. GDB is a debugging tool frequently used by Linux developers, and I believe most readers are familiar with using the gdb command to debug programs. So, are you curious:Why can gdb debug our programs? In this article, we will explore this.1. What is GDB? GDB is a debugger for … Read more

GDB Debugging Methods (3) – Simple Debugging

GDB Debugging Methods (3) - Simple Debugging

We know that ptrace frequently issues PTRACE_GETREGS and PTRACE_SETREGS commands, modifying the PC register, allowing the process to be controlled by gdb and execute related commands at the trace point. This article uses a simple program to demonstrate basic debugging tasks using gdb. What to Debug Based on the understanding of ptrace, we can summarize … Read more

GDB Debugging Methods (2) – Ptrace

GDB Debugging Methods (2) - Ptrace

GDB uses the ptrace system call to implement its functionality. This article provides a brief overview of ptrace. Ptrace The ptrace system call /* kernel/ptrace.c */ #define __NR_ptrace 117 __SYSCALL(__NR_ptrace, sys_ptrace) When using ptrace, you need to include<span>/sys/ptrace.h</span>. When calling the ptrace system call, you need to send requests based on different requests, which are … Read more

Debugger Development Techniques – Exploring Implementation Details of Linux and Windows Debuggers

Debugger Development Techniques - Exploring Implementation Details of Linux and Windows Debuggers

This article is aimed at those who want to develop a debugger for the Linux Armv8a architecture. It can serve as a reference, and I will use my experience from developing two debuggers to clearly describe the key technical details in as simple language as possible.Due to space limitations, this article will only discuss the … Read more

Research on Executing ELF in Memory on Android

Research on Executing ELF in Memory on Android

This article is an excellent piece from the KX forum. Author ID on KX forum: Ylarod One When we first encountered this issue, we found that in the Linux system, we can use memfd_create and execve to execute ELF in memory. However, on Android, we encountered the following problem: CANNOT LINK EXECUTABLE "/data/local/tmp/payload": library "libicu.so" … Read more

Understanding GDB Debugging Principles with Visuals

Understanding GDB Debugging Principles with Visuals

1. Introduction This article discusses the renowned GDB. We won’t mention its prestigious background; like its sibling GCC, it was born with a golden key and holds an irreplaceable position in the GNU family. Every embedded development engineer has likely used gdb to debug programs; if you haven’t, it only indicates your development experience hasn’t … Read more

Build Your Own GDB: Basic Functionality

Build Your Own GDB: Basic Functionality

What is GDB GDB stands for the GNU Project debugger, primarily used for debugging user-mode applications. According to the official documentation, GDB supports debugging applications written in the following languages: Ada Assembly C C++ D Fortran Go Objective-C OpenCL Modula-2 Pascal Rust Of course, the most common use is for debugging applications written in C/C++. … Read more