断点sosex.mbp设置或sosex.mbm不工作 [英] Breakpoint set by sosex.mbp or sosex.mbm not working

查看:348
本文介绍了断点sosex.mbp设置或sosex.mbm不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在用VS.NET 2010年我编了一个非常简单的.NET 4.0应用程序。

I am using VS.NET 2010. I compiled a very simple .NET 4.0 application.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestWindbg
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            Func1();
        }

        static void Func1()
        {
            int i = 0;
            int j = i + 2;
            Console.WriteLine(j);
        }
    }
}

我打开编译可执行WinDbg的6.12.0002.633。键入以下命令来加载sosex

I open the compiled executable by windbg 6.12.0002.633. Typed in the following commands to load sosex

.loadby sosex clr

那么,在下面的命令来设置断点类型

Then, type in the following command to set the break points

!mbm TestWindbg.Program.Func1
!mbp Program.cs 16

,然后运行该程序。没有一个破发点被击中。

and then run the program. None of the break points got hit.

你知道吗?

*编辑*

下面我贴我的每马克的请求环境的详细信息

Here I paste more details about my environment per Marc's request

0:004> !mbl
1 eu: disable *!TESTWINDBG.PROGRAM.FUNC1 ILOffset=0: pass=1 oneshot=false thread=ANY
2 eu: disable Program.cs, line 16: pass=1 oneshot=false thread=ANY
0:004> .chain
Extension DLL search Path:
    C:\Program Files\Debugging Tools for Windows (x64)\WINXP;C:\Program Files\Debugging Tools for Windows (x64)\winext;C:\Program Files\Debugging Tools for Windows (x64)\winext\arcade;C:\Program Files\Debugging Tools for Windows (x64)\pri;C:\Program Files\Debugging Tools for Windows (x64);C:\Program Files\Debugging Tools for Windows (x64)\winext\arcade;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\;C:\Program Files (x86)\Perforce;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\
Extension DLL chain:
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sosex: image 4.5.0.0, API 1.0.0, built Mon May 21 11:39:36 2012
        [path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sosex.dll]
    dbghelp: image 6.11.0001.404, API 6.1.6, built Wed Feb 25 18:10:27 2009
        [path: C:\Program Files\Debugging Tools for Windows (x64)\dbghelp.dll]
    ext: image 6.11.0001.404, API 1.0.0, built Wed Feb 25 18:10:26 2009
        [path: C:\Program Files\Debugging Tools for Windows (x64)\winext\ext.dll]
    exts: image 6.11.0001.404, API 1.0.0, built Wed Feb 25 18:10:17 2009
        [path: C:\Program Files\Debugging Tools for Windows (x64)\WINXP\exts.dll]
    uext: image 6.11.0001.404, API 1.0.0, built Wed Feb 25 18:10:20 2009
        [path: C:\Program Files\Debugging Tools for Windows (x64)\winext\uext.dll]
    ntsdexts: image 6.1.7015.0, API 1.0.0, built Wed Feb 25 18:09:22 2009
        [path: C:\Program Files\Debugging Tools for Windows (x64)\WINXP\ntsdexts.dll]
0:004> sx
  ct - Create thread - ignore
  et - Exit thread - ignore
 cpr - Create process - ignore
 epr - Exit process - break
  ld - Load module - output
  ud - Unload module - ignore
 ser - System error - ignore
 ibp - Initial breakpoint - break
 iml - Initial module load - ignore
 out - Debuggee output - output

  av - Access violation - break - not handled
asrt - Assertion failure - break - not handled
 aph - Application hang - break - not handled
 bpe - Break instruction exception - break
bpec - Break instruction exception continue - handled
  eh - C++ EH exception - second-chance break - not handled
 clr - CLR exception - second-chance break - not handled
clrn - CLR notification exception - second-chance break - handled
 cce - Control-Break exception - break
  cc - Control-Break exception continue - handled
 cce - Control-C exception - break
  cc - Control-C exception continue - handled
  dm - Data misaligned - break - not handled
dbce - Debugger command exception - ignore - handled
  gp - Guard page violation - break - not handled
  ii - Illegal instruction - second-chance break - not handled
  ip - In-page I/O error - break - not handled
  dz - Integer divide-by-zero - break - not handled
 iov - Integer overflow - break - not handled
  ch - Invalid handle - break
  hc - Invalid handle continue - not handled
 lsq - Invalid lock sequence - break - not handled
 isc - Invalid system call - break - not handled
  3c - Port disconnected - second-chance break - not handled
 svh - Service hang - break - not handled
 sse - Single step exception - break
ssec - Single step exception continue - handled
 sbo - Stack buffer overflow - break - not handled
 sov - Stack overflow - break - not handled
  vs - Verifier stop - break - not handled
