从堆栈开始的地方获取方法名

时间:2021-01-27 16:58:07

I am getting the following result while running !dumpstack over windbg command prompt.

我正在运行!在windbg命令提示符上的dumpstack。

000000000a136510 000007fed86f404c (MethodDesc 000007fed85d7e60 +0x14c System.Data.SqlClient.SqlParameter.GetActualSize()), calling System_Data_ni+0x10f010
000000000a136530 000007fed86f483d (MethodDesc 000007fed85d7f18 +0x4d System.Data.SqlClient.SqlParameter.GetCoercedValue()), calling System_Data_ni+0x10efc0
000000000a136570 000007fed86f4ac8 (MethodDesc 000007fed85d7fc0 +0x58 System.Data.SqlClient.SqlParameter.ValidateTypeLengths(Boolean))
000000000a136650 000007fed870322d (MethodDesc 000007fed861d7a0 +0x1d Bid.Trace(System.String, Int32)), calling clr+0x2da0
000000000a1366a0 000007fed86f2a98 (MethodDesc 000007fed85c2240 +0x6a8 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(System.Data.CommandBehavior, System.Data.SqlClient.RunBehavior, Boolean, Boolean)), calling (MethodDesc 000007fed85dabe0 +0 System.Data.SqlClient.TdsParser.TdsExecuteRPC(System.Data.SqlClient._SqlRPC[], Int32, Boolean, System.Data.Sql.SqlNotificationRequest, System.Data.SqlClient.TdsParserStateObject, Boolean))
000000000a1366e0 000007fee2babf7d (MethodDesc 000007fee28bedf8 +0x7d System.WeakReference.set_Target(System.Object)), calling 000007fee4123f00 (stub for System.GC.KeepAlive(System.Object))
000000000a136770 000007fed86f23ca (MethodDesc 000007fed85c2230 +0x21a System.Data.SqlClient.SqlCommand.RunExecuteReader(System.Data.CommandBehavior, System.Data.SqlClient.RunBehavior, Boolean, System.String, System.Data.Common.DbAsyncResult)), calling System_Data_ni+0x10ee58
000000000a1367a0 000007fed86fad47 (MethodDesc 000007fed85d9cb0 +0x797 System.Data.ProviderBase.DbConnectionPool.GetConnection(System.Data.Common.DbConnection)), calling (MethodDesc 000007fed85d9348 +0 System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(System.Transactions.Transaction))
000000000a1367e0 000007fee2bdc66b (MethodDesc 000007fee299df68 +0x1b System.Security.CodeAccessSecurityEngine.Check(System.Security.CodeAccessPermission, System.Threading.StackCrawlMark ByRef)), calling clr+0x2da0
000000000a136820 000007fed86f219c (MethodDesc 000007fed85c2220 +0x1c System.Data.SqlClient.SqlCommand.RunExecuteReader(System.Data.CommandBehavior, System.Data.SqlClient.RunBehavior, Boolean, System.String)), calling System_Data_ni+0x10ef48
000000000a136830 000007fed86f1431 (MethodDesc 000007fed85c1d10 +0x21 System.Data.SqlClient.SqlCommand.get_Statistics()), calling System_Data_ni+0x10e8f8
000000000a136860 000007fed86f1fa0 (MethodDesc 000007fed85c20f8 +0x100 System.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior, System.String)), calling System_Data_ni+0x10eec8
000000000a136890 000007fed86f9f99 (MethodDesc 000007fed85d9b90 +0x59 System.Data.ProviderBase.DbConnectionFactory.GetConnection(System.Data.Common.DbConnection)), calling (MethodDesc 000007fed85d9cb0 +0 System.Data.ProviderBase.DbConnectionPool.GetConnection(System.Data.Common.DbConnection))
000000000a136910 000007fed86f1e74 (MethodDesc 000007fed85c20b8 +0xe4 System.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)), calling System_Data_ni+0x10ee68
000000000a136930 000007fed86f0b5d (MethodDesc 000007fed85d72e8 +0x23d System.Data.SqlClient.SqlConnection.Open()), calling (MethodDesc 000007fed861d3c0 +0 Bid.ScopeLeave(IntPtr ByRef))
000000000a136950 000007fed86f50b2 (MethodDesc 000007fed85d8e28 +0x92 System.Data.SqlClient.SqlParameterCollection.Add(System.Object))
000000000a1369c0 000007ff00c075d1 000007ff00c075d1, calling System_Data_ni+0x10ef30

My issue is I am not able to get the method name from where this stack started. Can you tell me a command to track it?

我的问题是我无法从这个堆栈开始的地方获得方法名。你能告诉我一个追踪它的命令吗?

This first few lines of results are:

最初的几行结果是:

    0:045>  !dumpstack
