Bart
Bart

Reputation: 4920

Print all tableName for all Datatables in Windbg

I am debugging an ASP.NET web application using Windbg.

I am following this process to print the table name:

!dumpheap -type System.Data.DataTable
!do 6bd27818 (DataTable MT)
as !ds .printf "%mu \n", c+
!ds 0bb93b44  (TableName)

I am still a newbie to windbg, Is there a script to list all datatable tablenames? Thanks

Upvotes: 2

Views: 330

Answers (1)

Bart
Bart

Reputation: 4920

Solved it Thanks to http://www.infinitec.de/post/2011/08/15/Windbg-Finding-a-specific-instance-of-a-managed-object-in-a-windows-process.aspx

.load C:\Program Files\DebugDiag\Exts\psscor2.dll


.foreach(entry {!dumpheap -type System.Data.DataTable -short}){.printf "%p: ", entry; du poi(${entry}+38)+c;.printf "\n"}

38 is coming from below:

!do DatatableAddress

65675184  40007b2       34 ...ropertyCollection  0 instance 00000000 extendedProperties
0daf0b24  40007b3       **38**        System.String  0 instance 6bbd8de4 tableName

Upvotes: 1

Related Questions