vcpp - Visual C++ exception - ignore - handled
 wkd - Wake debugger - break - not handled
 wob - WOW64 breakpoint - break - handled
 wos - WOW64 single step exception - break - handled

   * - Other exception - second-chance break - not handled

*编辑2012年8月17号*

由于colinsmith,我觉得你得到的最接近的答案。我编译我的程序作为32位程序。切换到使用32位的Windbg和32位sosex。按照同样的步骤设置断点。现在,如果我做的!MBL 。该断点列表显示方式不同。

Thanks to colinsmith, I think you got the closest answer. I compiled my program as a 32-bit program. Switch to use 32-bit Windbg and 32-bit sosex. Follow the same steps to set the break points. Now, if I do !mbl. The break point list is shown differently.

0 e : disable *!TESTWINDBG.PROGRAM.FUNC1 ILOffset=0: pass=1 oneshot=false thread=ANY
    TestWindbg!TestWindbg.Program.Func1() (PENDING JIT)

previously,我没有看到该行(PENDING JIT)。继续运行程序,并成功的Windbg在断点处停止。

Previously, I didn't see the line (PENDING JIT). Continue the program and Windbg successfully stops at the breakpoint.

我不知道为什么64位程序无法正常工作。我仔细检查我的64位sosex.dll和我的64位程序的符号路径。一切看起来是正确的。也许,这是一个错误,在sosex.dll?

I have no idea why 64-bit program doesn't work. I double checked my 64-bit sosex.dll and my 64-bit program symbol paths. Everything looks correct. Perhaps, it's a bug in sosex.dll?

我使用.NET 4.0和我的WinDbg是运行在Windows 2008 R2 64位。

I am using .NET 4.0 and my windbg is running in Windows 2008 R2 64-bit.

推荐答案

下面是一些建议,检查事项:

Here are some suggestions, things to check:

您可以尝试等待被加载运行时/抖动/模块后设置断点前/初始化为止。

You could try waiting till after the runtime/JITter/module is loaded/initialised before setting the breakpoint.

使用:

  • SXE LD:mscorlib程序      (运行后突破被加载)...或
  • SXE LD:clrjit            (抖动后突破被加载)。 ..或
  • SXE LD:MyModuleAssemblyName        (装入您的特定模块后休息)
  • sxe ld:mscorlib       (break after runtime is loaded)... or
  • sxe ld:clrjit           (break after JITter is loaded) ... or
  • sxe ld:MyModuleAssemblyName       (break after your particular module is loaded)

这将导致中断到调试发生后,他们....那么你可以做你的!MBM 等。

This will cause a break into the debugger after they have occurred....you can then do your !mbm, etc.

使用:

  • LML     (显示加载并加载失败的符号)
  • LME     (只显示加载失败的符号)
  • lml    (show loaded and failed to load symbols)
  • lme    (show only failed to load symbols).

您可以选择使用!SYM嘈杂为符号加载活动如一个详细的跟踪帮助发现当你损坏.pdbs等。

You could alternatively use !sym noisy for a detailed trace of symbol loading activity e.g. helps discover when you have corrupted .pdbs, etc.

对于一个有用的参考一些PDB相关的错误codeS:

For a useful reference to some PDB related error codes:

  • <一个href="http://www.$c$cproject.com/script/Content/ViewAssociatedFile.aspx?rzp=%2FKB%2FDLL%2FSymbols_File_Locator%2FSources.zip&zep=SymbolsParser%2FDiaErrorTranslator.cpp&obid=37883&obtid=2&ovid=3" rel="nofollow">http://www.$c$cproject.com/script/Content/ViewAssociatedFile.aspx?rzp=%2FKB%2FDLL%2FSymbols_File_Locator%2FSources.zip&zep=SymbolsParser%2FDiaErrorTranslator.cpp&obid=37883&obtid=2&ovid=3

有关验证加载符号正确地看到了一般性讨论:

For a general discussion on verifying that symbols are loaded properly see:

另外,你可以试试32位调试器,而不是64位之一的运行程序(和使用过程中的32位SOSEX插件...并编译成x86)的...如果你得到同样的结果还是没有看到

In addition could you try running your program under the 32bit Debugger instead of the 64bit one (and use the 32bit SOSEX plugin of course...and compile as x86)...and seeing if you get the same result or not.

在史蒂夫天极他说,他打破了在XP(你似乎使用)的兼容性...也许这就是问题所在。 (6月8日2012)

In Steves Techspot he says he broke compatibility in XP (which you appear to be using)...maybe that's the problem. (dated June 8 2012)

这篇关于断点sosex.mbp设置或sosex.mbm不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