1

How to set breakpoint on this C++ symbol?

bp qmgr!TokenHandle::operator-: Could not resolve error at 'qmgr!TokenHandle::operator-:'

in windbg?

4

Make sure your symbol is correct
Couldn't resolve means the symbol doesn't exist
first confirm with x /f /v (f shows only functions and v shows verbose information )
next set breakpoint on the symbol using the advice spit out by the debugger
most inline functions would require bm breakpoints
or bu breakpoints

bp breakpoints can fail on inlined or overloaded functions (Ambigous functions)

0:000> x /f /v calc!*CSc*::*=*
pub func   00ad4248             0 calc!CScientificKeypad::operator= (<no parameter info>)

0:000> x /1 calc!*CSc*::*=*
calc!CScientificKeypad::operator=

0:000> bp calc!CScientificKeypad::operator=

Couldn't resolve error at 'calc!CScientificKeypad::operator='
The breakpoint expression "calc!CScientificKeypad::operator=" evaluates to the inline function.

Please use bm command to set breakpoints instead of bp.

0:000> bu calc!CScientificKeypad::operator=
Couldn't resolve error at 'calc!CScientificKeypad::operator='
The breakpoint expression "calc!CScientificKeypad::operator=" evaluates to the inline function.
Please use bm command to set breakpoints instead of bu.

0:000> bm calc!CScientificKeypad::operator=
  1: 00ad4248          @!"calc!CScientificKeypad::operator="

0:000> bl
 1 e 00ad4248     0001 (0001)  0:**** calc!CScientificKeypad::operator=
0:000> g

Breakpoint 1 hit

calc!CScientificKeypad::operator=:
00ad4248 8bff            mov     edi,edi

0:000> kb
 # ChildEBP RetAddr  Args to Child              
00 0015e7fc 00ad41eb 00b043c8 2b3b2a3d 761ef2a9 calc!CScientificKeypad::operator=
01 0015e828 00ad3fe7 00b0433c 00b043c8 000000aa calc!CScientificMode::CScientificMode+0x49
02 0015e878 00ad3e69 00000000 762025df 00b04210 calc!CContainer::LayoutScientificMode+0x93
03 0015f0fc 00ab1b0e 00000000 00b04a68 0025264c calc!CContainer::AssembleDialogsWithoutToolset+0x18e
04 0015fe6c 00ac219a 00ab0000 00000000 0025264c calc!WinMain+0x581
05 0015fefc 77883c45 7ffdf000 0015ff48 77d537f5 calc!_initterm_e+0x1a1
06 0015ff08 77d537f5 7ffdf000 77c5ad65 00000000 kernel32!BaseThreadInitThunk+0xe
07 0015ff48 77d537c8 00ac2d6c 7ffdf000 00000000 ntdll!__RtlUserThreadStart+0x70
08 0015ff60 00000000 00ac2d6c 7ffdf000 00000000 ntdll!_RtlUserThreadStart+0x1b
3

It looks like you have an extra colon at the end of your string (operator-:) and you may need to use bm instead of bp.

class TokenHandle
{
public:
    int data;
    TokenHandle(int i) 
    {
        data = i;
    }
    TokenHandle operator-(TokenHandle& in)
    {
        return TokenHandle(data - in.data);
    }
};

WinDbg:

0:000> bm test!TokenHandle::operator-
  1: 00000001`3fd62da0 @!"test!TokenHandle::operator-"

Alternately verify that the debugger is able to find the right symbols (and you can always set a breakpoint on the address found):

0:000> x test!TokenHandle*
00000001`3fd62da0 test!TokenHandle::operator- (class TokenHandle *)
00000001`3fd626c0 test!TokenHandle::TokenHandle (int)
0:000> bp 00000001`3fd62da0 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.