flat assembler
Message board for the users of flat assembler.

Index > Main > Symbolic/debug information of fasm 1

Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 15 Feb 2009, 21:25
Since the release of 1.67.29 version, fasm contains the symbolic information generator, which you can activate with the "-s" switch (followed by the name of the file, where you want the symbolic information to be dumped). For example:
Code:
fasm test.asm -s test.fas    
should generate (upon the successfull assembly) the symbolic information and write it into TEST.FAS file.

The symbolic information file is provided in a format specific to flat assembler - the main reason behind it is that this way no information would be lost due to conversion into some other format, and also that it keeps the generator relatively simple, while the conversion into some more useful formats (like listing, map of symbols, or debug info) can be done with some external tools.

With the official fasm packages there are provided (in source form) three simple tools, that extract various kinds of information from the symbolic information dump and process it into human-readable text. They provide the listing, preprocessed source dump and symbols dump.
If there are some important changes or new features implemented in those tools, I'm going to post info about into this thread.

Other tools - according to the plan - are to be written not necessarily by me, therefore I'm attaching here the documentation draft for fasm's symbolic information format. When there are any new tools created, they are also should be linked to from this thread.

Documentation of fasm's symbolic information file format
Post 15 Feb 2009, 21:25
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 15 Feb 2009, 21:28
Here comes the list of the existing tools converting "fas" into some other formats (moderators, please feel free to edit this list anytime, when some new tools arrive):


Last edited by Tomasz Grysztar on 20 Jan 2019, 20:36; edited 2 times in total
Post 15 Feb 2009, 21:28
View user's profile Send private message Visit poster's website Reply with quote
Z3N



Joined: 01 Oct 2009
Posts: 17
Z3N 15 Jul 2010, 11:02
Tomasz, tell to me that from itself represents fasm debug info? It's native representation of code for fasm.exe or it's hand-collected info. In second case we should change fasm debug info. Because label "las:" and code " labeltoo: mov eax,eax" look equally.

I'm parsed assembly dump and if symbol size not null I use this symbol. But, size of "notlol db "sdkfjs" is not null, too. OK, I'm search the this symbol in symbol table and skip if find. But, code "lab: mov eax,eax" present in sym table. I search ":" in symbol name, but it's bad idea, is't?
How about some flags for label, code,data?

I'm try add line info into pdb files. As base I'm use DigitalMars D codeview converter (cv2pdb). Time spent for understanding fas format is too big! Can you tell me the right algo for this problem?

Sorry, my english is terrible Sad

_________________
"There will be no more delay!" (Revelation 10)
Post 15 Jul 2010, 11:02
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 15 Jul 2010, 11:48
there is something a little constraining with "build symbols" in fasmw ide, it force to use comand line just to obtain a .lst file.

[REQUEST]
instead of "build symbols" button, it would be smarter to have a "build listing" button, and then, obtain a .lst file, directlly opened in the ide as a text file.
[/REQUEST]

it makes me think about something, what is the .ash extension for?
Post 15 Jul 2010, 11:48
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 15 Jul 2010, 12:09
edfed wrote:
instead of "build symbols" button, it would be smarter to have a "build listing" button, and then, obtain a .lst file, directlly opened in the ide as a text file.

After I release FASMW with plugin system you are certainly going to have a sample plugin that makes listing. Wink

Z3N wrote:
I'm parsed assembly dump and if symbol size not null I use this symbol. But, size of "notlol db "sdkfjs" is not null, too. OK, I'm search the this symbol in symbol table and skip if find. But, code "lab: mov eax,eax" present in sym table. I search ":" in symbol name, but it's bad idea, is't?
How about some flags for label, code,data?
there really is no simple way to determine boundaries of some data in the assembly language. For example this definition:
Code:
foo db 'bar',13,10,0    
can be completely legally rewritten as:
Code:
label foo byte
db 'bar'
dw 0A0Dh
db 0    
and only programmer knows where some functional block starts and where it ends. It is even possible that the same block has many different functions and multiple labels associated, and you can have some code in the middle of the data, or data that is some code at the same time, etc. etc.

That's exactly the reason why I decided that debug info formats that were designed with higher level languages in mind are useless for the case of fasm, and that's why I designed the .fas format to contain all the fasm-specific information.

It contains about as much information as you can get, however it may be sometimes difficult to dig up some relations. See the examples in TOOLS directory of fasm's package.
Post 15 Jul 2010, 12:09
View user's profile Send private message Visit poster's website Reply with quote
Z3N



Joined: 01 Oct 2009
Posts: 17
Z3N 15 Jul 2010, 12:32
Quote:
See the examples in TOOLS directory of fasm's package.

It's very difficult read this examples, without comments. I'am trace listing.exe for some reasons. Someone instructions enter into a stupor.

Code:
label foo byte 
db 'bar' 
dw 0A0Dh 
db 0    


- label foo ->size of code 0, skipped
- db 'bar' ->present in sym table (I hope),skipped
- anonymous symbol/label, skiped (I hope it present is sym table)
- same

It is a pity, but the assumptions I can check up only houses.

_________________
"There will be no more delay!" (Revelation 10)
Post 15 Jul 2010, 12:32
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 15 Jul 2010, 13:29
Z3N wrote:
- db 'bar' ->present in sym table (I hope),skipped
- anonymous symbol/label, skiped (I hope it present is sym table)
- same

There are no symbols in those lines, therefore they have nothing to do with symbol table. However you will find all the necessary data about them in the line offsets table (both the output file offsets and the run-time addresses for each line), called "assembly dump" in the documentation.
Post 15 Jul 2010, 13:29
View user's profile Send private message Visit poster's website Reply with quote
darkprof



Joined: 25 Jul 2016
Posts: 3
darkprof 28 May 2019, 17:27
My plugin for edb-debugger. Sorry, this is not submodule.
https://github.com/darkprof83/edb-debugger/tree/FasLoader
Post 28 May 2019, 17:27
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 29 Jun 2022, 16:48
darkprof

Quote:

My plugin for edb-debugger.

How using this ?
whear is dll or exe files ?
Post 29 Jun 2022, 16:48
View user's profile Send private message Reply with quote
f2065



Joined: 01 Jan 2012
Posts: 16
Location: Russia,Moscow
f2065 28 Mar 2024, 20:06
xFasImport - plugin for importing debugging information from fasm assembler (from .fas file) into x64dbg debugger:
https://board.flatassembler.net/topic.php?t=22388
Post 28 Mar 2024, 20:06
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.