visual studio - How to break when entering own code? -


the "just code" feature permits limit debugging operations user code (unoptimized code available pdb).

is possible break whenever program flow invokes "my code" in visual studio?


potential application: when debugging issues in libraries used complex third-party application, anything called when issue occurs starting point. breaking when entering own code permit without excessive logging.

it doesn't seem so.

however, if own code within few namespaces, windbg can used workaround (the following unmanaged code; assume there's way managed code):

> bm modulename!namespacename::* 

will set breakpoints entry point within given namespace. if access single-threaded, windbg can print list of actual entries performed in execution:

> bm modulename!namespacename::* "bd *; ln; l+t; p \"dv; pt \\\"be *; r $retreg; g\\\"\"" 

will add breakpoints potential entry points automatically perform actions log , out again:

  1. bd * disable breakpoints we're entering "own code"
  2. ln print information call location
  3. l+t; p "[...]" skip calling convention handling
  4. dv print locals (including arguments, handled)
  5. pt "[...]" skip method end
  6. be * re-enable breakpoints we're leaving "own code"
  7. r $retreg log method result (if calling convention , result type cause result register used)
  8. g continue next breakpoint

from log possible @ least identify reasonable breakpoints , breakpoint conditions second debug run (in debugger, including visual studio).


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -