On 11 Aug 2003 13:23:05 GMT,
(Dan Pop) wrote:
> In <> Mark McIntyre <> writes:
<snip>
> >If you crosscompile on VMS and then execute on OpenVMS, the
> >linenumbers become meaningless because the #included headers have
> >different numbers of lines. This causes debugging woes in general,
> >including breaking into the debugger, when it shows you line 2354 as
> >reported to the runtime env as the breakpoint location, while the
> >breakpoint is really at line 3456....
>
> You're posting bullshit, as usual. __LINE__ gives you the line number
> in the current source file, not in the current translation unit. When
> including a header, both __FILE__ and __LINE__ indicate the header name
> and the current line number inside the header, once you're coming back
> to the original source file, the #include line is counted as one line.
>
I think you're overeager here, Dan. What you say is true, but not in
conflict with what Mark said, nor AFAICT what the previous poster said
although I had trouble understanding that.
What Mark said is that if you compile on one system, with one set of
headers, and then run and debug on a different system with a different
set of (system) headers, when the debugger tries to chase back symbol
information in the object file it finds mismatching source. This
occurs precisely *because* the symbols track #include'd filename and
linenumbers (for code) separate from the base source file, in the same
fashion as for __FILE__ and __LINE__ -- and perhaps by the same
mechanism, although of course the standard says nothing about
mechanism. This problem is not limited to VMSen, and is annoying
everywhere it occurs. Although of course generally speaking there
shouldn't be much code generated by system headers and what there is
should be correct already and not need debugging -- except to the
extent bugs in user code manifest in called system code.
- David.Thompson1 at worldnet.att.net