flat assembler
Message board for the users of flat assembler.
Index
> Linux > Debugging symbols in Linux and BSD |
Author |
|
baldr 27 Apr 2010, 08:30
sachamasry,
Probably you need to find/write tool to convert .fas FASM symbolic information into appropriate for your debugger format. |
|||
27 Apr 2010, 08:30 |
|
sachamasry 27 Apr 2010, 09:55
Thanks for the reply baldr.
I realise this. This area doesn't seem to be covered in the manual or any other official documentation which is why I'm asking this question. As far as I understand it, gdb requires stabs symbols output to be able to display the program listing. I have no idea how to supply symbols to gdb in any format, except where they have been explicitly created and added to the object (executable) by gas/NASM/YASM. So: 1. Is there a tool/script that will convert .fas symbolic information to gdb's stabs? Or to whatever format ALD uses? 2. How is a .fas symbolic information file created in the first place? or, how do the rest of the people on Linux and BSD debug FASM executables? Any help at all would be appreciated-I've seen the question raised on the forums, without reference to a working solution. As FASM is now available and used on both Linux and BSD systems, surely those who have converted from their previous assemblers have put together some sort of workflow? |
|||
27 Apr 2010, 09:55 |
|
revolution 27 Apr 2010, 10:03
1. Not that I know of.
2. It is an assembly time selection. In console version you select third file at the command line. In IDE there is a menu option. 3. We don't debug, we write perfect code first time every time. Yeah, right, we really wish THAT were true! |
|||
27 Apr 2010, 10:03 |
|
sachamasry 27 Apr 2010, 11:39
revolution,
Are you saying that: There are no Linux/BSD-based debuggers able to debug FASM output, to your knowledge? Those still choosing to develop with FASM on Linux (against all odds) can not and do not debug any code? ? Really? So what do they do-go back to NASM/YASM? |
|||
27 Apr 2010, 11:39 |
|
revolution 27 Apr 2010, 11:52
When you generate an executable directly from fasm there is no symbol table generated that is useable directly by existing external tools. But you can always generate an object format and then link. That will give you some rudimentary symbolic information, right? You just gotta use public and extrn directives.
|
|||
27 Apr 2010, 11:52 |
|
Tomasz Grysztar 27 Apr 2010, 12:23
Please check out this thread: http://board.flatassembler.net/topic.php?t=9792
Yes, we have a kind of shortage of people willing/able to write a bunch of converters from .fas into various debug info formats. |
|||
27 Apr 2010, 12:23 |
|
sachamasry 27 Apr 2010, 12:46
Ok, the first part I now know from the documentation and forums, and am not generating executables, in favour of a separate linking stage with ld.
As for the second part, I understand that it's possible to disassemble the binary file and see the instructions inside, and [possibly] follow along with gdb and the disassembled source side by side. It's counterintuitive, though, and likely to be very difficult for any meaningful program. To be honest, though, I'm not sure what you mean by using public and extrn directives-what would I be attempting to achieve using these? Sorry, I've just started looking at FASM and am really trying to get to grips with it (unsuccessfully, though). Thanks for the pointer, though. |
|||
27 Apr 2010, 12:46 |
|
revolution 27 Apr 2010, 12:51
[tongue-in-cheek]
sachamasry: Use fasmarm instead. It generates full debug info for source level debugging when using the DWARF output format. [/tongue-in-cheek] BTW: public and extrn are explained here: http://flatassembler.net/docs.php?article=manual#2.4.4 |
|||
27 Apr 2010, 12:51 |
|
Tomasz Grysztar 27 Apr 2010, 12:57
revolution wrote: [tongue-in-cheek] |
|||
27 Apr 2010, 12:57 |
|
revolution 27 Apr 2010, 13:25
Is DWARF suitable for x86 CPUs? Are there any x86 debuggers that can read DWARF?
|
|||
27 Apr 2010, 13:25 |
|
revolution 27 Apr 2010, 13:37
Actually there isn't a need to make a special app for fas2DWARF. It wouldn't be very difficult to make a fasm version with DWARF integrated as a native output format. The only difficulty comes with the problem of no definitions for the x86 code types. What would a debugger make of the THUMB code type? What would be the x86 equivalents of THUMB code? Or ARM code? Or THUMBEE code?
|
|||
27 Apr 2010, 13:37 |
|
Tomasz Grysztar 27 Apr 2010, 13:45
revolution wrote: It wouldn't be very difficult to make a fasm version with DWARF integrated as a native output format. |
|||
27 Apr 2010, 13:45 |
|
revolution 27 Apr 2010, 13:51
Well you already got PE, ELF and BIN. It is just another executable format.
Anyhow, currently it would be easier to make a .asm-to-.dwarf, than it is to make a .fas-to-.dwarf. Since all the code is already there and tested. People could make a special fasm version for themselves and pretend it is just for symbolic generation, whereas it would actually be a full assembler also. |
|||
27 Apr 2010, 13:51 |
|
Fanael 27 Apr 2010, 13:59
revolution wrote: Is DWARF suitable for x86 CPUs? revolution wrote: Are there any x86 debuggers that can read DWARF? |
|||
27 Apr 2010, 13:59 |
|
sachamasry 28 Apr 2010, 01:23
revolution, thanks for the public and extrn directives. These make sense now, and as you said, using them helps debugging in gdb with disassembly immensely.
Fanael and Tomasz are absolutely right-gdb uses and understands the dwarf data format, I have tried outputting it in YASM and it's read automatically. This makes for a situation in which it is tolerable to debug, and possible to use FASM as the assembler of choice. Naturally, it would be desirable to debug with a proper symbols output, so if there is a gleam in the author's eye, the *nix community would benefit immensely from a usable debug output. Thank you all for helping. |
|||
28 Apr 2010, 01:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.