flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > debugging information

Author
Thread Post new topic Reply to topic
NoName_s



Joined: 16 Jan 2006
Posts: 19
NoName_s 16 Jan 2006, 11:12
I want to see in new fasm dwarf, xcoff.
I founded Dwarf in elf for arm platform, but this edition of fasm can't assembly x86 instructions :(
Pls. help.
Post 16 Jan 2006, 11:12
View user's profile Send private message Reply with quote
NoName_s



Joined: 16 Jan 2006
Posts: 19
NoName_s 16 Jan 2006, 11:39
and it may be stabs
Post 16 Jan 2006, 11:39
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 16 Jan 2006, 20:03
I still plan (as I once wrote) to extend the fasm's core so it will be able to generate any verbose debug information - and then I can extend output formats to handle it. But this still needs some work (I started with some other things first).
Post 16 Jan 2006, 20:03
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20344
Location: In your JS exploiting you and your system
revolution 17 Jan 2006, 02:01
Quote:
I founded Dwarf in elf for arm platform, but this edition of fasm can't assembly x86 instructions
With a little bit of work you may be able to combine the two, standard FASM-X86 and FASMARM to make what you want. I tried to make the extension in only one file for just this reason. Take the first section of the ARMV5TE file and paste in the appropriate part of the X86_64 file. Give it a try you never know your luck.
Post 17 Jan 2006, 02:01
View user's profile Send private message Visit poster's website Reply with quote
NoName_s



Joined: 16 Jan 2006
Posts: 19
NoName_s 17 Jan 2006, 11:05
Its will great if Tomasz create support x86/arm and dwarf (ver 2 or 3) in fasm.
elf code placed in format.inc, and i must rewrite too many code from ARMv6.INC its very hard(?) for me.
See attach. Error becouse new fasm with new macroses or what?
http://rapidshare.de/files/11213697/error.PNG.html
Post 17 Jan 2006, 11:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20344
Location: In your JS exploiting you and your system
revolution 18 Jan 2006, 02:19
Quote:
Error becouse new fasm with new macroses or what?
Actually since are are still using the X86_64 instruction you don't need those two patches for the shorter and longer instructions used in ARM.

I have not updated the FASMARM code with the 1.65.x code because it is constantly changing as present. download the last stable 1.64 and use that to do your development.
Post 18 Jan 2006, 02:19
View user's profile Send private message Visit poster's website Reply with quote
NoName_s



Joined: 16 Jan 2006
Posts: 19
NoName_s 18 Jan 2006, 10:00
about arm macros i know.
If comment whose two lines we getting program http://rapidshare.de/files/11275959/FASMW.zip.html
Rewrite needed, fix some links of code, but src of compiler is biggest and i don't know it structure :(.

added: fasm show error if try compile elf and exception if COFF
Post 18 Jan 2006, 10:00
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 19 Jan 2006, 06:07
Newer YASM snapshots now support STABS (according to yasm1338 -g help), but I don't use that feature, so don't ask me anything! Smile
Post 19 Jan 2006, 06:07
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 19 Jan 2006, 08:07
I am likely to implement DWARF first.
Also something for PE would be nice, but there seems to be more than one standard...
Post 19 Jan 2006, 08:07
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 22 Jan 2006, 21:59
I've done some modifications in fasm's core to make symbol dumps possible and fasm 1.65.9 is the first public release that has them.

I'm attaching here the test-purposes-only routine "symbol_dump", which you can include in fasm's interface and put a call to it just after the "call assembler" line. It dumps into file called SYMBDUMP.TXT all the symbols (labels and constants) that got defined during the assembly, with their values and information about which line of source defined each of them.

Now some examples of what it does. For the simplest one, create test1.asm containing just:
Code:
a:    

the SYMBDUMP.TXT will look like this:
Code:
a: value 0x0000000000000000, absolute, defined in test1.asm[1]    

As test2.asm let's take this:
Code:
format ELF

section '.text' executable

 public _start
 _start:

 extrn writemsg

        mov     esi,msg
        call    writemsg

        mov     eax,1
        xor     ebx,ebx
        int     0x80

section '.data' writeable

 msg db "Elves are coming!",0xA,0
    

The SYMBDUMP.TXT is now:
Code:
_start: value 0x0000000000000000, relative to section .text, defined in test2.asm[6]
writemsg: value 0x0000000000000000, relative to external writemsg, defined in test2.asm[8]
msg: value 0x0000000000000000, relative to section .data, defined in test2.asm[19]    

The labels relative to registers:
Code:
label x at ebp+ecx*8+7    

get dumped like this:
Code:
x: value ebp+ecx*8+0x0000000000000007, absolute, defined in test3.asm[1]    


...and the most interesting things can show up, when you feed some macro-rich source into it. Using some simple macro:
Code:
macro A
{
  x:
}

A    

makes the symbol placement in dump look like:
Code:
x: value 0x0000000000000000, absolute, defined in line generated by (test4.asm[6]) from (test4.asm[3])    

The round brackets are put there because the nesting of macro definitions may come into the game, like:
Code:
macro A
{
  macro B
  \{
     x:
  \}
  B
}
A    

which make the single line in dump become quite complicated:
Code:
x: value 0x0000000000000000, absolute, defined in line generated by (line generated by (test5.asm[9]) from (test5.asm[7])) from (line generated by (test5.asm[9]) from (test5.asm[5]))    

I leave it to the reader to analyze how this dump explains what happened. Wink


Description: symbols dumper routine for fasm 1.65.9+
Download
Filename: SYMBDUMP.INC
Filesize: 4.27 KB
Downloaded: 875 Time(s)

Post 22 Jan 2006, 21:59
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 22 Jan 2006, 22:07
I'm also trying to design some extension to assembler that would generate the listing-like relation of source lines to the generated code, without any additional pass (and with the tree-like origination of each line, like in the symbol dump provided above). The only thing that worries me is whether I will be then able to feed all that information into some existing debug information format. I still don't know enough about all those formats to find out which is best suited to contain the kind of information that fasm is able to provide, and I don't know whether there is any that could accept such specific kind of information records at all.
Post 22 Jan 2006, 22:07
View user's profile Send private message Visit poster's website Reply with quote
NoName_s



Joined: 16 Jan 2006
Posts: 19
NoName_s 06 Mar 2006, 12:29
XCOFF is extend debug info format for coff/pe and gcc can generate it for coff (is for elf?). Description http://en.wikipedia.org/wiki/XCOFF.

Dwarf is more functionally and it spec N3 created in jan of 2006 http://dwarf.freestandards.org/Home.php
GCC can generate it for elf.
Post 06 Mar 2006, 12:29
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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.