Author Topic: Debugging with RADASM  (Read 4774 times)

Grincheux

  • Member
  • ***
  • Posts: 328
  • Never be pleased, Always improve
    • Asm for fun
Debugging with RADASM
« on: December 19, 2015, 06:07:09 AM »
I use version 3 of RadAsm and found a menu "Debug".
Does it mean that we can debug our program with RadAsm?
How do I use it?
Kenavo (Bye)
----------------------
Asm for Fun
My Links
"La garde meurt mais ne rend pas"
Cambronne à Waterloo

ragdog

  • Member
  • ****
  • Posts: 515
Re: Debugging with RADASM
« Reply #1 on: December 19, 2015, 09:56:36 PM »
Quote
Does it mean that we can debug our program with RadAsm?

Yes you can set a Breakpoint in your source to debug your source
its very usefull.

Try it

Grincheux

  • Member
  • ***
  • Posts: 328
  • Never be pleased, Always improve
    • Asm for fun
Re: Debugging with RADASM
« Reply #2 on: December 19, 2015, 10:49:40 PM »
I have seen breakpoints but how do I debug?
Kenavo (Bye)
----------------------
Asm for Fun
My Links
"La garde meurt mais ne rend pas"
Cambronne à Waterloo

jj2007

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: Debugging with RADASM
« Reply #3 on: December 20, 2015, 02:37:58 AM »
Code: [Select]
.code
start:
  mov eax, 123
  invoke whatever
  int 3    ; <------- breakpoint

Your assembler commandline should contain /Zi
Your linker commandline should contain /debug

- open the executable in OllyDbg
- hit F9 to let the program execute until the breakpoint
- hit F7 or F8 to go forward step by step (F8 does not dive into calls)

ragdog

  • Member
  • ****
  • Posts: 515
Re: Debugging with RADASM
« Reply #4 on: December 20, 2015, 03:19:49 AM »
1.Set a Breakpoint with "Toggle breakpoint CTRL+T" on any line in your source
2.Run the Radasm debugger "Debug>>Run shift+7"
3. is your Breakpoint reached in your source can you Trace it with Step into or step Over

And you can Trace step by Step your Source code.

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: Debugging with RADASM
« Reply #5 on: December 20, 2015, 03:31:04 AM »
in windows, there is something called "Just In Time" exception handler
normally, this points to the "Dr Watson" message box that gives you error information when a program crashes
i'm sure you've seen it - for example, if you try to access protected memory, you get error 0x80000005

well, by changing a registry setting, you can change what happens when a program crashes
Jochen gave you a link to Olly Debugger
versions 1.1 and 2 are available
version 1.1 allows source symbols
version 2 has newer features, but he is still working on symbol support

at any rate, when you install Olly - there is a menu item that allows you to set the JIT exception handler to Olly
once you do that, Olly will come up instead of the windows error messages

INT 3 generates an "invalid opcode" exception, causing the JIT handler to come up
so, to debug at a specific spot, we temporarily insert an INT 3 into the code

ragdog

  • Member
  • ****
  • Posts: 515
Re: Debugging with RADASM
« Reply #6 on: December 20, 2015, 06:03:45 AM »
@Dave

Grincheux mean the Radasm source code debugger not Olly

Grincheux

  • Member
  • ***
  • Posts: 328
  • Never be pleased, Always improve
    • Asm for fun
Re: Debugging with RADASM
« Reply #7 on: December 20, 2015, 08:12:13 AM »
RagDog, you are right.
I have tested this possibility.
My program opens a file for reading (*.exe). Into visual community 2015 debugger I have no problem but using RadAsm I cannot read the file.
My breakpoint is set far from this point.

Kenavo (Bye)
----------------------
Asm for Fun
My Links
"La garde meurt mais ne rend pas"
Cambronne à Waterloo

ragdog

  • Member
  • ****
  • Posts: 515
Re: Debugging with RADASM
« Reply #8 on: December 20, 2015, 07:15:13 PM »
Can you make a small Project for testing?

Grincheux

  • Member
  • ***
  • Posts: 328
  • Never be pleased, Always improve
    • Asm for fun
Re: Debugging with RADASM
« Reply #9 on: December 21, 2015, 03:35:42 AM »
Yes I will do
Kenavo (Bye)
----------------------
Asm for Fun
My Links
"La garde meurt mais ne rend pas"
Cambronne à Waterloo

HSE

  • Member
  • ****
  • Posts: 533
  • <AMD>< 7-32>
Re: Debugging with RADASM
« Reply #10 on: December 21, 2015, 03:55:15 AM »
Hi Grincheux!

What compiler are you using? Apparently the RadAsm Debugger only work with ML. (for sure, in Jwasm the options for debugging don't work)

jj2007

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: Debugging with RADASM
« Reply #11 on: December 21, 2015, 05:58:10 AM »
(for sure, in Jwasm the options for debugging don't work)

They work perfectly, I use them every day.

HSE

  • Member
  • ****
  • Posts: 533
  • <AMD>< 7-32>
Re: Debugging with RADASM
« Reply #12 on: December 21, 2015, 06:17:49 AM »
Very funny jj!

You can't delete the context.

In that case the expression is:
    (for sure, in Jwasm the options for debugging with RadAsm Debugger don't work)

Grincheux

  • Member
  • ***
  • Posts: 328
  • Never be pleased, Always improve
    • Asm for fun
Re: Debugging with RADASM
« Reply #13 on: December 21, 2015, 07:00:30 AM »
JWAsm
Kenavo (Bye)
----------------------
Asm for Fun
My Links
"La garde meurt mais ne rend pas"
Cambronne à Waterloo

ragdog

  • Member
  • ****
  • Posts: 515
Re: Debugging with RADASM
« Reply #14 on: December 21, 2015, 07:10:32 AM »
The Radasm source code debugger works fine