Root > Solving bugs in your code > Bug reports > Call Stack section > Searching bug’s location

Searching bug’s location

Previous pageReturn to chapter overviewNext page   

This article is a part of working with bug reports.

 

 

1. When GUI is available

If you're working in Delphi, browse EurekaLog error dialog or use a EurekaLog viewer - you can just double click on any line in call stack. You'll be moved to that location. Very simple.

 

Few notes here:

1. A compiled application must match source files. Otherwise you will be moved to wrong location. What you can do to minimize chances for this to happen:
Open target unit in IDE. That's if you have multiple versions of the same unit.
EurekaLog is capable of using your __history folder, but in some cases you may need to extract files manually.
You may need to restore older version of file from SVN.
2. IDE must be launched and source files must be available (either opened or could be found by IDE).
3. IDE and application (error dialog or EurekaLog Viewer) must reside under the same security boundary (same user account and same elevation level under UAC).

 

 

2. When line number is available

When GUI doesn't work or not available, but you have line numbers in call stack - you need to open unit in IDE manually and use Search / Go to line number command in IDE main menu. Enter line number and press OK - you'll be moved to line location.

 

If you can't find a unit version, which matches your compiled application, then you may try to use line number offset. Open unit and find target procedure or method. Move down manually for line number offset lines. That will be your location. See this article for more info.

 

 

3. When procedure/method name is available

If you don't have line numbers information or this information is obsolete (doesn't match source), but you have a subroutine name - you can find subroutine in target unit and try to guess, where the call was. For example, if you have such call stack

 

DoSomething
DoWork
Run

 

And your DoWork routine looks like this:

 

procedure DoWork;

var

  X: Integer;

begin

  Prepare;

  DoSomething(-1);

  for X := 1 to 5 do 

    DoSomething(X);

  Done;

end;

 

Then you can guess that call stack either points to first call DoSomething(-1) or second call DoSomething(X). But it doesn't point to Prepare or Done.

 

 

5. When code address is available

Next fallback case is raw code address. There can be two options: either you have a code address OR you have module name and code offset.

 

Note: you don't need a base address of the module.

 

In either case you need to run IDE, open your project, run it and put it on pause (Run / Pause). Now, use the Search / Go to address command. Enter absolute code address. Don't forget to add '$', if you enter HEX.

 

Note: if you have code offset and module name, you need to calculate code address first. Go to View / Debug windows / Modules to open Modules window. Find your module here and get its base address. Now add a code offset to this address (include a $1000, if needed) - this will be your final code address.

 

When you press OK - you'll be moved to exact location. If it's possible - you'll see a source code (.pas file). If not (say, no debug information available) - you'll see a CPU debugger.

 

Second case (having a code offset + module name) is better than first case (having code address). Even though you have to make calculations first, but first case doesn't allow you to find location, if module on your machine is loaded at different location than module on client's machine.

 

 

See also:




Send feedback... Build date: 2023-09-11
Last edited: 2023-03-07
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/searching_bug_location.php