Feature: implemented [Debugger]
#132
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Features
DAP adapter
launch(nameandsourcehave been added), and some custom requests have been added (for example,restart_session).disassemble,read_memory,stack_trace, etc. according to the protocol support.Debugger
read_memorysupport.disassemblesupport.step_*,read_register,read_global,read_registers,read_upvaluessupport.stack_snapshot,backtracesupport.Why was the visibility of some
piccolostructures changed?Currently, a significant portion of the
piccoloAPI is closed, without which it's simply impossible to implement any debugger. I made part of thepiccoloAPI public so that the debugger would have access to low-level utilities, structures, and functions ofpiccolo.A bit of information about the debugger itself
About [
Debugger::disassemble][
Debugger::disassemble] receives opcodes and converts them into already compiled operations.What is
memory_reference?memory_referencedefines what information we will receive and from where. If you specify""(empty string) inmemory_reference, it takes the last frame for disassembly by default. If the string is"frame:id"or"prototype:id", it searches for the neededFunctionPrototypeand disassembles it specifically.Output format
Approximate output of the [
Debugger::disassemble] method looks like this:About [
Debugger::stack_snapshot] (or stack trace)[
Debugger::stack_snapshot] goes through all frames and collects information about the chunk name, its location, line, and the number of containing registers.Output format
Approximate output of the [
Debugger::stack_snapshot] method looks like this:Note: all output is described after data formatting
at the same time, [
Debugger] functions completely correctly, see /examples/simple_debug.rsyou can also see tests of the main functionality in /examples/simple_debug.rs