flat assembler
Message board for the users of flat assembler.

Index > Main > Suggestion: Debugger

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
Bargest



Joined: 09 Feb 2012
Posts: 79
Location: Russia
Bargest 09 Feb 2012, 20:18
Hello.
I think it is a good idea to add creating debug information and debugger to FASM.
Post 09 Feb 2012, 20:18
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20448
Location: In your JS exploiting you and your system
revolution 10 Feb 2012, 14:02
See here for how to use symbolic debugging with an external debugger.
Post 10 Feb 2012, 14:02
View user's profile Send private message Visit poster's website Reply with quote
Bargest



Joined: 09 Feb 2012
Posts: 79
Location: Russia
Bargest 10 Feb 2012, 14:54
Thank you! I didn't know it.
But as for me, FASM debugger, reading .FAS files directly (without converting to other formats) would be very useful. It also could be included in the standard IDE.
Post 10 Feb 2012, 14:54
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1670
Location: Toronto, Canada
AsmGuru62 10 Feb 2012, 15:00
It is much more fun to debug without the symbols!
Smile
Post 10 Feb 2012, 15:00
View user's profile Send private message Send e-mail Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 10 Feb 2012, 15:05
You should check Fresh IDE
It have some very useful debugging features build-in. (including still-not-finished debugger) Very Happy
Post 10 Feb 2012, 15:05
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Bargest



Joined: 09 Feb 2012
Posts: 79
Location: Russia
Bargest 10 Feb 2012, 15:31
Yes, it has, but it crashes too often...Smile And I could not find breakpoints in it.
Post 10 Feb 2012, 15:31
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 07 Mar 2012, 09:02
When I was writing fasmw, I initially planned to have integrated source-level debugger there (the F8 key is reserved for that purpose), but I never got to that point - and later situation became more complex as 64 bits arrived and as I decided to have ports of IDE to multiple OSes (well, that is an unfinished task, too - I have still not decided which technology use to port fasm's IDE to Linux). When I realized that I will never write a portable debugger to be integrated into fasm's IDE, I focused on providing the 'fas' output, so that other people could write external debuggers (or plug-ins for existing debuggers) which could allow source-level debugging with fasm.

fasmw can be made to execute some external debugger upon hitting F8 key, but I need to know of at least one good debugger that could be recommended for such integration. If any of you is looking for some serious project to start, I'd suggest making some good 32-bit/64-bit debugger with .fas support - maybe based on fdbg? I would give it a subdomain on .flatssembler.net if it was promising.
Post 07 Mar 2012, 09:02
View user's profile Send private message Visit poster's website Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 517
Location: Munich
shutdownall 08 Mar 2012, 18:31
That sounds to be a good idea. Very Happy
I would like to have an x86 debugger in FASM.
Would this work with WINXP and/or WIN7 ?
Post 08 Mar 2012, 18:31
View user's profile Send private message Send e-mail Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 08 Mar 2012, 20:25
A post-compile debugger in discution? yeah!!!

First good thing, before to have a debugger, would really to have ctrl+F8 generating .fas AND .lst too. with opening of the generated listing in a new tab. that would be still really nice.
i think that this part, apparentlly not so usefull or powerfull, can induce pretty good ideas , and is open to many improvements, and is still a good technique just in case of crash at a particular adress, we just have to read back in listing and get the source of error. but generating a listing is really a cure with the current method and takes too much time. i frequentlly should write the adress on paper before to finally get the listing.

and why not, with F8, just open the listing AND run the output file too, via a custom command line in fasm configuration file.

nothing after, forbid to evolve the F8 button to a real debugger,
and recover the ctrl+F8 to only .fas generation.

why not a feature to link .fas opening to a hexadecimal editor via command line in configuration file too?


Smile
that would still be a lot of work.
Post 08 Mar 2012, 20:25
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 08 Mar 2012, 21:26
edfed, the listing file is pretty useless for big projects, because it becomes really huge.
Fresh IDE have almost working listing feature, but I never managed/wanted to refine it, namely because it is useless.
The contemporary IDE needs advanced code browsing and debugging features.
Post 08 Mar 2012, 21:26
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 08 Mar 2012, 21:50
hem, for now, we just don't have easy listing as a simple solution for little projects with fasmw.exe. even if useless for big projects, i believe that 90% of the codes compiled on fasmw all around the world are relativelly little codes, like less than 20klines listing equivalent. and easy listing is better than nothing.

of course, project with more than 400klines would be very slow.

but even fasmw listing is like 43klines (1.69.34 gives a 42605 lines, with two blank lines at the end.), and it's not so long finally and would be perfectlly exploitable in real debuging situations.
Smile.
Post 08 Mar 2012, 21:50
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 08 Mar 2012, 22:05
Well, I myself can't process listing of 10klines. No, I probably can, but I refuse to do it! There are many, easier and faster ways to fix the bug or to see what particular lines of code generate.
I simply can't imagine what problem the listing file will solve easier than the alternative ways/tools. (well maybe except macro writing/debugging - but again, a tool that can show what the particular macro line generates will be much more useful).
Post 08 Mar 2012, 22:05
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1670
Location: Toronto, Canada
AsmGuru62 08 Mar 2012, 22:59
All whats needed for nice debugging is a real-time addresses of all functions.
And that is needed when debugger loaded the module.
Like 'View Names' feature in OllyDbg.
So, I can simply break on entry to ANY procedure and start from there.
This would be nice!
Post 08 Mar 2012, 22:59
View user's profile Send private message Send e-mail Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 517
Location: Munich
shutdownall 09 Mar 2012, 00:19
JohnFound wrote:
edfed, the listing file is pretty useless for big projects, because it becomes really huge.

Maybe but have projects with short listings.
Could be a good idea to have a command for switch listing on and off during source code. This could be very helpful, the listing of the part you working on.

Code:
listing on
listing off
    


would be nice commands when they can be used repeatedly in source.
And listing off could be default when compilation starts. Wink

Sometimes you see things in listings which you damn not see in your written source code. That is the mystic of programming. Just another view can open your eyes. Very Happy
Post 09 Mar 2012, 00:19
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 09 Mar 2012, 08:16
You could write a custom listing generator that would recognize some special commands in source to cut some pieces out, that should be relatively easy. I encourage any projects of better .fas-processing tools, the ones provided in fasm's package are just simple examples, which can be used as a starting points for development of some advanced ones.
Post 09 Mar 2012, 08:16
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 09 Mar 2012, 13:44
BTW, what I really need is cross reference. But IMHO, it is impossible to be created from the .fas file content.
Post 09 Mar 2012, 13:44
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler 09 Mar 2012, 14:02
Explain cross reference.
Post 09 Mar 2012, 14:02
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1670
Location: Toronto, Canada
AsmGuru62 09 Mar 2012, 14:18
@mindcooler:
It is the information on who calls which functions, I believe.

Like:
Label at address xxxxxxx is referenced from addresses: xxx, xxx, xxx...
Label at address xxxxxxx is referenced from addresses:

That ^^^ last one is a label, which never gets referenced -- good to know.
Post 09 Mar 2012, 14:18
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 09 Mar 2012, 15:50
fasm currently only keeps the information that label was referenced (the same flag that you test with "used" operator), it does not collect the list of referencing lines. But if it was collecting such info, the .fas format could easily be extended to accommodate it.
Post 09 Mar 2012, 15:50
View user's profile Send private message Visit poster's website Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler 09 Mar 2012, 16:20
Sounds more like the job for a static analyzer. Labels are the easiest symbols to get into a debugger.
Post 09 Mar 2012, 16:20
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.