CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2010
    Posts
    907

    How to generate symbols?

    Hi,
    I am using Macro Assembler 6.11
    ml /omf /c /Zi /Zd program.asm
    link /segments:500 program.obj
    I am using Microscope debugger, but I can't find any debugging info inside the program.
    Any advices for me?
    Thanks
    Jack

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: How to generate symbols?

    Sounds like that debugger can't handle the debug info. Reading this http://social.msdn.microsoft.com/For...6-541c7575e5fa it seems that you have CodeView in that package so try with that instead.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #3
    Join Date
    Dec 2010
    Posts
    907

    Re: How to generate symbols?

    fatal error L1101: invalid object module
    Object file offset: 800fd Record type: 9c

    I got this error when I tried to include /CO [CODEVIEW] into the program, it is a link time error
    Thanks
    Jack

  4. #4
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: How to generate symbols?

    Hm, are you sure you're using the proper linker? I mean, is it possible that your path's are setup in a wrong way?

    I'm unable to try things out myself unfortunately. I tried to find that masm version at microsoft but failed (only found version 8).
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  5. #5
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: How to generate symbols?

    In addition to what S_M_A posted...

    What makes you think you need the /omf option? Perhaps the linker doesn't like that. Also, the /SEGMENTS:500 looks pretty suspicious to me. Aside from the fact that it's quite a lot (you know, we already discussed that... ), neither the MASM 6.1. manual (not 6.11, however) I have here nor the help of the LINK 10.00 that came with VC++ 2010 lists an option like that.

    Also, just to make sure, you did specify the option /CO on the linker command line, didn't you? Then that's not "included into the program".
    Last edited by Eri523; October 3rd, 2011 at 08:26 AM.
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  6. #6
    Join Date
    Dec 2010
    Posts
    907

    Re: How to generate symbols?

    @S_M_A
    I am using the following version
    Macro Assembler 6.14.8444
    Link16. 5.12.8078
    I checked on the web, i doubt that the program is too big for the assembler/linker to work on.
    @Eri
    I use /omf because I am working on a DOS program , and yes, i also need /segments:500 because it is a single disassembly in one module. I include the /CO switch, then the message comes up, otherwise, it doesn't happen.
    Thanks
    Jack

  7. #7
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: How to generate symbols?

    Quote Originally Posted by lucky6969b View Post
    I use /omf because I am working on a DOS program , [...]
    I've written dozens of assembly language programs for DOS without ever using that option (as I said, in fact I didn't know yet it even existed). However, that's some time ago and I think I was using some MASM 6.x, not sure which version exactly, though. Have you tried to simply let MASM and LINK figure out how to store their data by themselves?

    Though my statement about the /omf option in post #5 was factually right, I had looked in the wrong place: Of course /omf is an ML option, and ML 10.00 does know it. Note, though, that MSDN states:

    Quote Originally Posted by MSDN
    [...] ML.exe does not support linking OMF objects.
    Quote Originally Posted by lucky6969b
    [...] and yes, i also need /segments:500 because it is a single disassembly in one module.
    I already told you that just that a disassemler output is a syntactically correct assembly language module does not necessariliy mean it can simply be re-assemled and linked as-is. And I have some notion yours requires a lot of modifications...

    I include the /CO switch, then the message comes up, otherwise, it doesn't happen.
    I'd suppose that option to control the linker's output, not its input, and in the error message you quoted the linker complains about an invalid input .obj file. OTOH the linker may simply skip some records in the input .obj file without that option specified.

    Just what S_M_A already recommended in post #4: Make sure you're not unintentionally mixing incompatible versions of ML and LINK.

    At any rate, I doubt you'll get much useful symbolic information from just re-assembling a disassembler output file anyway. Why don't you simply debug the original executable (or whatever that is)?
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  8. #8
    Join Date
    Dec 2010
    Posts
    907

    Re: How to generate symbols?

    Yes, I think I may want to debug the original program. But I've another question, when an interrupt handler has been setup in the TSR, how do you catch the interrupt when the "satellite" application calls the TSR? I ask because I can't have both programs running in the debugger at the same time while CV hasn't got anything like "break on interrupt xxh"
    Any ideas?
    Thanks
    Jack

  9. #9
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: How to generate symbols?

    Right, you can't "break on interrupt xxh", but nothing stops you from placing a breakpoint in the TSR's interrupt handler. Be careful, though, about intercepting anything that might directly or indsirectly be called by the debugger itself. What happens when you do intercept something used by the debugger may depend on how well the debugger is prepared to handle that case. I haven't used CV for a very long time, so I can't tell you how it behaves in that situation. Also, intercepting hardware interrupts is particularly delicate, since they're often time-critical.

    Taking the common INT 21h as an example, the rule of thumb is this: Don't intercept the entire interrupt, instead intercept individual functions of the interrupt. And the more exotic the function you intercept is, the better, best probably is intercepting a function that's even private to your application.
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured