flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 24 Sep 2016, 21:18
revolution wrote: I think it is important to display the source line, the preprocessed line and the source filename for all lines involved. I have situations in fasm where I get only the source line and filename displayed with an error about some invalid thing. I sometimes find it impossible to back-trace to the original error line. For example this is a real error that I got recently: |
|||
![]() |
|
revolution 24 Sep 2016, 21:25
Tomasz Grysztar wrote: I can add an option to command line fasm that would enable displaying the preprocessed line like fasmw does - fasmw is currently the only interface that shows this information. For that specific error I only found where the error was because I had only made a few changes between assembly sessions and could narrow down the problem relatively quickly. But for cases of automated source generation it can be an enormous task to find such things. |
|||
![]() |
|
Tomasz Grysztar 24 Sep 2016, 21:30
revolution wrote: This would be good and would help towards finding the error. But I would prefer if it is on by default. But more than that is the problem of not actually displaying the file and line number where the problem is situated. Having the preprocessed output might help and allow one to search all the source files for the matching string, but it is error prone and tedious. |
|||
![]() |
|
revolution 24 Sep 2016, 21:35
In the case above the value for "string" comes from a macro parameter using the list building macros I posted in another thread. It isn't a redefined symbolic variable. Although the macro name is dynamically generated.
|
|||
![]() |
|
Tomasz Grysztar 24 Sep 2016, 21:49
You could probably use the information from fas then - the header of every macro-generated line contains two pointers: to the line that called the macro, and to the line that defined the line of macro that generated this one. This creates a binary tree structure of lines, displaying it all for normal error report would be a mess, but perhaps some tool with interactive UI that would extract this information from .fas and present the whole tree could help here a lot.
|
|||
![]() |
|
revolution 24 Sep 2016, 22:01
Okay for the fas solution, but it doesn't exist right now, and it feels like kind of a heavy duty solution to something that could be made much lighter and happen by default.
However the original post was in the fasmg thread. And since fasmg is 100% macros then I think this becomes even more important within fasmg to help the user find the problem easily. Edit: Also since fasmg is much slower there is less enthusiasm towards assembling frequently so more changes will likely happen between assembly sessions. fasm is fast enough that a user could assemble every few minutes without any difficulty, so such errors caused by editing can still be in the users short term memory, easing the pain a little. |
|||
![]() |
|
jmg 24 Sep 2016, 23:29
revolution wrote: .. I'm all for improving the fasmg reporting ![]() It should report the offending string & I think a column number would help too. maybe [Line,Col] ? Some assemblers/compilers also print 2 lines, with a Caret ^ in the second line, that easily shows the error Column number, saving counting chars.... If there is a chance the string is not in the originating file, then yes, it should include a file name prefix. |
|||
![]() |
|
Tomasz Grysztar 25 Sep 2016, 07:37
revolution wrote: Okay for the fas solution, but it doesn't exist right now, and it feels like kind of a heavy duty solution to something that could be made much lighter and happen by default. To look at some real example, compare this description of a definition of a single symbol from fasmw.fas generated by "symbols" tool, the only one so far where I attempted to present the whole tree of relations: symbols.exe wrote: ..var?YX: -0x0000000000000149+ebp, defined in {line generated by {line generated by {line generated by {line generated by {line generated by {line generated by {line generated by {line generated by {line generated by C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[67] from {line generated by {line generated by {line generated by {line generated by {line generated by {line generated by {line generated by C:\Program Files (x86)\fasm\INCLUDE/equates/user32.inc[226] from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[68]}}} from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[86]}} from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[119]}}}}} from {line generated by {line generated by {line generated by {line generated by {line generated by {line generated by {line generated by C:\Program Files (x86)\fasm\INCLUDE/equates/user32.inc[12] from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[68]}}} from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[86]}} from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[124]}}}} from {line generated by C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[15] from {line generated by {line generated by {line generated by C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[13] from C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[53]}} from C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[116]}}}} from C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[183]} from C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[195]} revolution wrote: However the original post was in the fasmg thread. And since fasmg is 100% macros then I think this becomes even more important within fasmg to help the user find the problem easily. |
|||
![]() |
|
revolution 25 Sep 2016, 07:55
Showing trees in text can be clearer when using indenting:
Code: ..var?YX: -0x0000000000000149+ebp, defined in { line generated by { line generated by { line generated by { line generated by { line generated by { line generated by { line generated by { line generated by { line generated by C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[67] from { line generated by { line generated by { line generated by { line generated by { line generated by { line generated by { line generated by C:\Program Files (x86)\fasm\INCLUDE/equates/user32.inc[226] from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[68] } } } from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[86] } } from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[119] } } } } } from { line generated by { line generated by { line generated by { line generated by { line generated by { line generated by { line generated by C:\Program Files (x86)\fasm\INCLUDE/equates/user32.inc[12] from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[68] } } } from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[86] } } from C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[124] } } } } from { line generated by C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[15] from { line generated by { line generated by { line generated by C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[13] from C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[53] } } from C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[116] } } } } from C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[183] } from C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[195] } |
|||
![]() |
|
revolution 25 Sep 2016, 08:01
Alternatively you could restrict the output to just the source lines. Here it is without duplicate lines removed:
Code: ..var?YX: -0x0000000000000149+ebp, possibly defined at C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[67] C:\Program Files (x86)\fasm\INCLUDE/equates/user32.inc[226] C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[68] C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[86] C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[119] C:\Program Files (x86)\fasm\INCLUDE/equates/user32.inc[12] C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[68] C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[86] C:\Program Files (x86)\fasm\INCLUDE/macro/struct.inc[124 C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[15] C:\Program Files (x86)\fasm\SOURCE\IDE\FASMW\fedit.inc[13] C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[53] C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[116] C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[183] C:\Program Files (x86)\fasm\INCLUDE/macro/proc32.inc[195] |
|||
![]() |
|
Tomasz Grysztar 25 Sep 2016, 08:26
You could try modding fasm and if you find a variant that seems good, I'll be happy to give it a look. Thus far I'm not yet convinced.
|
|||
![]() |
|
revolution 25 Sep 2016, 10:48
I will look into it. Maybe in a few years I'll come back here with something.
|
|||
![]() |
|
Tomasz Grysztar 25 Sep 2016, 13:24
revolution wrote: I will look into it. Maybe in a few years I'll come back here with something. ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.