flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3 ... 26, 27, 28 ... 31, 32, 33 Next |
Author |
|
Andrew Martin 07 Oct 2015, 20:09
revolution wrote:
It`s pure hardcore ![]() |
|||
![]() |
|
Tomasz Grysztar 08 Oct 2015, 10:30
It is one of the reasons why I decided to create the fas format - because the existing debug information formats were not entirely capable of containing the kind of information fasm may provide. From the .fas file you can deduce both the line that called a macro, and a line in definition of a macro that generated the specific byte. Or perhaps a whole sequence of line numbers for macros called from inside macros. And in some cases the definition of a macro was itself generated by another macro and then you have another tree of lines that were the "source" for a given line in macro, which in turn was a source for some final instruction that got assembled, etc.
But because I had no existing format that I had to follow, I chose to just dump some of fasm's internal structures with little to no conversion and that's what the "fas" format is. This made the implementation quite simple but at the price of making it a format that is only really applicable to fasm 1.x. So because there were no existing formats that were universal enough, I created another one that is also not universal in the slightest - it is only there to contain some types of information specific to fasm 1.x. Perhaps if I ever think about making a debug information format for my new assembly engine I should try to design something more clean and generalized. |
|||
![]() |
|
Andrew Martin 09 Nov 2015, 17:09
A problem with an elf again
![]() .symtab header is broken. readelf log: Code: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 00000000 000054 000010 00 AX 0 0 4 [ 2] .shstrtab STRTAB 00000000 000064 000048 00 0 0 0 [ 3] .debug_abbrev PROGBITS 00000000 0000ac 000010 00 0 0 0 [ 4] .debug_info PROGBITS 00000000 0000bc 000068 00 0 0 0 [ 5] .debug_line PROGBITS 00000000 000124 00003c 00 0 0 0 [ 6] .symtab SYMTAB 00000000 000160 000070 10 7 12 4 [ 7] .strtab STRTAB 00000000 0001d0 00002c 00 0 0 0 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings) I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) Symbol table '.symtab' contains 7 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 OBJECT LOCAL DEFAULT 1 $d 2: 00000008 0 FILE <unknown>: 3 DEFAULT 1 $t 3: 0000000c 0 OBJECT LOCAL DEFAULT 1 $d 4: 00000000 0 FUNC LOCAL DEFAULT 1 __Vectors 5: 0000000c 0 FUNC LOCAL DEFAULT 1 lbl 6: 00000008 0 FUNC LOCAL DEFAULT 1 Reset_Handler 1) invalid sh_info member in .symtab section header 2) invalid st_info member in symbol table entry №2 (binding attribute). Possible Name also invalid (may be test.asm). Test files:
Last edited by Andrew Martin on 12 Nov 2015, 12:45; edited 1 time in total |
|||||||||||
![]() |
|
revolution 12 Nov 2015, 12:21
Questions related to Linux and ioctl have been moved. See:
http://board.flatassembler.net/topic.php?t=18712 |
|||
![]() |
|
revolution 12 Nov 2015, 12:47
Andrew Martin wrote: A problem with an elf again |
|||
![]() |
|
revolution 12 Nov 2015, 12:50
Tomasz Grysztar wrote: It is one of the reasons why I decided to create the fas format - because the existing debug information formats were not entirely capable of containing the kind of information fasm may provide. From the .fas file you can deduce both the line that called a macro, and a line in definition of a macro that generated the specific byte. Or perhaps a whole sequence of line numbers for macros called from inside macros. And in some cases the definition of a macro was itself generated by another macro and then you have another tree of lines that were the "source" for a given line in macro, which in turn was a source for some final instruction that got assembled, etc. |
|||
![]() |
|
revolution 16 Nov 2015, 04:44
Version 1.37 now available:
Quote: v1.37 2015-Nov-16 |
|||
![]() |
|
Andrew Martin 16 Nov 2015, 12:37
It is possible to add the attribute DW_AT_comp_dir with full path name of main source file?
|
|||
![]() |
|
revolution 16 Nov 2015, 13:18
Andrew Martin wrote: It is possible to add the attribute DW_AT_comp_dir with full path name of main source file? |
|||
![]() |
|
Andrew Martin 16 Nov 2015, 16:10
My MCU debugger (Keil uVision) does not find the source files when load *.axf generated by FASMARM.
However, it find source files when load *.axf generated by GNU assembler (gas) + LD linker or ARMASM+ARMLINK. Tools with strict requirements to the ELF&DWARF format specification does not works correctly. Something in ELF or DWARF still incorrect. I think that reason is in an attribute DW_AT_comp_dir. Maybe I'm wrong... |
|||
![]() |
|
revolution 16 Nov 2015, 16:44
The compilation directory is not mandatory. And the format is platform specific. If you compile a file on one system and use DW_AT_comp_dir then you can't use that file on another system because the paths will be unlikely to match.
|
|||
![]() |
|
Andrew Martin 16 Nov 2015, 19:34
In most cases debug followed immediately after compilation on the same computer, so systems the same.
|
|||
![]() |
|
Andrew Martin 26 Nov 2015, 11:40
My debugger (Keil uVision) dont likes that:
- the labels addresses in the symbols table are even (perhaps because THUMB mode); - all labels have LOCAL binding, but labels in source code must have GLOBAL binding; - incorrect line number program end From DWARF-2 specification: Code:
DW_LNE_end_sequence
Set the end_sequence register of the state machine to ‘‘true’’ and append a row to the
matrix using the current values of the state-machine registers. Then reset the registers to
the initial values specified above.
Every statement program sequence must end with a DW_LNE_end_sequence
instruction which creates a row whose address is that of the byte after the last target
machine instruction of the sequence.
For example, GAS produces: Code: Line Number Statements: [0x00000029] Extended opcode 2: set Address to 0x8 [0x00000030] Advance Line by 15 to 16 [0x00000032] Copy [0x00000033] Advance PC by 2 to 0xa [0x00000035] Extended opcode 1: End of Sequence Last machine instruction address = 0x8, machine instruction size = 2 bytes Last row address = 0xA FASMARM: Code: Line Number Statements: [0x00000026] Advance Line by 47 to 48 [0x00000028] Copy [0x00000029] Advance Line by 7 to 55 [0x0000002b] Special opcode 48: advance Address by 8 to 0x8 and Line by 0 to 55 [0x0000002c] Extended opcode 1: End of Sequence Last machine instruction address = 0x8, machine instruction size = 2 bytes, but last row address = 0x8. |
|||
![]() |
|
Andrew Martin 03 Dec 2015, 11:33
Another invalid ELF example - possibly in symbol table and line number program.
|
|||||||||||
![]() |
|
revolution 03 Dec 2015, 13:37
Thanks for the reports. When I am back at my desk I will look into these.
|
|||
![]() |
|
revolution 05 Dec 2015, 03:39
Well I lied. I haven't yet got back to my desk. But anyhow, Andrew Martin, can you please try with this binary file and see if your issue(s) are better (and/or worse
![]()
|
|||||||||||
![]() |
|
Andrew Martin 05 Dec 2015, 15:27
Much better, but invalid sh_info member in .symtab section header.
|
|||
![]() |
|
revolution 05 Dec 2015, 17:25
Andrew Martin wrote: Much better, but invalid sh_info member in .symtab section header. |
|||
![]() |
|
Andrew Martin 05 Dec 2015, 18:27
Yes. Now (with 0x10) almost all OK
![]() |
|||
![]() |
|
Goto page Previous 1, 2, 3 ... 26, 27, 28 ... 31, 32, 33 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.