reshmi
Name: reshmi
Score: 895.32
Last Seen: 929 days, 6 hours, 34 minutes ago
Member Since: 3 February, 2010
DotNetShoutout
atom rss
4
Shouts

Dumping .NET strings to files using Windbg « Naveen's Blog

posted by reshmireshmi 929 days, 6 hours, 34 minutes ago
Monday, November 01, 2010 9:44:03 PM GMT
In this post I would demonstrate how to dump strings from a memory dump /live process to a file. Recently I had to debug a process which had few big strings where I had to analyze its contents. The !dumpobj from sos would only dump partial strings.  I had to dump few hundred XML strings that I had to analyze using some automation. And hence comes the script. $$ Dumps the managed strings to a file $$ Platform x86 $$ Naveen Srinivasan http://naveensrinivasan.com $$ Usage $$>a (more)
category: Architecture | clicked: 0 | comment | | source: bit.ly
tags: WinDbg
2
Shouts

Dumping ASP.NET Session (x86 /x64) within Windbg « Naveen's Blog

posted by reshmireshmi 935 days, 2 hours, 21 minutes ago
Wednesday, October 27, 2010 1:56:55 AM GMT
This post is going to be about dumping ASP.NET session objects using Windbg. I had recently answered a stackoverflow question in which someone wanted to dump ASP.NET session objects for 64-bit IIS (x64). I thought why not blog about the same which might be useful to others.  The challenge is to write one script that should work in both x86/x64.  FYI there is a script from Tess that does dump out the session contents, AFAIK it will not work on x64 and my script iterates through the array using the array l... (more)
category: Web Dev | clicked: 0 | comment | | source: naveensrinivasan.com
tags: WinDbg, ASP .NET
4
Shouts

GC Start and Stop events in .NET using Windbg « Naveen's Blog

published 981 days, 13 hours, 8 minutes ago posted by reshmireshmi 983 days, 14 hours, 29 minutes ago
Friday, September 10, 2010 3:10:12 PM GMT Wednesday, September 08, 2010 1:48:42 PM GMT
I was recently showing someone the new ETW features in .NET especially the GC Event notification and I was asked if we can get this using Windbg. So here is the sample code for the GC Collection namespace GCStartStop { public partial class Form1 : Form { public Form1() { InitializeComponent(); button1.Click += (s, b) => GC.Collect(2); button1.Click += (s, b) => GC.Collect(1); } } } The goal is set to a break-point only when the collection count is 2. Here is a bp script for doing this. bp clr!WKS::G... (more)
category: Architecture | clicked: 1 | comment | | source: naveensrinivasan.com
tags: WinDbg
4
Shouts

Get GC Information in Silverlight

published 1011 days, 13 hours, 58 minutes ago posted by reshmireshmi 1012 days, 1 hour, 43 minutes ago
Wednesday, August 11, 2010 2:19:45 PM GMT Wednesday, August 11, 2010 2:35:25 AM GMT
I had earlier written a post on getting GC information on Silverlight using ETW. With that we would have to write code to parse the ETW csv file.  In this post I am going to be using Perfmonitor to do this. This tools uses the same ETW under covers, but it does all the plumbing and gives a nice report , which is much easier to read.  Here are the reports To demonstrate this I used the bing’s world leader search page and here is the url http://www.bing.com/visualsearch?q=World+leaders&g=world_leader... (more)
category: Metro | clicked: 0 | comment | | source: naveensrinivasan.com
tags: Silvelight
4
Shouts

Script to load sos within Windbg based on .NET Framework version

