flat assembler
Message board for the users of flat assembler.
Index
> Windows > adding windows debug info into .obj file generated fasm Goto page 1, 2, 3 Next |
Author |
|
strap89 15 Feb 2009, 18:27
Hi!
I'm writing utility that adds debug info in codeview format to coff object file generated by fasm, using .fas file from fasm. Utility is based on information from YASM source files and documentation, and some information from MASM generated object files. I'm testing it only on files in my project and not sure if it works on all code from fasm. Object file generated by utility works fine in VS2005 debugger in mixed asm/c++ application. Maybe it will be useful for somebody. Best regards.
Last edited by strap89 on 15 Mar 2009, 16:00; edited 5 times in total |
|||||||||||||||||||||||||||||||
15 Feb 2009, 18:27 |
|
revolution 16 Feb 2009, 00:39
Nice. A lot of people here use a free tool called Ollydbg for debugging.
|
|||
16 Feb 2009, 00:39 |
|
strap89 19 Feb 2009, 16:04
Hi habran!
1. compile fasm -s XXX.fas XXX.asm XXX.o (Inside asm use 'format MS COFF') 2. run pecvt XXX.fas or pecvt -v XXX.fas. File XXX.obj will be produced. Switch -v print on terminal information from XXX.fas in almost readable form - very slow process! Program not fast and not heavy tested, so MASM depend continue. Information about codeview format you can read in YASM source. Best regards. |
|||
19 Feb 2009, 16:04 |
|
vid 19 Feb 2009, 16:24
good work, but MORE ERROR CHECKING! Your app crashes if output file name is empty.
|
|||
19 Feb 2009, 16:24 |
|
strap89 20 Feb 2009, 04:06
Yes. It's my mistake. Necessary run: pecvt XXX.fas XXX.obj . Sorry.
|
|||
20 Feb 2009, 04:06 |
|
vid 26 Feb 2009, 22:28
general linker question moved here: How to use linker
|
|||
26 Feb 2009, 22:28 |
|
comrade 27 Feb 2009, 14:33
Does it work with WinDbg/cdb/kd? (The Microsoft Debugging Tools).
|
|||
27 Feb 2009, 14:33 |
|
strap89 27 Feb 2009, 16:02
I'm use it only in VS2005 IDE debugger. It must work (IMHO), but i'm not shure.
|
|||
27 Feb 2009, 16:02 |
|
comrade 28 Feb 2009, 10:34
VS debugger uses dbgeng/dbghelp, which are the MSFT Debugging Tools, so yes it should work too
|
|||
28 Feb 2009, 10:34 |
|
habran 01 Mar 2009, 00:06
Hi strap89!
Congratulations, your pecvt.exe is exelent tool, now I can create .pdb files and am able to debug fasm coff object programs with WinDbg in source mode. But you have to link it with newer linker. I have used : "Microsoft (R) Incremental Linker Version 8.00.50727.42" Thank you best regards _________________ down under |
|||
01 Mar 2009, 00:06 |
|
habran 05 Mar 2009, 14:15
Hi strap89!
I have bin trying to build my MdiRichEditor for debugging using your pecvt but I have link error "fatal error LNK1000: Internal error during IMAGE::Pass2" If I Assemble source with FASM to .obj there is no problem to link it to exe only if I try to create obj with the pecvt I can't. There is no problem to build obj with pecvt if it is very small program only if it is bigger it doesn't work I think that it is a problem with the memory allocation best regards _________________ down under |
|||
05 Mar 2009, 14:15 |
|
strap89 05 Mar 2009, 16:47
Hi habran!
Biggest project that i have in fasm now is fasm itself. I'm convert it into coff format and add startup code in "C". It not work (because i do conversion simply) but compiled ok. It compiled ok in release, compiled ok with debug info, and debugger can come into start point of fasm and stop at my breakpoint (later it break out similary as release). I think it can be a few problems: 1. It may be big source file as you say. Fasm generate very very long symbol table in fas. Not used names also included and no info about it's usage so pecvt need to include all symbols. Source line count as i think not can cause problem. 2. Word MdiRichEdittor say that you probably use some external dll library in this file. Fasm also include names from dll and compiled but i'm dont know how you do this import. May be some name import operations in fasm generate in obj or fas file info not supported by pecvt. 3. It may be simply some error in pecvt. My linker, if i write wrong debug info in coff, say warning and discard debug information but link successfully. Error at link come when coff format wrong. Can you check you obj file with tool like 'pedump'? Use "pedump /A you.obj >you.log". And for original file too. Best regards.
|
|||||||||||
05 Mar 2009, 16:47 |
|
habran 05 Mar 2009, 22:15
Hi strap89!
I tried PEDUMP but information I get doesn't make me smarter here I am sending you my source code if you want to look at: regards
_________________ down under |
|||||||||||
05 Mar 2009, 22:15 |
|
strap89 06 Mar 2009, 10:41
Hi habran!
I have fast solution: comment all '.code' lines at the begining of your .asm files except main file. After that program compiled normaly as in release as in debug mode. Or you can compile each file separately (more complicated solution). To solve problem at all i need some time. For each line: "section '.text' " fasm generate separated sections in obj file with identical name. pecvt also do that but in debug info (as i suppose) this section mixed in wrong way. I will try to find solution. Best regards. |
|||
06 Mar 2009, 10:41 |
|
habran 06 Mar 2009, 13:27
Hi strap89!
I tried to comment .code and I have the same link error. Did you link the .obj to .exe and if you have did you use my makeit.bat? Would joy post .obj that you created with the pecvt so that I try to link it to .exe I am very exited about having .pdb files in FASM and looking forward to it. I have an old version of MdiRichEditor wich has only one .asm file and which I succeeded to link successfully. If you are interested I can post it to you best regards _________________ down under |
|||
06 Mar 2009, 13:27 |
|
strap89 06 Mar 2009, 15:32
I'm check again. At first time linker also crash. but after i repeat link it run success. I think when i in VS press Save All, i need to wait for complete, but i run immediately and file not fully writed. After then i try repeat this situation but unsuccessfully.
Additional change that i forgot is: i'm remove line include '\fasm\INCLUDE\Api\shlwapi.inc' in win32axp.inc because i'm not have such file. I'm attach files. See linkit.bat for used options. I'm try to keep your options. Best regards.
|
|||||||||||
06 Mar 2009, 15:32 |
|
strap89 07 Mar 2009, 09:25
Hi, habran!
I'm solve problem with multiple code sections. You can try updated version (see top post of topic). At least in your project it work. I check rapidly - if you will use it, write result please. Best regards. |
|||
07 Mar 2009, 09:25 |
|
habran 07 Mar 2009, 10:54
Hallelujah!!!
Excellent! Best regards |
|||
07 Mar 2009, 10:54 |
|
revolution 07 Mar 2009, 11:00
I think this thread should be made sticky.
|
|||
07 Mar 2009, 11:00 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.