Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Is there a .map tool to help Convert acc.violation address to line number



Permlink Replies: 12 - Last Post: Jan 6, 2016 8:00 AM Last Post By: Lajos Juhasz
Peter Gannon

Posts: 23
Registered: 6/16/06
Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2015 12:59 AM
Is there a tool to help Convert access violation address to line number in Delphi 2006?

I have a .map file saved for my release version of my program.

A user reports and error at e.g. 00BE2C63

I can manuually hunt through the .map, subtracting 401000 and find it.

But has someone written a tool to find the source line?
Arnaud Bouchez

Posts: 137
Registered: 8/2/15
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2015 2:20 AM   in response to: Peter Gannon in response to: Peter Gannon
Peter Gannon wrote:
But has someone written a tool to find the source line?

You can use our LogView tool.
Open any log/text file with it.
You would see the ".map" button.
Click on it.
Select the map file.
Enter the hexadecimal address.
See http://blog.synopse.info/post/2011/08/20/Enhanced-Log-viewer
and http://synopse.info/files/LogView.zip

Of course, the best is to integrate the .map into the .exe, and log the exception at runtime, with the source code line.
Our compressed .mab format is much smaller than the original .map (and also smaller than all alternatives I know).
And you get a lot of additionnal features with our Open source SynLog unit - which works from Delphi 5 (yes!) up to Delphi 10 Seattle.
See http://synopse.info/files/html/Synopse%20mORMot%20Framework%20SAD%201.18.html#TITL_16
Peter Gannon

Posts: 23
Registered: 6/16/06
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2015 8:45 AM   in response to: Arnaud Bouchez in response to: Arnaud Bouchez
Many thanks.

This is for an existing issue, on an already shipping program. It looks like the tool you mentioned is great, but requires that we have a log file done ahead of time - is that correct? It cannot work if you just have a .map and an adrress of exception.

We;re looking for something that just requires a .map file and you type in an excpetion address, and it does the lookup that people usually do manually.
david hoke

Posts: 616
Registered: 2/9/07
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2015 8:52 AM   in response to: Peter Gannon in response to: Peter Gannon
Peter Gannon wrote:

Many thanks.

This is for an existing issue, on an already shipping program. It
looks like the tool you mentioned is great, but requires that we have
a log file done ahead of time - is that correct? It cannot work if
you just have a .map and an adrress of exception.

We;re looking for something that just requires a .map file and you
type in an excpetion address, and it does the lookup that people
usually do manually.

Have you considered...

