Board index » cppbuilder » BCB5 can't find source code of the DLL i'm debugging

BCB5 can't find source code of the DLL i'm debugging


2007-03-09 10:28:01 PM
cppbuilder57
BCB5 can't find the source code of the DLL i'm debugging. I only see the CPU
window, and breakpoints in my source code fail to stop execution.
This is on a new installation on my (somewhat) new machine. Debugging the
same project used to work fine on my previous machine. The source code
location changed from the old to the new machine.
I've checked/tried all I could think of:
- debug information on
- host executable in the same directory than the DLL i am debugging
- the exe loaded the right DLL
- adding the path to my source code to the "debug symbols search path" (even
though that shouldn't be needed AFAIK)
Any idea ?
Frédéric van der Plancke
 
 

Re:BCB5 can't find source code of the DLL i'm debugging

Quote
This is on a new installation on my (somewhat) new machine.
Is your OS XP or Vista?
Quote
Any idea ?
A problem like this has been documented in the newsgroups since XP came out.
I forget if it only affects debugging of DLLs that are in a separate
directory than the EXE but it is worth trying.
Once your application has started switch to the IDE and type CTRL+ALT+M to
load the "Modules" window. Then locate your DLL in this list, right click,
and choose "Reload Symbol Table". If this fixes your problem then you might
be witnessing the BCB5 + XP Debugging bug.
- Clayton
 

Re:BCB5 can't find source code of the DLL i'm debugging

"Clayton Arends" < XXXX@XXXXX.COM >wrote in message
Quote
>This is on a new installation on my (somewhat) new machine.

Is your OS XP or Vista?
XP, indeed
Quote

>Any idea ?

A problem like this has been documented in the newsgroups since XP came
out.
I forget if it only affects debugging of DLLs that are in a separate
directory than the EXE but it is worth trying.

Once your application has started switch to the IDE and type CTRL+ALT+M to
load the "Modules" window. Then locate your DLL in this list, right
click,
and choose "Reload Symbol Table". If this fixes your problem then you
might
be witnessing the BCB5 + XP Debugging bug.

- Clayton


That works ! Much thanks !
In the Modules Windows I notice the path of my DLL is (at first) blank. When
I click "Reload Symbol Table" it asks for a path. Once the right path given
(and symbols reloaded), source code debugging works fine (or so it seems, up
to now...). It even continues to work after I stop and restart the debugged
program, so I'm happy I don't have to reselect the path every time...
Frédéric
 

{smallsort}

Re:BCB5 can't find source code of the DLL i'm debugging

Good. You'll probably notice that you'll need to do that everytime you
close and reopen the IDE, unfortunately.
- Clayton
 

Re:BCB5 can't find source code of the DLL i'm debugging

"Clayton Arends" < XXXX@XXXXX.COM >wrote in message
Quote
Good. You'll probably notice that you'll need to do that everytime you
close and reopen the IDE, unfortunately.

If the problem is just that the debug symbols are not available (the blue
dots don't appear in the IDE when debugging), a long(er)-term solution is to
change the DLL's image base address to something other than the default,
which is always 0x400000.
The problem with the symbol tables comes from a change in how XP loads DLL's
when there are address conflicts that cause a DLL to be relocated.
Therefore, by avoiding relocation due to address conflicts, you can avoid
the problem of the missing debug symbols altogether. A good range for DLL
image base addresses is 0x60000000 - 0x70000000. If you have many DLL's,
you will want to make sure you locate them so that they don't overlap,
otherwise Windows will detect the conflict and relocate them, leaving you
with the missing debug symbols again. Most of my DLL's are much smaller
than 1MB, so I choose addresses on the 0x100000 boundary (e.g. 0x60100000,
0x60200000, etc.), which gives me 100 1-MB slots -- enough to avoid
conflicts all the time.
There was an article in Windows Developer's Journal back in December of 2000
that discussed the issue of DLL relocation, and source code was provided for
a utility that would automatically relocate DLL's to an address within a
specified address range based on a hash value computed from the DLL's file
name. I have taken that source code and adapted it for BCB5. If anyone is
interested in the executable (or even the source code), just let me know and
I will be happy to make it available.
- Dennis