All Projects → hitzhangjie → golang-debugger-book

hitzhangjie / golang-debugger-book

Licence: other
From a debugger's view, Let's explore the computer world! How does compiler, linker and debugger coordinate with each other around the program written in specific programming language? How does a debugger work? If we develop a debugger for go programming language, we must master go type system, runtime... and some Operating System internals. OK,…

Programming Languages

Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to golang-debugger-book

GoDebug
Go debugger (Delve) integration with Sublime Text 3
Stars: ✭ 20 (-59.18%)
Mutual labels:  debugger, debug, delve
gdbundle
Minimalist plugin manager for GDB and LLDB
Stars: ✭ 72 (+46.94%)
Mutual labels:  debugger, debug
Logcat
Android 日志打印框架,在手机上可以直接看到 Logcat 日志啦
Stars: ✭ 189 (+285.71%)
Mutual labels:  debugger, debug
ghidra2dwarf
🐉 Export ghidra decompiled code to dwarf sections inside ELF binary
Stars: ✭ 135 (+175.51%)
Mutual labels:  elf, dwarf
Ethereum Graph Debugger
Ethereum solidity graph plain debugger. To have the whole picture when debugging.
Stars: ✭ 177 (+261.22%)
Mutual labels:  debugger, debug
Detect It Easy
Program for determining types of files for Windows, Linux and MacOS.
Stars: ✭ 2,982 (+5985.71%)
Mutual labels:  debugger, elf
Pysnooper
Never use print for debugging again
Stars: ✭ 14,815 (+30134.69%)
Mutual labels:  debugger, debug
dwarf import
This loads DWARF info from an open binary and propagates function names, arguments, and type info
Stars: ✭ 18 (-63.27%)
Mutual labels:  debug, dwarf
RailLink
Compact isolated version of J-Link v9.
Stars: ✭ 69 (+40.82%)
Mutual labels:  debugger, debug
CVIP
C/C++/Golang/Linux...知识整理
Stars: ✭ 62 (+26.53%)
Mutual labels:  debug, elf
Pudb
Full-screen console debugger for Python
Stars: ✭ 2,267 (+4526.53%)
Mutual labels:  debugger, debug
react-native-debug-console
A network and console debug component and modal for react native purely in JavaScript
Stars: ✭ 17 (-65.31%)
Mutual labels:  debugger, debug
Hitchcock
The Master of Suspense 🍿
Stars: ✭ 167 (+240.82%)
Mutual labels:  debugger, debug
Acho
The Hackable Log
Stars: ✭ 189 (+285.71%)
Mutual labels:  debugger, debug
Scyllahide
Advanced usermode anti-anti-debugger. Forked from https://bitbucket.org/NtQuery/scyllahide
Stars: ✭ 2,211 (+4412.24%)
Mutual labels:  debugger, debug
Smartdebug.js
Next-generation debugging for javascript!
Stars: ✭ 157 (+220.41%)
Mutual labels:  debugger, debug
React Native Vdebug
React-Native 调试工具,支持Console终端、Network导出cURL,可视化Response,Retry cURL。
Stars: ✭ 124 (+153.06%)
Mutual labels:  debugger, debug
Gdb Frontend
☕ GDBFrontend is an easy, flexible and extensionable gui debugger.
Stars: ✭ 2,104 (+4193.88%)
Mutual labels:  debugger, debug
hilda
LLDB wrapped and empowered by iPython's features
Stars: ✭ 99 (+102.04%)
Mutual labels:  debugger, debug
heaptrace
helps visualize heap operations for pwn and debugging
Stars: ✭ 252 (+414.29%)
Mutual labels:  debugger, ptrace

How to develop a (golang) debugger

You can read this book (Chinese version) here: https://www.hitzhangjie.pro/debugger101.io/ .

Introduction

This project aims to introduce how to develop a (golang) debugger, including Operating System's support, how to coordinate work between compiler, linker and debugger, debugging information standard, mapping between machine instruction and source code, etc.

Thanks to delve and the author derek parker and other contributors. I learned a lot from them. I want to share the knowledge to develop a (golang) debugger. I hope this project can be useful for developers interested in debugging topic.

To develop a symbolic debugger need to combine the knowledge of CPU instruction (like instruction patching), Operating System (like linux ptrace and OS scheduler), compilers, linkers, loaders, debuggers (how to coordinate the work between them), executable file format (how to store debugging information), debugging information format (how to describe source code, how to map between instruction and source, vice versa), and features of different programming languages (like goroutine concept), so I think it's also a good chance to improve the understanding of computer technology.

I think it's very helpful, So I am really excited to write this documents.

Samples

The project "golang-debugger-book" also provides a repository "golang-debugger-lessons" which contains sample code. Readers can view the sample code according to the chapter correspondence. The directory "0-godbg" provides a relatively complete implementation of a symbol-level debugger for go language.

Of course, there have been some debuggers for the Go language, such as gdb, dlv, etc. To develop a debugger from scratch is not just to develop a new debugger, but to use the debugger as an entry point, that could help us integrate relevant knowledge. The technical points here involve the go language itself (type system, goroutine scheduling), the cooperation between the compiler and the debugger (DWARF), the operating system kernel (virtual memory, task scheduling, system calls, instructions patching) and processor-related instructions, etc.

In short, I hope to start with the development of a go language debugger as an entry point to help beginners quickly get started with go language development, and gradually understand the mechanisms behind operating system, compiler, debugger, and processor, so we could deepen the overall understanding of the computer system.

I hope that this book and related samples can be smoothly completed. It can be regarded as a way for me to hone my temperament and improve myself. It would be great if it can really help everyone.

Read the Book locally

  1. run git to clone the repository
git clone https://github.com/hitzhangjie/golang-debugger-book
  1. run gitbook to serve the book

If you have installed gitbook-cli by npm or homebrew, you could run the following command to serve the book:

# read the chinese version
cd book.zh
gitbook install && gitbook serve

# read the english version
cd book.en
gitbook install && gitbook serve

Though gitbook-cli is deprecated offically, it is still a very popular EBook generator. If trying to install gitbook-cli today, we may encounter some errors, because the nodejs, graceful-fs has broken some compatibility with gitbook-cli. Because of this, I have built a docker image hitzhangjie/gitbook-cli:latest, you could pull and use this docker image instead of installing by npm or homebrew package manager.

# read the english version
rm book.en/_book
docker run --name gitbook --rm -v ${PWD}/book.en:/root/gitbook hitzhangjie/gitbook-cli:latest gitbook install .
docker run --name gitbook --rm -v ${PWD}/book.en:/root/gitbook -p 4000:4000 -p 35729:35729 hitzhangjie/gitbook-cli:latest gitbook serve .


# read the chinese version
rm book.zh/_book
docker run --name gitbook --rm -v ${PWD}/book.zh:/root/gitbook hitzhangjie/gitbook-cli:latest gitbook install .
docker run --name gitbook --rm -v ${PWD}/book.zh:/root/gitbook -p 4000:4000 -p 35729:35729 hitzhangjie/gitbook-cli:latest gitbook serve .

We put the commands into Makefile, you can just run make chinese or make english to read the relevant version.

Contact

Please email me [email protected], I will respond as soon as possible.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].