Core Debugging Logic
Next, we will develop a symbol-level debugger for Go language. In addition to the basic instruction-level debugging capabilities introduced earlier, it will also support source code level debugging. Furthermore, it will provide more user-friendly debugging capabilities based on Go's language features, such as supporting goroutine-level (rather than thread-level) breakpoints, switching between different threads and goroutines, function calls, and more.
Similar to the organization of instruction-level debugging content introduced earlier, we will first introduce the overall framework of the debugger, such as how to implement a front-end and back-end separated architecture, how to design and implement RPC communication between front-end and back-end, and how to extend the UI layer, Service layer, Symbol layer, and Target layer respectively. Then, we will introduce the debugging methods that the debugger needs to support (attach, exec, debug, test, core, trace), as well as the debugging commands that need to be supported in debugging sessions (breakpoint, tracepoint, continue, list, print, bt, etc.). Finally, in the implementation section, we will introduce the implementation details of various debugging commands.