published 1026 days, 18 hours, 26 minutes ago posted by reshmireshmi 1027 days, 14 hours, 49 minutes ago
Tuesday, July 27, 2010 9:52:03 AM GMT Monday, July 26, 2010 1:28:40 PM GMT
I often debug  .NET Framework v 2.0 / v 4.0 code within windbg. In v 2.0 the main clr dll was called “mscorwks.dll” and in v 4.0 it is called “clr.dll”.  As many of you are aware , to load sos in v 2.0 we would have to enter “.loadby sos mscorwks” and in v 4.0 it would be “.loadby sos clr” . This was a pain for me. Came up with a script to automate loading sos based on clr version !foreachmodule .if(($sicmp( "@#ModuleName" , "mscorwks") = 0) ) {.loadby sos mscorwks} .elsif ($sicmp( "@#ModuleName" , "cl... (more)
category: Architecture | clicked: 1 | comment | | source: naveensrinivasan.com
tags: WinDbg
3
Shouts

Debugging .NET – mystery between DEBUG versus RELEASE within windbg « Naveen's Blog

published 1031 days, 13 hours, 20 minutes ago posted by reshmireshmi 1032 days, 1 hour, 28 minutes ago
Thursday, July 22, 2010 2:57:55 PM GMT Thursday, July 22, 2010 2:49:47 AM GMT
I am sure most of us have debugged applications that are build with debug turned on, which is obviously much easier compared to debugging release build (optimized code). In this post I am going to share one of my experiences of debugging release build code. I will demonstrate this with a simple Console Application. Here is the code using System; namespace ConsoleApplication { class Program { static void Main(string[] args) { var x = 10; var name = "naveen"; Console.WriteLine(name); Console.Read(); } }... (more)
category: Architecture | clicked: 1 | comment | | source: naveensrinivasan.com
tags: WinDbg
3
Shouts

Using F# to Automate Reading–The Morning Brew

published 1036 days, 13 hours, 31 minutes ago posted by reshmireshmi 1037 days, 16 hours, 50 minutes ago
Saturday, July 17, 2010 2:46:38 PM GMT Friday, July 16, 2010 11:28:14 AM GMT
I guess most of the .NET Devs read The Morning Brew, if not you should.  It is a morning newspaper for the dev, so I end up reading it first thing when I go to work. I like to  try and automate most of the stuff . So I thought why not write a script that reads the Morning Brew feed, filter the excluded content that I am not interested in and open the urls before I come in. The reason behind using F# is I don’t have to compile the code. I could use it with FSI.exe. Incase if the extraction logic changes a... (more)
category: Architecture | clicked: 1 | comment | | source: naveensrinivasan.com
6
Shouts

Combining Stack Overflow RSS, OData and API to query

published 1038 days, 14 hours, 55 minutes ago posted by reshmireshmi 1039 days, 16 hours, 29 minutes ago
Thursday, July 15, 2010 1:22:57 PM GMT Wednesday, July 14, 2010 11:48:36 AM GMT
In my opinion Stack Overflow has a ton of knowledge to learn new tricks. And there are some really smart people in the SO community. I try and learn new things when I find time. I subscribe to RSS feeds for new questions on a particular topic. Example, here is one for F# from Stack Overflow http://stackoverflow.com/feeds/tag/f%23. The advantage of the RSS feed is I get to see new questions, but the drawback is I would have to navigate to the site to look for answers. AFAIK the stacky (stack overflow API... (more)
category: Architecture | clicked: 0 | comment | | source: naveensrinivasan.com
tags: stackoverflow, OData
2
Shouts

Load the same Assembly from GAC and private bin path in .NET « Naveen's Blog

posted by reshmireshmi 1041 days, 6 hours, 44 minutes ago
Monday, July 12, 2010 9:33:39 PM GMT
This post is all about exploring the CLR loader to load an assembly from GAC and from private bin path. This is not possible because, if an assembly is loaded from GAC and if the code uses Assembly.LoadFrom to load the same assembly, then the loader would return the assembly that has already been loaded from the GAC. Here is the ClassLibrary2 code using System; namespace ClassLibrary2 { public class Class1 { public string Bar() { return "bar"; } } } Here is the Winforms application to load t... (more)
category: Architecture | clicked: 1 | comment | | source: naveensrinivasan.com
tags: .NET, GAC, loader
2
Shouts

Debugging Generic System.Nullable within Windbg « Naveen's Blog

published 1044 days, 14 hours, 33 minutes ago posted by reshmireshmi 1045 days, 16 hours, 39 minutes ago
Friday, July 09, 2010 1:44:47 PM GMT Thursday, July 08, 2010 11:39:34 AM GMT
In this post I am going to unravel the mystery of debugging the Nullable (more)
category: Architecture | clicked: 2 | comment | | source: naveensrinivasan.com
tags: WinDbg
2
Shouts

Recursive !dumpmt – Windbg « Naveen's Blog

posted by reshmireshmi 1048 days, 2 hours, 45 minutes ago
Tuesday, July 06, 2010 1:32:46 AM GMT
In this post I will be demonstrating how we could use CLR internal data-structures to recursively get the methodtable’s of an object and its base classes. The idea behind this is to understand the CLR data structure. Here is the sample code using System; namespace ConsoleApplication { class Program : B { string test = "cw"; static void Main(string[] args) { var p = new Program(); Console.Read(); } } class B : A { public void TestB() { } } class A { public void TestA() { } } } T... (more)
category: Architecture | clicked: 3 | comment | | source: naveensrinivasan.com
tags: WinDbg
2
Shouts

dumpstring – windbg

posted by reshmireshmi 1053 days, 11 hours, 43 minutes ago
Wednesday, June 30, 2010 4:35:03 PM GMT
Viewing strings inside the debugger has never been pretty, especially if you are using sos extension.  Here is a sample !dumpobj on a string 0:000> !do 00000000025f2280 Name:        System.String MethodTable: 000007fef6e26960 EEClass:     000007fef69aeec8 Size:        32(0×20) bytes String:     Foo Fields: MT    Field   Offset                 Type VT     Attr            Value Name 000007fef6e2c848  40000ed        8         System.Int32  1 instance                3 m_stringLength 000007... (more)
category: Architecture | clicked: 0 | 1 comment | | source: naveensrinivasan.com
tags: WinDbg
3
Shouts

Custom DumpArray – Windbg

published 1058 days, 18 hours, 9 minutes ago posted by reshmireshmi 1059 days, 3 hours, 14 minutes ago
Friday, June 25, 2010 10:09:22 AM GMT Friday, June 25, 2010 1:03:50 AM GMT
The sos has !dumparray for getting contents of the array. But it cannot be used for scripting or automation. Here is an example using System; namespace ConsoleApplication { class Program { Test[] arr = new[] { new Test() { ID = 1, Name = "Foo" }, new Test() { ID = 2, Name = "Bar" } }; static void Main(string[] args) { var p = new Program(); Console.WriteLine(p.arr); Console.Read(); } } class Test { public int ID; public string Name; } } And here is the output of thearr variable within th... (more)
category: Architecture | clicked: 1 | comment | | source: naveensrinivasan.com
tags: Debug
4
Shouts

Do I have Managed or Native memory leak? « Naveen's Blog

published 1060 days, 17 hours, 46 minutes ago posted by reshmireshmi 1061 days, 5 hours, 22 minutes ago
Wednesday, June 23, 2010 10:32:13 AM GMT Tuesday, June 22, 2010 10:56:27 PM GMT
I noticed someone who couldn’t figure out the cause of memory leak in  managed application within the debugger. This person had basic debugging skills and was comfortable with sos.  FYI the leak wasn’t in the managed code, but in the native code. The managed code was using native code via PInvoke. Here is how I figured out the cause. Every time I have to debug a memory leak in managed code ,the first command I run is !vmstat. The !vmstat is available in psscor2.dll for .net 3.5 and for .net 4.0 it is av... (more)
category: Architecture | clicked: 11 | comment | | source: naveensrinivasan.com
tags: WinDbg
3
Shouts

Using Tuple as Dictionary / Map key

posted by reshmireshmi 1064 days, 15 hours, 35 minutes ago
Saturday, June 19, 2010 12:43:21 PM GMT
I  recently had to create a dictionary which needed a multipart key like (more)
category: Architecture | clicked: 0 | comment | | source: naveensrinivasan.com
tags: CSharp, FSharp
4
Shouts

Debugging base class method with conditional break point in .NET using Windbg « Naveen's Blog

published 1066 days, 14 hours, 42 minutes ago posted by reshmireshmi 1067 days, 1 hour, 53 minutes ago
Thursday, June 17, 2010 1:36:18 PM GMT Thursday, June 17, 2010 2:24:53 AM GMT
In this post I am going to be demonstrating how to have a conditional break-point on the base class method where it has been used by multiple derived classes. A classic example is Winform UI. The Control base class has got methods like setEnabled , setVisible which could be consumed by multiple derived controls. The goal is to debug only the control instance that we are interested in. Here is the sample code. using System; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partia... (more)
category: Architecture | clicked: 0 | comment | | source: bit.ly
tags: WinDbg
2
Shouts

Using Tech-Ed OData to download videos

published 1067 days, 17 hours, 35 minutes ago posted by reshmireshmi 1068 days, 15 hours, 35 minutes ago
Wednesday, June 16, 2010 10:42:58 AM GMT Tuesday, June 15, 2010 12:42:53 PM GMT
I wanted to watch the Teched 2010 videos, but the problem I had was going to the site manually to download files for offline viewing.  And I was also interested only in Dev sessions which were level 300 / 400. Thanks to OData for teched http://odata.msteched.com/sessions.svc/ ,I  could write 3 statements in linqpad and had them all downloaded using wget File.Delete(@"C:\temp\download.txt"); Sessions .Where (s => (s.Level.StartsWith("400") ||  s.StartsWith("300") ) && s.Code.StartsWith("DEV")) .T... (more)
category: Architecture | clicked: 0 | comment | | source: bit.ly
tags: OData
4
Shouts

Piracy in .NET Code – Part 3 – Even when the code is obfuscated « Naveen's Blog

published 1070 days, 17 hours, 50 minutes ago posted by reshmireshmi 1071 days, 14 hours, 42 minutes ago
Sunday, June 13, 2010 10:28:14 AM GMT Saturday, June 12, 2010 1:35:42 PM GMT
Continuing with my series on Piracy, in this post I am going to be  exploring how someone with little advanced knowledge in CLR / Windows can bypass important function calls like  license validation. Most of the developers assume just because the code is obfuscated nobody can bypass the licensing logic. I am going to be demonstrating how to bypass certain function call,this is very similar to “Set Next Statement ” in VS. I am not going to be discussing on how to fix this problem. Here is a sample code.... (more)
category: Architecture | clicked: 0 | comment | | source: bit.ly
tags: CSharp
4
Shouts

Using Windows Error Reporting (WER) API in managed code to generate memory dump

published 1072 days, 17 hours, 59 minutes ago posted by reshmireshmi 1073 days, 17 hours ago
Friday, June 11, 2010 10:18:48 AM GMT Thursday, June 10, 2010 11:18:06 AM GMT
The WER is a pretty cool technology from Microsoft for collecting memory dumps on process crash/ hang. This can be extended to generate on demand when the application needs to. The usual reason for getting a memory dump could be based on certain conditions, for example, the customer feels the application is slow and would want to send the information to WinQual (WER server). If the application happens to be installed on hundreds / thousands of boxes then its not going to be possible to get from individua... (more)
category: Architecture | clicked: 6 | comment | | source: naveensrinivasan.com
tags: WinDbg
6
Shouts

Using Mono Cecil Decompiler within Windbg to decompile « Naveen's Blog

published 1074 days, 17 hours, 8 minutes ago posted by reshmireshmi 1075 days, 14 hours, 4 minutes ago
Wednesday, June 09, 2010 11:09:54 AM GMT Tuesday, June 08, 2010 2:14:15 PM GMT
I have been hacking Mono lately and one of the coolest projects I have seen is the Mono Decompiler. It’s like Reflector but no UI and an API to decompile. Guess what, even reflector is built on top of Mono Cecil.  Most of times when I have to debug I would end up using  !dumpil  sos command to get  the IL  of the method desc.  I am not an IL guru, I am much comfortable reading C# than IL. I could have used reflector to do the same thing, but here are couple of reasons for doing this.I don’t have to open ... (more)
category: Architecture | clicked: 4 | comment | | source: bit.ly
tags: Mono, WinDbg
Previous 1 2 3 4 Next