views:

61

answers:

3

I am putting a break point in a winforms application inside a function like

public void FillOutListViewCtrl()
{
    // code to be debugged
}

I put a breakpoint here. After running the application I just want to know what exactly is going on inside of this function. Is there any way to go to this function directly? Do I need to attach to any process to achieve this?

Project uses a complex class hierarchy and I would like to know the best possible way to solve my problem. I don't know of any responsible action for going inside this function though this project is large with a large class hierarchy.

+2  A: 

You don't need to do anything special. Just follow these steps:

  1. set correct startup project within your solution
  2. set breakpoint
  3. hit F5
  4. run your application to the point where you know your function should be called
  5. debug

If you can't hit F5 (for whatever reason)

  1. run your application
  2. set breakpoint
  3. attach to your application's process (you'll see it in the process list)
  4. GOTO step #4 above

That's it.
(if that's what you were asking)

Robert Koritnik
this is not the one i actually need without pressing the action which i dont know though i need to move break point to these function so that i can understand the details
peter
+1  A: 

If you run the program with the debugger of visual studio attached (just press F5) and you have a breakpoint in the method, than the program execution should stop whan the method is being called and you should be able to step through the method.

So, no, nothing special needed.

Maximilian Mayerl
this is not the one i actually need without pressing the action which i dont know though i need to move break point to these function so that i can understand the details
peter
I'm sorry, but I don't get what you want to do. Move the breakpoint? Just open the file in Visual Studio, scroll to the method and set a breakpoint at it's first line...
Maximilian Mayerl
this is not what i interested to know,,finally i found the responsible action to trigger in to the reponsible method where breakpoint is inserted
peter
A: 

Set a breakpoint at the first line of the method. Run yur application. When the method is called the execution stops at your breakpoint. Now step through the method by F10 key . you can rightclick on some variables and quickwatch variables, skip execution to different line by rightclick and set next statement to the line. Again F5 to execute the rest.

If it helps please mark as answer.

Himadri