Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,787 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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