flat assembler
Message board for the users of flat assembler.

Index > Main > How to debug ?

Author
Thread Post new topic Reply to topic
RazorJack



Joined: 12 Jan 2008
Posts: 2
RazorJack 12 Jan 2008, 17:55
hello guys !
can anybody answer me how do you debug code compilled in FASM?
FASM can not create debug information how debug in OLLY for example?
or you just finding you code in debuger window as is ?
I dont understand ...
PS. if you dont understand what i mean just i bad know english.
Post 12 Jan 2008, 17:55
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 12 Jan 2008, 19:41
Which platform you are targetting your code (win, dos, *nix etc)?

Basically one good debugging method is to print your variables etc. on screen in order to see whats happening. I use that method most of the time.

regards,
mac2004
Post 12 Jan 2008, 19:41
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 12 Jan 2008, 20:23
one other method is to be used to programming mechanism.
and put a text string before each functions, as this, if an error occurs, the offset given by the error message helps to know where error happens, and reading the binary in an hexa editor directlly show the defected routine.
Post 12 Jan 2008, 20:23
View user's profile Send private message Visit poster's website Reply with quote
Vov4ik



Joined: 20 May 2007
Posts: 28
Location: USSR, Moscow Region
Vov4ik 12 Jan 2008, 20:55
Insertion of INT 3 instruction helps to find necessary parts of your code, especially in complex project, or an assembly language procedure in HLL code. Just run program in debugger and wait when it appears.
Post 12 Jan 2008, 20:55
View user's profile Send private message ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 12 Jan 2008, 23:36
1. use FASM to create object, and link them to executable with (at least some) debug info
2. in windows PE, you can create export table, which OllyDbg will resolve as symbols
Post 12 Jan 2008, 23:36
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 13 Jan 2008, 00:16
INT3 really helps move to the target area quickly. If really lost - use the "divide and conquer" strategy:

Place an INT3 before and after the area of search and see where it stops; next place an INT3 between the previous two, and remove the first one. Keep doing this until the debugger stops right before the error - it is really faster with practice.

Another method is to test small code fragments prior to piecing everything together. This promotes good program modularity in general - routines tend to have greater encapsulization and cohesion (inner dependence verse outer dependence).

There is the ever-common register MsgBox - don't even need a debugger, lol! vkim made a fun debug window to collect run-time data - very useful tool. It's included with MASM32 package, but also on the web.

http://www.radasm.com/projects/Debug.zip
http://www.wasm.ru/ (Should be here, but I cannot find it )c: )

Maybe, I'll adapt vkim's debug macros to FASM. Some people on the board have mentioned using a console window in the same fashion. I haven't really searched the board for debug tools - would not be surprised if people have posted something to make data logging easier.
Post 13 Jan 2008, 00:16
View user's profile Send private message Visit poster's website Reply with quote
RazorJack



Joined: 12 Jan 2008
Posts: 2
RazorJack 13 Jan 2008, 17:58
thanks eveyone !
you posted very usefull information !
Post 13 Jan 2008, 17:58
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 14 Jan 2008, 02:36
Someone just created a VERY useful tool for debugging information in fasm with Olly in the Windows section of this site. Check it out
Post 14 Jan 2008, 02:36
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.