flat assembler
Message board for the users of flat assembler.
Index
> Windows > How to debug procedures? |
Author |
|
shoorick 17 Aug 2005, 15:37
hi!
2. i'm usualy use this: Code: macro deb { if DEBUG_VERSION local .nodeb pusha invoke IsDebuggerPresent test eax,eax popa jz .nodeb int3 .nodeb: end if } then place "deb" where you want regards1 |
|||
17 Aug 2005, 15:37 |
|
veach1 18 Aug 2005, 06:49
How and where should I define DEBUG_VERSION?
|
|||
18 Aug 2005, 06:49 |
|
veach1 18 Aug 2005, 07:37
hmm... solution for 2) ?
Defining procs before '.end start' causes them to be located in the .code section and OLLY trace there as normal, definig procs after '.end start' causes them to be located in .idata section, OLLY can trace there but no analysing allowed and breakpoints can be set only as data breakpoints. First question remains open... |
|||
18 Aug 2005, 07:37 |
|
shoorick 18 Aug 2005, 08:09
1. DEBUG_VERSION > sorry, just pasted from my source - it is definition i'm using. you can refuse from it or just define it at the start eg DEBUG_VERSION equ 1 (or 0) to avoid appearing of int3 in ready source (and also used by me to some other conditional compilation for debug versions)
2.not sure i understand clear about before and after: you asked about debugging procedure created with proc macro. there is no much difference between proc procedure and usual procedure, the only thing is implicit creating and removing stack frame in the first time by macros. Code: ;=========================== proc GetFileSizeName lpFileName ; ZF=1 if fail ;---------------------------------- local wfd:WIN32_FIND_DATA ;---------------------------------- deb ; <=== here run will stop and ; started debugging ; of this procedure lea ecx,[wfd] invoke FindFirstFile,[lpFileName],ecx cmp eax,INVALID_HANDLE_VALUE provided macro checks if current application runs under debugger, and if yes - executing int3 command to stop executing and start debugging. place line with single "deb" at the start of procedure code and run application from Olly - and it will stop there. of course, you can place this line in other place where you are interesting. you can skip all of this and just place int3, but if you occasionally start it directly to run, int3 closes application if no debugger registered in the system or will pop it. if it is because you just forgot to remove int3 - it is not good, thus i'm using such macro: int3 will placed into code only for debug versions, not for release, and will executed only when run under debugger. is this complete? |
|||
18 Aug 2005, 08:09 |
|
veach1 18 Aug 2005, 08:17
working!
Thank you! |
|||
18 Aug 2005, 08:17 |
|
shoorick 18 Aug 2005, 08:56
also it is possible to use simbolic debugging, but then you have to create object and then link it to the exe with creating maps etc., but i'm not familiar with this.
about question first: place deb or int3 into any or both lv_cmp & lv_param_update after 'enter' and you should catch all resorting. regards! |
|||
18 Aug 2005, 08:56 |
|
shoorick 18 Aug 2005, 08:58
oh! i was late - server did not work 30 min
|
|||
18 Aug 2005, 08:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.