flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > IDE Development > Does it have a debugger?

Author
Thread Post new topic Reply to topic
vivik



Joined: 29 Oct 2016
Posts: 186
Does it have a debugger?
Just curious.
Post 29 Oct 2017, 07:30
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3459
Location: Bulgaria
It?
Post 29 Oct 2017, 08:46
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 186
Fresh IDE. Actually, any fasm IDE, (There are more than one?)
Post 29 Oct 2017, 08:50
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3459
Location: Bulgaria

vivik wrote:
Fresh IDE. Actually, any fasm IDE, (There are more than one?)



There is FASMW, which is IDE by itself.

Anyway, Fresh IDE contains a debugger, but it is not very good. In order to test it, put "int3" somewhere in the code of Windows program (some of the examples) and run it by pressing F9 (Debug|Run). The program will stop on the int3 break and you will be able to step through instructions directly in the source editor.

Anyway, the future development of this debugger has been suspended, because it is designed to use only Windows debug API. Recently Fresh IDE is slowly moving towards portable version, so I want to make the debugger able to debug at least both, Windows and Linux applications. But have no time to rewrite the debugger from scratch.

Actually, good source level debugger will be actively developed for v3.x series. That is why I recommend external debuggers to be used. Shift-F8 opens the proper external debugger for the project. Of course, you need to set the paths to these debuggers in the options dialog.

Personally I use OllyDbg for Windows programs and EDB debugger for Linux.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 29 Oct 2017, 09:58
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 186
I'd actually drop linux support, and just tell everyone to use wine. Debuggers work somewhat ok in there. Maybe making a separate versions for windows and linux would be better, assembler and crossplatform doesn't fit really well together, many details are very platform dependant.

I feel so uncomfortable editing code in OllyDbg, I'm constantly afraid of running out of space. I use an addon that generates assembly text out of some function, then I edit it as text, and then reapply it. It works, but is very uncomfortable. If I had a better tool which could simplify it for me, it would be awesome. I could write code and execute it immediately.
Post 29 Oct 2017, 11:38
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3459
Location: Bulgaria

vivik wrote:
I'd actually drop linux support, and just tell everyone to use wine. Debuggers work somewhat ok in there. Maybe making a separate versions for windows and linux would be better, assembler and crossplatform doesn't fit really well together, many details are very platform dependant.



It is not so big problem actually. That is why I am developing FreshLib. It is highly portable at least for Windows, Linux and partially for KolibriOS. Even now it can be used for developing console applications that simply compiles for the supported OSes from the same source.

I am working on the GUI part now and then Fresh IDE will be fully portable.


Quote:
I feel so uncomfortable editing code in OllyDbg, I'm constantly afraid of running out of space. I use an addon that generates assembly text out of some function, then I edit it as text, and then reapply it. It works, but is very uncomfortable. If I had a better tool which could simplify it for me, it would be awesome. I could write code and execute it immediately.



I am always using Fresh IDE for developing and only debug in OllyDbg or EDB. "Goto address" feature (Ctrl+G) helps a lot to find the source line, corresponding on some memory address.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 29 Oct 2017, 12:32
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 186

JohnFound wrote:
I am always using Fresh IDE for developing and only debug in OllyDbg or EDB. "Goto address" feature (Ctrl+G) helps a lot to find the source line, corresponding on some memory address.



How do you get the address? Fresh IDE can do that?

As I understand it, you first write your program, compile it, and then run it in a debugger? I'd like to do it a bit differently: write first line of your program, run it, see if everything is fine, write the rest. It is easier to do for assembly than for high level languages. Kind of like edit-and-continue.

I guess I have to wait?
Post 29 Oct 2017, 13:04
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3459
Location: Bulgaria

vivik wrote:

JohnFound wrote:
I am always using Fresh IDE for developing and only debug in OllyDbg or EDB. "Goto address" feature (Ctrl+G) helps a lot to find the source line, corresponding on some memory address.



How do you get the address? Fresh IDE can do that?



The address of particular label you can see in the code completion window, by simply positioning on the label and pressing Ctrl+Space. The source must be compiled, of course.

If you know some address - for example, where some exception happened, you can find where this address is located in the source with the mentioned "Goto address" function. Press "Ctrl+G" enter the address and the editor will position on the line corresponding with this address. Of course only if the address is from your source.



Quote:
As I understand it, you first write your program, compile it, and then run it in a debugger? I'd like to do it a bit differently: write first line of your program, run it, see if everything is fine, write the rest. It is easier to do for assembly than for high level languages. Kind of like edit-and-continue.

I guess I have to wait?



Well, it does not seems to work this way. The execution of one instruction depends on the current context. If you execute one instruction and something is wrong you can't simply undo the context (register values) to the previous state and fix the instruction.

In addition, in 99% of cases, writing instruction, you already know what this instruction will do, so executing it is meaningless.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 29 Oct 2017, 13:49
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 186
Hm, I need to try Fresh IDE out.


JohnFound wrote:



Quote:
As I understand it, you first write your program, compile it, and then run it in a debugger? I'd like to do it a bit differently: write first line of your program, run it, see if everything is fine, write the rest. It is easier to do for assembly than for high level languages. Kind of like edit-and-continue.

I guess I have to wait?



Well, it does not seems to work this way. The execution of one instruction depends on the current context. If you execute one instruction and something is wrong you can't simply undo the context (register values) to the previous state and fix the instruction.



I guess one has to keep an "undo history" to be able to "rewind". Gdb actually supports rewinding, it can even rewind cpu built-in rng.

Even without undo history, sometimes it's enough to just go a few steps back and recalculate something. To the beginning of function, for example.


JohnFound wrote:

In addition, in 99% of cases, writing instruction, you already know what this instruction will do, so executing it is meaningless.



I don't, I'm terrible at assembly. I have to write tiny "example programs" for every instruction.
Post 29 Oct 2017, 14:24
View user's profile Send private message 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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.