Gamestudio Links
Zorro Links
Newest Posts
Zorro plugin for Hyperliquid.xyz
by mayarik. 10/24/26 09:14
ZorroGPT
by TipmyPip. 10/24/26 01:54
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
No connection to MT4
by JeyKey II. 10/22/26 15:33
Zorro tutorial ideas?
by mistery. 10/21/26 05:28
Avoid "log\ - delete old files" message
by Martin_HH. 10/20/26 07:23
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Quad, TipmyPip), 9,961 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Request: Getting the stack trace #412934
12/05/12 09:49
12/05/12 09:49
Joined: Nov 2012
Posts: 62
Istanbul
T
Talemon Offline OP
Junior Member
Talemon  Offline OP
Junior Member
T

Joined: Nov 2012
Posts: 62
Istanbul
I would like a function that returns the stack trace to make debugging easier.

Re: Request: Getting the stack trace [Re: Talemon] #413103
12/08/12 01:55
12/08/12 01:55
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Not sure if Lite-C stores a stack frame, but if it does, you can grab the current one from the ebx register and then iterate over it. The layout of a stack frame looks like this:
Code:
struct stack_frame_s
{
	struct stack_frame_s *next;
	void *ret;
};



You can check if the stack frame is a aligned using this macro:
Code:
#define FramePointerIsAligned(a1) ((((uintptr_t)a1) & 0x1) == 0)



I'm afraid you have to get the ebx register using an external dll, however, if you are into dirty hacks, here are the required opcodes:
Code:
movl %eax, %ebx
ret

// ---

0x89 0xc3
0xc3



Symbolication can be done using engine_getscriptinfo()


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Request: Getting the stack trace [Re: WretchedSid] #413205
12/10/12 08:24
12/10/12 08:24
Joined: Nov 2012
Posts: 62
Istanbul
T
Talemon Offline OP
Junior Member
Talemon  Offline OP
Junior Member
T

Joined: Nov 2012
Posts: 62
Istanbul
Thanks JustSid, I guess I'll try to implement this.


Moderated by  aztec, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1