OS Thread Id: 0x2ecc (45)
TEB information is not available so a stack size of 0xFFFF is assumed
Current frame: clr!LogHelp_LogAssert+0x14e54
Child-SP         RetAddr          Caller, Callee
000000000a136100 000007fee4167ca9 clr!PreBindAssemblyEx+0x14c9d, calling clr+0x12e0
000000000a136130 000007fee446962e clr!CreateAssemblyConfigCookie+0x554de, calling clr+0x21a0
000000000a136140 000007fee40d2b44 clr!LogHelp_LogAssert+0x1efe4, calling clr!LogHelp_LogAssert+0xf80
000000000a136210 000007fed8716d76 (MethodDesc 000007fed85d67a0 +0x36 DomainNeutralILStubClass.IL_STUB_PInvoke(SNI_Conn*, SNI_Packet_IOType, SNI_Packet*, ConsumerNum)), calling 000007fee40c89a0 (stub for System.StubHelpers.StubHelpers.BeginStandalone(IntPtr, IntPtr, Int32))
000000000a1362b0 000007fee4167b5c clr!PreBindAssemblyEx+0x14b50, calling clr!LogHelp_LogAssert+0xf10

3 个解决方案

#1


1  

Have you tried "!CLRStack -p"?

你有试过”!CLRStack - p”?

Also, DumpMethodSig will get the full method signature.

并且,DumpMethodSig将获得完整的方法签名。

Here are all the commands that you can use: http://msdn.microsoft.com/en-us/library/bb190764.aspx

以下是您可以使用的所有命令:http://msdn.microsoft.com/en-us/library/bb190764.aspx

#2


1  

The !dumpstack command accepts a [top of stack [bottom of stack]] parameter so you can manually give it some values. It stops at 000000000a1369c0 so you can try giving that as the top of the stack and see if it can find more information. If not you can try manually reconstructing the stack using something like 'dqs 000000000a1369c0', but that will only match up native symbols. I've never done a manual stack reconstruction for a clrstack.

dumpstack命令接受一个[栈顶[栈底]]]参数,这样您可以手动地给它一些值。它停在000000000a1369c0,所以您可以尝试将它作为堆栈的顶部,看看它是否能找到更多的信息。如果没有,您可以尝试使用“dqs 000000000a1369c0”之类的东西来手动重构堆栈,但这只会匹配本机符号。我从来没有为clrstack做过手工堆栈重构。

#3


1  

When Windbg opens, there are two types of debugging sessions

打开Windbg时,有两种调试会话

  1. Dump analysis
  2. 转储分析
  3. Live debugging.
  4. 现场调试。

The trick to finding the proper thread is to open up the Threads and Processes window and select the proper thread. Note that other threads in the same process will only show their part of the run. Typically in a live debug sessions you want the top thread, that's when you'll see the entire stack.

找到合适的线程的诀窍是打开线程和进程窗口并选择合适的线程。注意,同一进程中的其他线程只显示它们的运行部分。通常,在实时调试会话中,您需要*线程,这时您将看到整个堆栈。

#1


1  

Have you tried "!CLRStack -p"?

你有试过”!CLRStack - p”?

Also, DumpMethodSig will get the full method signature.

并且,DumpMethodSig将获得完整的方法签名。

Here are all the commands that you can use: http://msdn.microsoft.com/en-us/library/bb190764.aspx

以下是您可以使用的所有命令:http://msdn.microsoft.com/en-us/library/bb190764.aspx

#2


1  

The !dumpstack command accepts a [top of stack [bottom of stack]] parameter so you can manually give it some values. It stops at 000000000a1369c0 so you can try giving that as the top of the stack and see if it can find more information. If not you can try manually reconstructing the stack using something like 'dqs 000000000a1369c0', but that will only match up native symbols. I've never done a manual stack reconstruction for a clrstack.

dumpstack命令接受一个[栈顶[栈底]]]参数,这样您可以手动地给它一些值。它停在000000000a1369c0,所以您可以尝试将它作为堆栈的顶部,看看它是否能找到更多的信息。如果没有,您可以尝试使用“dqs 000000000a1369c0”之类的东西来手动重构堆栈,但这只会匹配本机符号。我从来没有为clrstack做过手工堆栈重构。

#3


1  

When Windbg opens, there are two types of debugging sessions

打开Windbg时,有两种调试会话

  1. Dump analysis
  2. 转储分析
  3. Live debugging.
  4. 现场调试。

The trick to finding the proper thread is to open up the Threads and Processes window and select the proper thread. Note that other threads in the same process will only show their part of the run. Typically in a live debug sessions you want the top thread, that's when you'll see the entire stack.

找到合适的线程的诀窍是打开线程和进程窗口并选择合适的线程。注意,同一进程中的其他线程只显示它们的运行部分。通常,在实时调试会话中,您需要*线程,这时您将看到整个堆栈。