Re: Alexei fixes for NASM w/Borland TD



"Alexei A. Frounze" <alexfrunews@xxxxxxxxx> wrote in message
news:3e119cb0-eed6-4ca9-bb9e-9c736444fbb1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 22, 1:23 am, "Rod Pemberton" <do_not_h...@xxxxxxxxxxxxx> wrote:
"Alexei A. Frounze" <alexfrun...@xxxxxxxxx> wrote in
messagenews:2d7b1027-9f13-4602-b810-b9b0813070c2@xxxxxxxxxxxxxxxxxxxxxxxxxxx
m...
I was only involved in two things, which I thought were bad ('cause I
needed them to work:):
1. include paths for INCBIN and the direction of the path traversal.
I've been credited for this somewhere in the doc.
2. broken symbolic debug information for Turbo Debugger. I don't
remember if this actually got fixed or reverted to what it was. The
problem AFAIR was that some of the state was saved in variables
declared as static and some NASM's functions were relying on those to
keep the state between the calls. Somebody very smartly decided to
"fix" these ugly static variables and just dropped static effectively
turning the variables into local ones. The wrong fix broke the
symbolic info.
I sent a bunch of messages on this to nasm-devel at lists... and
exchanged some info with Frank. The messages were from July 2003 and
their subject line contained:
a) Nasm + Borland ( was Once more time - outbin.c (fwd))
b) NASM's Borland Debug Info Output
I think I wasn't credited for this and that's because probably it
didn't get fixed...
Can somebody look this up in the old mail

[NASM-devel mail links]

Yep those. I still have the e-mails from those threads and all
attachments. So, if somebody wants to fix a real bug or confirm it
already being fixed, I may share those if needed.

and then in the NASM source?

I'll leave that to someone more familiar...

Same here. I just kept using the old NASM without that bug.


I think they're miffed at the moment... You might've been better off with
another thread.

Anyway, from the NASM-devel archives (including some other related posts),
this is how I'd summarize the issue:

1) "static" keyword eliminated on variables lnfname and lineno for out()
in assemble.c
2) non-static variables and/or if(src_get()) fail to preserve/restore
variables needed for debugging info
3) switching back to static variables from non-static caused invalid
free()
4) you posted a "patch" which copied the non-static variables to static
variables as a work around
5) your "patch" also appears to generate other Borland debug info

NASM 2.03.01 code in assemble.c for out() uses "static" keyword for lineno
and lnfname. NASM 2.03.01 code in assemble.c for out()'s if(src_get())
[correctly] doesn't call nasm_free() when lnfname is static.

I.e., From what I read in the NASM-devel archives, it appears to code has
been fixed, assuming the invalid free() was found. Since I don't
have Borland TD available and don't know how to use it anyway, what is the
problem Alexei?

1) credit due
2) still not working properly
3) missing extra debug info your code provided


Rod Pemberton

.



Relevant Pages

  • Re: Alexei fixes for NASM w/Borland TD
    ... include paths for INCBIN and the direction of the path traversal. ... NASM's Borland Debug Info Output ... I just kept using the old NASM without that bug. ... doesn't call nasm_freewhen lnfname is static. ...
    (alt.lang.asm)
  • Re: Create assembly obj to link with Windows objs
    ... but I received compile time errors. ... >> I don't know much in MASM but NASM files can be assembled and linked. ... how to emit/produce debug info so that VC/MS tools can understand??? ...
    (comp.lang.asm.x86)
  • Re: Debugging NASM using GDB
    ... You can add debug info in GNU assembler like: ... I just read the NASM man page, it explicitly says that it does not ... debug info to the "-f elf" format was ... obj" and "-f elf" - silently ignored in other output formats... ...
    (alt.lang.asm)