Linux Network Programming: Data Link Layer and ARP Protocol

Linux Network Programming: Data Link Layer and ARP Protocol

1. Related to MAC Frame (Simple Simulation to Build MAC Frame) Ethernet Header Structure Definition (C Language) #include <stdio.h> #include <stdint.h> // Ethernet header structure typedef struct { uint8_t destination_mac[6]; // Destination MAC address, 6 bytes uint8_t source_mac[6]; // Source MAC address, 6 bytes uint16_t ether_type; // Ethernet type, e.g., 0x0800 indicates IP protocol } … Read more

Embedded Linux: Thread Synchronization with Condition Variables

Embedded Linux: Thread Synchronization with Condition Variables

Click the blue text above to follow us In the Linux environment, condition variables are a mechanism for thread synchronization that allows threads to enter a waiting state when a certain condition is not met, and to be notified by other threads when shared resources or conditions are modified. Condition variables are typically used in … Read more

Memory Debugging with Valgrind on Linux

Memory Debugging with Valgrind on Linux

1. Overview Valgrind is an open-source memory debugging and performance analysis tool used to help developers identify memory errors in programs, such as memory leaks, use of uninitialized memory, illegal memory access, and other issues. It is widely used on the Linux platform and supports multiple processor architectures. 2. Using Valgrind 1. Basic Format valgrind … Read more

Proteus Simulation: Rolling Display of 8-Digit LED

Proteus Simulation: Rolling Display of 8-Digit LED

Name: 8 Digit Rolling Display of Number String Software: Proteus Keil 4 Language: C Language Usage Instructions: In this example, the simulation of 8 digit displays rolling to the left shows a number string consisting of 3 characters. Example Image: Proteus Simulation – 8 Digit Rolling Display of Number String Program: /* Name: 8 Digit … Read more

Advanced GDB Usage Techniques

Advanced GDB Usage Techniques

Custom Commands The following statement is written in ~/.gdbinit to define a custom command lmem. This command requires one parameter, which is a memory address that serves as the head of a linked list. The structure of the linked list is BlockLink_t. The function of this command is to traverse the linked list and print … Read more

A Simple Guide to Using GDB Debugger

A Simple Guide to Using GDB Debugger

Original: https://blog.csdn.net/fangye945a/article/details/85254627 When developing C/C++ projects on the ARM and Linux platforms, you will inevitably encounter some bugs in your programs. Small projects are manageable, but for large projects with extensive code, it becomes challenging to pinpoint issues. This is where using the gdb debugger can help you easily locate code bugs. Previously, I shared … Read more

CGDB: A More Convenient Debugging Tool Than GDB

CGDB: A More Convenient Debugging Tool Than GDB

Table of Contents Example Code with Bugs GDB Debugging Operations CGDB Debugging Operations Learning from Others’ Experiences! CGDB is a frontend for GDB, providing a graphical interface in the terminal for debugging code (based on ncurse), which is very convenient. Compared to GDB, it can significantly improve efficiency. This article will share the most basic … Read more

Using GDB to Inspect Program Stack Space

Using GDB to Inspect Program Stack Space

Introduction: This is a quick tutorial on how to use GDB to inspect the stack space of a C program. Word count: 7403, estimated reading time: 10 minutes https://linux.cn/article-13550-1.htmlAuthor: Julia EvansTranslator: amwps290 Yesterday, while chatting with some people, they mentioned that they didn’t really understand how the stack works and didn’t know how to inspect … 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

GDB Debugger Made Simple: A Step-by-Step Guide

GDB Debugger Made Simple: A Step-by-Step Guide

Introduction to GDB GDB (GNU Debugger) is a powerful command-line debugging tool. Generally, when developing on Windows, command-line debugging is rarely used, as debuggers are mostly integrated with compilers in IDEs. Of course, you can also directly use gcc and gdb to compile and debug our C programs on Windows. For example, MinGW (a collection … Read more