History

Name the entry module in the exec program. Re-write stack walking function for debugger. System exceptions now print out call stack.

arr committed 10 years ago

Commit 794ecfc1 parent 4f6417b5 files · +54 −35Browse files

Showing the changes to src/include (1 of 5 files). Show all

Unified · Split

src/include/runtime.h+8−9
@@ -656,11 +656,6 @@ namespace disvm · 655 unmodified lines
656656 pointer_t fixed_point_register_2() const;
657657 };
658658
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−
664659 // VM stack
665660 class vm_stack_t final
666661 {
@@ -680,10 +675,6 @@ namespace disvm · 13 unmodified lines
680675 // Return the current top frame.
681676 vm_frame_t *peek_frame() const;
682677
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−
687678 private:
688679 std::unique_ptr<vm_alloc_t> _mem;
689680 };
@@ -741,6 +732,14 @@ namespace disvm · 51 unmodified lines
741732 pointer_t dest;
742733 };
743734
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+
744743 // VM thread
745744 class vm_thread_t final : public vm_alloc_t
746745 {