Search

Wednesday, October 21, 2015

How to add a breakpoint in a managed generic method in windbg (sos)

Milkyway over Mt. Rainier

This is not really a blog post but a micro-post. Someone asked me and since I couldn’t find any post out there calling it out, thought I’d add

If you want to add a breakpoint to a managed method inside windbg using sos extension, the obvious way is to use the extension command !bpmd. However, if the target method is generic or inside a generic type it is slightly tricky, you don’t use <T> but rather `<count of generic types>

So I have a the following inside by foo.exe managed app

namespace Abhinaba
{
public class PriorityThreadPool<t> : IDisposable
{
public bool RunTask(T param, Action<t> action)
{
// cool stuff
}
}
}

To set breakpoint in it I use the following (notice the red highlighted part)

!bpmd ApplicationHost.exe Xap.ApplicationHost.PriorityThreadPool`1.RunTask

Wednesday, October 14, 2015

Backlight and detergent

imageI found a cheap $6 black light (or rather UV) flashlight on Amazon. Once it arrived, me and my daughter went out on the quest of finding what glows best in it. Basically some sort of phosphor that absorbs the UV light and emits visible light making it seem to glow in the dark.

Based on a quick bing.com  search we tried a bunch of stuff, but what worked best is laundry detergent. I knew that to make clothes seem bright these have phosphors in them. The indirect proof was how bright a newly laundered T-shirt was glowing. Until I popped open one of the Costco laundry detergent pods and put it under UV light I never could’ve guessed the intense glow they emitted.

Enjoy a video of that.