| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| .NET Framework Ask general questions about the .NET Framework. Discuss general CTS, CLR, and other .NET Platform questions and issues |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
NoStepInto
Basically, NoStepInto is a feature that allows you to ignore stepping into specified functions. Generally common constructors, parameter lookups, and so on.
I've had good luck with this site for getting answers to tough questions. For whatever reason, information about NoStepInto is very hard to find anywhere! What I've found is .NET moved the values that used to exist in autoexp.dat into registry settings. I've found some examples on how to set it up. But, I cannot figure out how to get it to work in my test case. I use .NET 7.1 C++. In order to use it you need to create a key at HKLM\Software\Microsoft\VisualStudio\7.1 called NativeDE then create another key inside that one called StepOver. Inside step over, you will create String values with numeric names with the values representing the functions you wish to ignore. Here is my reg key file that I created: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\NativeDE\StepOver] "1"="\\scope:.*ScriptAction.*\\:\\:getParameter.*=NoStepInto" NOTE: \\ actually gets parsed into \ inside the registry editor should you save this file as a *.reg and double click it into your registry settings. Okay, this is a regular expression that means: *ScriptAction*::getParameter* = NoStepInto I've tried various combinations to no avail. I've also tried using: \scope:.*ScriptAction.*\:\:getParameter.*=NoStepInto \scope:\funct:.*ScriptAction.*\:\:getParameter.*=NoStepIno ScriptAction\:\:getParameter = NoStepInto and 20 other combinations. In my project, ScriptAction is just a typical C++ class, but I keep stepping into the function in this pseudo case: ScriptEngine::doCommand( pAction->getParameter(0)... ) When I F11 into doCommand, I step into ScriptAction::getParameter(). Basically, all examples that I've seen have been about C++ libraries, but none for custom project specific code. I doubt that would be a problem... but I'm thinking there is some special syntax I am missing. Here are a few links I've found that are more useful than not: http://dabbler.typepad.com/ooze/2003...into_for_.html http://www.litwindow.com/Knowhow/wxH...tml#nostepinto http://groups.google.com/groups?hl=e...40TK2MSFTNGP09 Doesn't look like too many people have figured this out. I'd appreciate any insight! Thanks in advance
|
|
#2
|
|||
|
|||
|
I have figured it out! What I ended up doing was downloading and running both a DLL and registry watcher (filemon and regmon, respectively). Filemon confirmed that NatDbgDE.dll loaded successfully. This happens at the start of any debug session, which is to be expected. I didn't know anything about this until I read this post:
http://groups.google.com/groups?q=no...phx.gbl&rnum=6 This guy apparently debugged the DLL directly and hacked it to NOP a string check. Once I confirmed that the DLL loaded properly, I then used regmon to watch for specific registry settings attempting to access anything inside of NativeDE. I wasn't surprised when I discovered there was no attempts made. So I copied the registry settings from HKLM to HKCU and then it worked -- sort of. I had to fix some syntax, but it became very easy to add a bunch more once I got my first case to work! Just to answer another question most people had, self included... the registry settings are loaded at debug start. You don't have to quit .NET or reboot to get the settings. In fact, you can simply just edit everything directly into the Registry Editor. You don't have to close or refresh it... just re run the debug session, just like autoexp used to work! In addition, here are some sample settings I have got to work with my application functions: NOTE: \\ is because it's in a reg file. Editing the registry itself in regedit uses \. Simple cases: "10"="ScriptAction\\:\\:getParameter()=NoStepInto "20"="Parameter\\:\\:getString()=NoStepInto Complex case: "30"="PartitionFilter.*\\:\\:.*=NoStepInto "31"="PartitionFilter.*\\:\\:Allow.*=StepInto "32"="PartitionFilter.*\\:\\:Execute.*=StepInto In the complex case, I have a series of classes. Some examples include PartitionFilterThing, PartitionFilter, PartitionFilter, PartitionFilterBuildings, etc... order matters! How it works: PartitionFilter* constructors -- skipped PartitionFilter*::Add -- skipped PartitionFilter*::Allow -- you can step into this function PartitionFilter*::Execute -- you can step into this function PartitionFilter*::* -- skipped Basically only Allow and Execute are the only functions I can step into now. Now I can do anything I want!!! I truly hope this helps others out, this was a very frustrating exercise of futility. For what it's worth, I love the fact it's in registry settings now. Once I build a large list, I can simply email a reg file to the team. No merge issues. |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|