if you only have the one address of concern, you could just open the
.map file and examine it 'manually'... I haven't looked at a map file
for a very long file, but I don't think its too hard to find the
appropriate line number from an address (when line #'s are present).

Or, you could load the program under IDE, step into it one instruction,
go to CPU pane, goto (^G/Alt-G ?) the address you have, then ask it to
show you the source (^V I think)... that of course assumes you have
sufficient debug info locally, or that you could appropriately rebuild
the particular version in question...
david hoke

Posts: 616
Registered: 2/9/07
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2015 8:54 AM   in response to: david hoke in response to: david hoke
Sorry,

david hoke wrote:

Have you considered...

if you only have the one address of concern, you could just open the
.map file and examine it 'manually'... I haven't looked at a map file
for a very long file, but I don't think its too hard to find the
appropriate line number from an address (when line #'s are present).

waited to long to reply without re-reading, I see that you already did
determine it manually from .map file...
Arnaud Bouchez

Posts: 137
Registered: 8/2/15
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 10, 2015 12:55 AM   in response to: david hoke in response to: david hoke
david hoke wrote:
Or, you could load the program under IDE, step into it one instruction,
go to CPU pane, goto (^G/Alt-G ?) the address you have, then ask it to
show you the source (^V I think)... that of course assumes you have
sufficient debug info locally, or that you could appropriately rebuild
the particular version in question...

It means that you need the exact same version of your program source code, including all third party tools, so that you are able to re-compile the program with the same exact context as it was!
Very error prone, even with a source code manager, IMHO...

Archiving the .map file (or our compressed .mab, or include it into the .exe) is a better/safer alternative.
Arnaud Bouchez

Posts: 137
Registered: 8/2/15
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 10, 2015 12:48 AM   in response to: Peter Gannon in response to: Peter Gannon
Peter Gannon wrote:
We;re looking for something that just requires a .map file and you type in an excpetion address, and it does the lookup that people usually do manually.

A log file is not needed.
As I wrote, just open any .txt file, to access the main log view, then you could click on the ".map" button.
It is just a trick to bypass the UI of the tool, and access its secondary features.
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2015 9:39 AM   in response to: Arnaud Bouchez in response to: Arnaud Bouchez
Arnaud Bouchez wrote:

Peter Gannon wrote:
But has someone written a tool to find the source line?

You can use our LogView tool.
Open any log/text file with it.
You would see the ".map" button.
Click on it.
Select the map file.
Enter the hexadecimal address.
See http://blog.synopse.info/post/2011/08/20/Enhanced-Log-viewer
and http://synopse.info/files/LogView.zip

Where can I find more information how to use Synopse logging in
packages? Is it enough to include map/mab files for the packages or it
requires some further steps?
Arnaud Bouchez

Posts: 137
Registered: 8/2/15
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 10, 2015 12:50 AM   in response to: Lajos Juhasz in response to: Lajos Juhasz
Lajos Juhasz wrote:
Where can I find more information how to use Synopse logging in
packages? Is it enough to include map/mab files for the packages or it
requires some further steps?

I never used them in packages, but we received some patches to support packages.
And it works with regular .dll files - so it should work with packages.

IMHO just try to include the .map into the package file, using the Map2Mab.exe tool.

Any feedback is welcome!
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 6, 2016 8:00 AM   in response to: Arnaud Bouchez in response to: Arnaud Bouchez
Arnaud Bouchez wrote:

Lajos Juhasz wrote:
Where can I find more information how to use Synopse logging in
packages? Is it enough to include map/mab files for the packages or
it requires some further steps?

I never used them in packages, but we received some patches to
support packages. And it works with regular .dll files - so it
should work with packages.

IMHO just try to include the .map into the package file, using the
Map2Mab.exe tool.

Any feedback is welcome!

Finally I have had some time to play with Synlog. Unfortunately in my
case it's not working. It fails on the first step
GetModuleName(hInstance) detects the wrong filename it returns the name
of the first package loaded not the package that contains the module
that raised the exception (tested with Access violation).

When I will have more time I will try to dig deeper to find out more
details. Also in my case for a stack trace multiple TSynMapFile would
be required.
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2015 10:15 AM   in response to: Peter Gannon in response to: Peter Gannon
Am 09.12.2015 um 09:59 schrieb Peter Gannon:
Is there a tool to help Convert access violation address to line number in Delphi 2006?

I have a .map file saved for my release version of my program.

A user reports and error at e.g. 00BE2C63

I can manuually hunt through the .map, subtracting 401000 and find it.

But has someone written a tool to find the source line?

Hello,

for future projects a look at MadExcept or EurekaLog might be usefull.
They'll give you complete stack traces as well.

Greetings

Markus
Robert Love

Posts: 155
Registered: 5/3/07
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2015 10:17 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
for future projects a look at MadExcept or EurekaLog might be usefull.
They'll give you complete stack traces as well.

As will the JCLDebug.pas in the Open Source JCL
Arnaud Bouchez

Posts: 137
Registered: 8/2/15
Re: Is there a .map tool to help Convert acc.violation address to line number
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 10, 2015 12:52 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
for future projects a look at MadExcept or EurekaLog might be usefull.
They'll give you complete stack traces as well.

As with SynLog: stack tracing is integrated to the logging, and could be done for exceptions and errors, or at request for a particular set of event kinds.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02