Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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