views:

187

answers:

2

Hello! I'm having trouble using software breakpoints in WinDbg in order to break in a given address.

It's a Visual C++ 6.0 MFC executable without symbols (belive me, I just can not generate the symbols).

Suppose my executable image is named image00400000. Using Software Breakpoints (bp):

0:000> bp image00400000 + 0x003ba1eb

0:000> bl

0 e 007ba1eb 0001 (0001) 0:**** image00400000+0x3ba1eb

0:000> g

I get the relative address (0x003ba1eb) from the .map file (this one I got it). I pick up a line which I'm sure that will be executed, but there is no stop at all...

Does anyone have any ideas? I'd appreciate them. Thank you!

PD: If there's anything left to explain or you need more info, just drop me a comment :-)

A: 

To add symbols, you need to make a debug build

BUILD menu item

Set Active Configuration

Select the Debug Configuration, instead of the release configuration. Rebuild everything, and your symbols should be there.

EvilTeach
Look... besides the fact that symbols can be generated EVEN in a Release build, I'll repeat that due to a lib I'm using I can NOT generate symbols.
David Alfonso
dude - don't get shirty - he's only trying to help you.
Preet Sangha
Sorry, it must be my english as a second language...
David Alfonso
My appologies to you. The text of your question seemed to me to indicate that you were unable to build the executable with symbols. I don't recall seeing that the reason was a specific lib. No insult was intended.
EvilTeach
My apologies to YOU! Thank you for you help anyway!
David Alfonso
+1  A: 

Sorry I'm not allowed to create comments yet (too new) to SO.

It is a bit tricky to be specific with the information available. I guess it is possible that the breakpoint address isn't calculated correctly. Given the situation I would attempt to calculate the breakpoint address as: Module start + code start + code offset from the map file. Maybe this is what you did (unless I got it wrong ;-) )

Also worth noting that the bp address needs to align on an instruction boundary. If it doesn't then it won't be set properly. This could be possible if you are having to guess at trying to get a breakpoint into a particular function.

It might be helpful to outline a little more about the condition under which you want the program to stop in the debugger.

Paul Arnold