Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find source files when debugging a process 1

Status
Not open for further replies.

titanandrews

Programmer
Feb 27, 2003
130
US
Hi,
I know how to start the debugger and use it, but what if I want to start a process and attach the debugger to it. When I attach to a process from Build-->Start Debug-->Attach to process menu, I get the machine code. How do I tell Visual Studio where my souce files are so that I can see the code? I am using MS VS 6.0


many thanks,

Barry
 
Attach to process is only if you want to debug a dll application , or a COM object. You will indicate a process what will start when you start the debugger. It could be any process, but is recommended it to be a process which will use your DLL application or COM object. Otherwise, the debugger will start a process what has nothing to do with your project.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
I'm not sure if you answered by question or not. I want to attach to an exe which does use dlls. So is that considered a dll application?
Otherwise, the debugger will start a process what has nothing to do with your project.
What do you mean by that? I can attach to any process that is running on the machine from the Task Manager or from the build menu. I don't see the debugger starting any other processes other than itself.
 
I did not answered your question. I do not know how to accoumplish what do you want. But I explained what is AttachToProcess for. I will try to see how to do what do you want, but in the most cases, you will get assembly code. There should be some debug information files, for projects compilled in Debug Mode. But I do not know what they are.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Yeah, I have the .pdbs and the source files. I just can't figure out how to tell the debugger where they are. It's not very intuitive. (at least to me)


Barry
 
Ok, I figured out enough to be useful. If you know where the entry point is (or any function you know you will hit)you can just open the source file then set a breakpoint. The rest is magic. VS will ask you for the location of any additional source files if they are not located in the directory of the first source file while you are stepping through the program. Good enough for me. If you have any more information, I would also like to hear...


thanks,

Barry
 
I your project is currently open and you have started application without debugging, you can debug it from TaskManager. When you will be asked to choose an instance of debugger to attach, choose the instance of your open project. So you will see all your code in debugger. If your project is not currently open, just open it and after that try to debug the your running applicaton from the TaskManager.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top