🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3402

Re: MAP File generation with line numbers

#3402
From: Helmut Giese
Date: Tue, 20 Jun 2006 12:45
56 lines
3110 bytes
On Mon, 19 Jun 2006 11:02:28 -0700, Bob Gonder
<notbg@notmindspring.invalid> wrote:

>See an older thread.
>From: hgiese@ratiosoft.com (Helmut Giese)
>Newsgroups: borland.public.cppbuilder.commandlinetools
>Subject: How to relate code address to line in source code?
>
>I wonder if Helmut ever figured it out.
Well, he did. :)

Hi Bob,
you maintain an impressive collection of links.

For the sake of the OP (or anybody else interested in this): It's
possible, but it's a _lot_ of work.

First I tried analyzing the .obj files. I had found some documentation
but it turned out to be insufficient. Basically an .obj file consists
of a suite of blocks which are structured like this:
- 1 byte: key (what type of block)
- 2 bytes: size of data to follow
- n bytes of data

So you hop along analysing the content of each block according to its
type. But invariably at some point the sequence seemed broken. Well,
it couldn't really be broken, because the linker knows how to handle
those .obj files, but the sequence didn't make sense:
- you found an unknown type or
- the size was impossible (leading beyond the actual file size)

So after a week of frustrating work (ever stared at binary data trying
to grok its structure?) I gave up.

There was another road to try out: bordebug.dll. It contains functions
which know to analyse a .tds file - but be warned: it is no joy to
work with.
But if anybody wants to go this route: Get a copy of Delphi Magazine
Issue 63. It contains an article "The return of the giant" which
presents a tool (in Delphi, of course) which uses bordebug.dll to show
you all kinds of information.
The sources are available online but the article _really_ helps. I
strongly suggest investing those 7 British Pounds to get a copy.

But still a last warning: You should have an exceptional need if you
think you need this kind of information - something like building your
own debugger - otherwise the investment in time is ridiculously large
wrt to the actual gain.
We did have such a need - don't ask, the project has been put on hold,
otherwise I would take this chance to brag about what a great guy I am
tackling this chore :)

Bob, somehow you put me into talking mode. Ok, now you know more about
this topic than you probably ever wanted to. :)
Have a nice time
Helmut Giese
Technical Details
Message-ID: <4497e6bb.1714921@forums.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <44968372$1@newsgroups.borland.com> <6epd92l60sbv5lhqe4i0mc2jud5v5fdapj@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a64749f92dc434a7
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: hgiese@ratiosoft.com (Helmut Giese)
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: MAP File generation with line numbers
Date: Tue, 20 Jun 2006 12:45:52 GMT
Message-ID: <4497e6bb.1714921@forums.borland.com>
References: <44968372$1@newsgroups.borland.com> <6epd92l60sbv5lhqe4i0mc2jud5v5fdapj@4ax.com>
X-Newsreader: Forte Free Agent 1.11/32.235
NNTP-Posting-Host: 84.138.141.187
X-Trace: newsgroups.borland.com 1150809921 84.138.141.187 (20 Jun 2006 06:25:21 -0700)
Lines: 56
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail