anand
anand

Reputation: 11339

Breakpoint on api exposed from COM interface

Lets say thers is one interface

interface Ifoo
{
   HRESULT foo();
};

which is part of a binary dll. I dont have source code for this.

Can I put a breakpoint on foo() API exposed from the interface Ifoo of this binary dll using Windbg?

I know we can put breakpoints on binary dll's using windbg but using COM I am not sure.

Upvotes: 0

Views: 702

Answers (2)

anand
anand

Reputation: 11339

Well thanks for pointing out, I actually meant putting breakpoint on implementation of foo.

So I found out. In my case I wanted to put breakpoint on one of windows system dll.

So I ran commands on Windbg as

> x  dllname*!foo*

It gave me list of foo implementations in in dlls with name matching dllname.

like

7331122 dllname!CFoo::foo

Then with using this address I put breakpoints

bp 7331122

U can view the set breakpoints using command

 >bl

Upvotes: 1

Johannes Passing
Johannes Passing

Reputation: 2805

Regardless of whether you use COM or not, you cannot put breakpoints on an interface: An interface is never executed, so there is no way to "break" on an interface.

If, however, you know that Ifoo is implemented by CFoo, you could, of course, set a breakpoint on CFoo::foo.

Upvotes: 1

Related Questions