Showing the changes to src/include (1 of 5 files). Show all
Unified · Split
| @@ -656,11 +656,6 @@ namespace disvm · 655 unmodified lines | |||
| 656 | pointer_t fixed_point_register_2() const; | 656 | pointer_t fixed_point_register_2() const; |
| 657 | }; | 657 | }; |
| 658 | 658 | ||
| 659 | // Callback for stack walk. | ||
| 660 | // Returning 'false' during the stack walk will terminate the walk. | ||
| 661 | // The second parameter is reserved for internal use by the VM and should not be manipulated. | ||
| 662 | using vm_stack_walk_callback_t = std::function<bool(const vm_frame_t *f, const void *reserved)>; | ||
| 663 | |||
| 664 | // VM stack | 659 | // VM stack |
| 665 | class vm_stack_t final | 660 | class vm_stack_t final |
| 666 | { | 661 | { |
| @@ -680,10 +675,6 @@ namespace disvm · 13 unmodified lines | |||
| 680 | // Return the current top frame. | 675 | // Return the current top frame. |
| 681 | vm_frame_t *peek_frame() const; | 676 | vm_frame_t *peek_frame() const; |
| 682 | 677 | ||
| 683 | // Walk the stack getting a callback for each frame. | ||
| 684 | // This function is __not__ thread safe. | ||
| 685 | void walk_stack(vm_stack_walk_callback_t callback) const; | ||
| 686 | |||
| 687 | private: | 678 | private: |
| 688 | std::unique_ptr<vm_alloc_t> _mem; | 679 | std::unique_ptr<vm_alloc_t> _mem; |
| 689 | }; | 680 | }; |
| @@ -741,6 +732,14 @@ namespace disvm · 51 unmodified lines | |||
| 741 | pointer_t dest; | 732 | pointer_t dest; |
| 742 | }; | 733 | }; |
| 743 | 734 | ||
| 735 | // Callback for stack walk. | ||
| 736 | // Returning 'false' during the stack walk will terminate the walk. | ||
| 737 | using vm_stack_walk_callback_t = std::function<bool(const pointer_t frame, const vm_pc_t pc, const vm_module_ref_t &module_ref)>; | ||
| 738 | |||
| 739 | // Walk the stack getting a callback for each frame. | ||
| 740 | // This function is __not__ thread safe if the vm thread being walked is not stopped. | ||
| 741 | void walk_stack(const vm_registers_t &r, vm_stack_walk_callback_t callback); | ||
| 742 | |||
| 744 | // VM thread | 743 | // VM thread |
| 745 | class vm_thread_t final : public vm_alloc_t | 744 | class vm_thread_t final : public vm_alloc_t |
| 746 | { | 745 | { |