|
|
||||||
|
#1
|
|
|
|
|
Hello everyone,
When using WinDbg to debug the following simple application, after loading SOS, then I type "!bpmd TestDebugManaged1.exe Program.Foo" to set a breakpoint, there is the error message -- "Found 0 methods...". What is wrong with my input? [Code] namespace TestDebugManaged1 { class Program { void foo() { int a = 100; while (true) { Thread.Sleep(10000); a++; } } static void Main(string[] args) { Program instance = new Program(); instance.foo(); return; } } } [/Code] thanks in advance, George |
|
|
|
#2
|
|
|
|
|
You can get the method descriptor of the method and set breakpoint on it.
See: http://dotnetdebug.net/2005/06/08/se...-managed-code/ Hope this helps |
|
#3
|
|
|
|
|
Thanks Madhur,
I have read through the article, really great! But after trying, I am not 100% agree with the comments from the article. - The solution from the article is using 4 steps; - But I think using 2 steps are enough, the 1st step of my solution is to use !name2ee to get the method description table, then from the MethodDesc column of method foo, we can get the address of the method descriptor directly. So, my second step is to use !bpmd -md to set a breakpoint. Here is the my output. Do you think my 2-step solution is correct? -------------------- 0:004> !name2ee TestDebugManaged1.exe TestDebugManaged1.Program Module: 0000064280012e20 (TestDebugManaged1.exe) Token: 0x0000000002000002 MethodTable: 0000064280013580 EEClass: 00000642801421c0 Name: TestDebugManaged1.Program 0:004> !dumpmt -md 0000064280013580 EEClass: 00000642801421c0 Module: 0000064280012e20 Name: TestDebugManaged1.Program mdToken: 02000002 (D:\Visual Studio 2008\Projects\TestDebugManaged1\TestDebugManaged1\ bin\Debug\TestDebugManaged1.exe) BaseSize: 0x18 ComponentSize: 0x0 Number of IFaces in IFaceMap: 0 Slots in VTable: 7 -------------------------------------- MethodDesc Table Entry MethodDesc JIT Name 000006427809f660 0000064278930388 PreJIT System.Object.ToString() 000006427809dc60 0000064278930390 PreJIT System.Object.Equals(System.Object) 000006427809dc90 00000642789303a8 PreJIT System.Object.GetHashCode() 0000064278092ca0 00000642789303b0 PreJIT System.Object.Finalize() 0000064280150230 0000064280013568 JIT TestDebugManaged1.Program.foo() 0000064280150120 0000064280013570 JIT TestDebugManaged1.Program.Main(System.String[]) 00000642801501c0 0000064280013578 JIT TestDebugManaged1.Program..ctor() 0:004> !bpmd -md 0000064280013568 MethodDesc = 0000064280013568 Setting breakpoint: bp 0000064280150230 [TestDebugManaged1.Program.foo()] -------------------- regards, George |
|
#4
|
|
|
|
|
"George" <George> wrote in message
news:89db > Hello everyone, >> When using WinDbg to debug the following simple application, after loading > SOS, then I type "!bpmd TestDebugManaged1.exe Program.Foo" to set a > breakpoint, there is the error message -- "Found 0 methods...". What is > wrong > with my input? > > [Code] > namespace TestDebugManaged1 > { > class Program > { > void foo() Maybe because your "foo" is with a lowercase 'f' but your command to set the breakpoint uses an uppercase 'F' ? Marc |
|
#5
|
|
|
|
|
When I used last time. !name2ee do not seem to give method description table
to me. Only field names. Am I missing something ? |
|
#6
|
|
|
|
|
Hi George!
> When using WinDbg to debug the following simple application, after loading > SOS, then I type "!bpmd TestDebugManaged1.exe Program.Foo" to set a > breakpoint, there is the error message -- "Found 0 methods...". What is wrong > with my input? The main problem is: WinDbg is not a supported debugger for development debugging .NET applications: See answer from Pat Styles [MS]: http://groups.google.com.au/group/mi...952f04e3a013d8 |
|
#7
|
|
|
|
|
Thanks Marc!
I think you find the root cause. :-) regards, George |
|
#8
|
|
|
|
|
Thanks Jochen,
Now I can use !bpmd to set breakpoint. What issues do you mean when using Windbg to debug managed code? Could you point out some specific detailed issues please? :-) Interested to learn from you further. regards, George |
|
#9
|
|
|
|
|
Thanks Madhur.
1. Maybe I am using a new version? :-) I am using version 6.9, what about you? 2. If name2ee could display method description table, is my solution correct? 3. name2ee is short for what statements? I am interested in what ee means here. regards, George |
|
#10
|
|
|
|
|
> Maybe I am using a new version? :-)
> > I am using version 6.9, what about you? Yes. I am using the latest version too. > 2. > > If name2ee could display method description table, is my solution correct? Yes. I could have checked, but I do not have access to WinDbg right now. If you get it and if it hits it, its correct :) > > 3. > > name2ee is short for what statements? I am interested in what ee means > here. Even I don’t know. I am a newbie too :) It is one of the data structures used by .NET runtime engine. You can get excellent information here: http://msdn.microsoft.com/en-us/magazine/cc163791.aspx quoted: MethodTable binds the object instance to the language compiler-generated memory-mapped metadata structures through EEClass |
|
#11
|
|
|
|
|
Thanks for your help, Madhur!
regards, George "Madhur" wrote: [..] |
|
|
| Similar Threads | |
| Can't set any breakpoint. I had MFC based project (Visual Studio 2005), which ran on HP iPAQ PDA under Windows Mobile 5. I rebuilt this application under Windows CE 6.0 targeting SDK for a custom... |
|
| Really weird - Code acting as though breakpoint set, no breakpoint Hello, MS Access 2003 on XP Pro. I have a form that automatically opens via a macro when you open the file. (dbl clk on "Inventory.mdb" in Windows) That form has a function... |
|
| How to use Breakpoint and Advanced Breakpoint ? Can i set breakpoint at function local variable when the variable change? And Is it must set data like "App.m_ObjectA.m_Object[i].m_variable" in... |
|
| project stops at imaginary breakpoint, but no breakpoint exists Almost every time I start up my project (in debug mode), my project stops at an imaginary breakpoint. I have to press F5 to continue. The default page in my project is a... |
|
| User Breakpoint crash when there is no breakpoint I've seen this bug before but now I'm ready to throw my copy of Visual Studio .NET through the window because this one is driving me insane. It defies ALL logic... I get the... |
|
|
All times are GMT. The time now is 05:38 AM. | Privacy Policy
|