Breakpoint not working for SOSEX using !mbp

928 Views Asked by At

I'm trying to debug a C# application using SOSEX in WinDbg for 32 bit environment in .NET Framework 4.0. I use sosex.dll for 32 bit v4.0.

Here are the steps:

  1. sxe ld:mscorlib
  2. sxe ld:clrjit
  3. load Path to sosex.dll
  4. !mbp application.cs 34 (this sets breakpoint at line 34)

It works fine here.

However, when I start WinDbg fresh and attach to the C# application.exe process and do the necessary steps, the breakpoint doesn't work.

One thing I have observed is that the first time I ran the lm command in WinDbg, the output showed only application.exe.

But the next time, the lm command showed all the modules already loaded (clrjit, mscorlib, etc.)

Is this why the breakpoint isn't working?

1

There are 1 best solutions below

2
On

With SOSEX, steps 1 and 2 above are unnecessary. If you launch an application from the debugger, you can use !mbm and !mbp from the initial breakpoint.

As for your problem, what is located at application.cs, line 34? Is this the entry point (Main)? It sounds like you're trying to break after the code has already run. Please attach all the debugger spew from your attempt to break. This will help to pinpoint the cause of the problem.