包含标签 debugger 的文章

Making debugger for Golang

转载自 Making debugger for Golang (part I) The goal of this series is not to write full-featured debugger for Go programming language. If you’re looking for some then please take a look at Delve. We’ll try to understand here how debuggers work in general and how to implement basic one on Linux which takes into account Golang’s features like goroutines. Creating debugger isn’t easy though. We won’t even strive to cover this topic within a single story.……

阅读全文

Making debugger for Golang

转载自 Making debugger for Golang (part II) During the first part we’ve bootstrapped development environment and made a simple program (tracer) which stops child process (tracee) at the very beginning and then continues it execution together with showing its standard output. Now it’s time to extend its basic capabilities. Usually debuggers allow to single-step through debugged program. It can be done using ptrace PTRACE_SINGLESTEP request which tells tracee to stop after execution of single instruction:……

阅读全文

Making debugger for Golang

转载自 Making debugger for Golang (part III) So far we’ve learned how to single-step ptraced process (tracee) and get some debugging info out of binary (read it here if you haven’t done it yet). Now it’s time to set a breakpoint at desired place, wait until reached and then investigate process state. Let’s start with assembly code used before: section .data msg db "hello, world!", 0xA len equ $ - msg section .……

阅读全文