1

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user1502952
  • 1,390
  • 4
  • 13
  • 27
  • If there are any details from your [earlier question on this topic](http://stackoverflow.com/questions/12244012/breakpoint-doesnt-work-in-windbg-using-sosex) that you want to add to this question, please [edit] this question and add them here. – anton.burger Sep 03 '12 at 11:06
  • Did you check this [post](http://stackoverflow.com/questions/11768921/breakpoint-set-by-sosex-mbp-or-sosex-mbm-not-working)? – Harvey Kwok Oct 20 '12 at 00:27

1 Answers1

0

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Steve Johnson
  • 2,958
  • 13
  • 15
  • it's a simple method called print() inside main() that prints "hello" at console. Breakpoint is set at this method. Before this method there is Console.ReadKey() so that when this key is hit in application, print() method is called. – user1502952 Sep 04 '12 at 06:06
  • Can you tell if the Print method has been inlined? Feel free to contact me offline. If sosex is broken, I'd like to fix it. – Steve Johnson Sep 04 '12 at 13:10