06-25-2007 01:16 PM
06-26-2007 12:34 AM
Hi,
I dont believe there is any difference between 3.5 and 4.0 when it comes to debugging of a DLL.
Check out the link
http://digital.ni.com/public.nsf/websearch/52f5bb7ae7f5a409862569ee0073ac53?opendocument
for setting up TestStand.
Regards
Ray Farmer
06-26-2007 07:43 AM - edited 06-26-2007 07:43 AM
To attach the debugger manually, launch Visual Studio 2003, choose Tools>>Processes, choose SeqEdit.exe from the list of processes, click Attach, select Native, click OK, and click Close. At this point, you should be able to set breakpoints in your C/C++ DLL code and those breakpoints should be hit when execution reaches them.
Message Edited by drohacek on 06-26-2007 07:46 AM
Message Edited by drohacek on 06-26-2007 07:47 AM
06-26-2007 09:20 AM
06-26-2007 11:42 PM
David might not be able to respond, so maybe I can pick up where he left off. The .NET 2.0 framework will be automatically loaded into the process if you are using the TestStand 4.0 Sequence Editor, or if you are using a operator interface that is uses the new Insertion Palette or the Variables View controls, or if you call a .NET code module using the .NET Adapter. Having the .NET 2.0 framework in memory should not prevent you from manually debugging an application using Visual Studio 2003, as long as you attach using native debugging (not managed or both). So is your application that you are attaching to the TestStand 4.0 Sequence Editor? Are you sure that you attached using only native debugging?
06-28-2007 12:57 PM
here is the step by step sequence of actions I take to attempt to step into my code:
- open visual studio 2003
- load my project
- rebuild it
- open the cpp file I want to debug and set a breakpoint
- open the teststand 4.0 sequence editor
- open the sequence file that contains calls to my code
- set a breakpoint on the first C++ adapter step that calls my dll code
- in visual studio, go to tools->debug processes and select:
- default transport
- seqedit.exe process
- press attach..., select native and press ok. At that point, the dll is running, the play button on the
visual studio debug toolbar is disabled, while the pause and stop buttons are enabled. ALSO there is
now a question mark on the breakpoint in my c++ code.
- I start the teststand sequence from the sequence editor and wait for it to break
- when the execution breaks on the C++ adapter step, I press the step into button on the sequence editor's
debug toolbar, expecting it to step into my c++ code and instead it steps right over the sequence step.
Questions:
- Do I even need a breakpoint in the teststand sequence on the C++ adapter step?
- Is there anything in that procedure that I am doing wrong?
06-29-2007 12:36 PM
Q: Do I even need a breakpoint in the teststand sequence on the C++ adapter step?
A: No, once you have attached the debugger, whenever a debugger break point is hit it will stop.
Q: Is there anything in that procedure that I am doing wrong?
A: The steps you are taking to debug your dll sounds good (I just tried it and it works). However, there is obviously some other problem. The first thing to confirm is that you're building your dll with debug symbols, either in the binary or emitting them to a .pdb file (without them the debugger is unable to match up source code with the machine code in the dll and so will be unable to break). The next thing is to confirm you are loading the correct dll (that was built with debug symbols), I'll explain how to do this later. After that confirm that the debugger was able to load the symbols. Next confirm that the debugger was able to match up the breakpoint that you specified in your source to a specific spot in your dll. If all these things happen then the debugger should be able to break at the right place.
Instructions:
How to make sure that you are loading the right dll: One of the easiest methods is to set a break point in TestStand right after the step that calls your dll. Attach the debugger, just as you have described and press the break toolbar button (looks like a pause button). In VS2003, select the Debug->Windows->Modules menu. In the Modules pane sort the modules by name (you can do this by click on the 'Name' column header), find your dll and verify in the path column that this is the dll that you really wanted to load.
How to confirm that the debugger was able to load debug symbols: Using the same instructions as above, look at the Information column for the words 'Symbols loaded'. If so then the debugger found the correct symbols.
How to confirm that the debugger was able to match the source code breakpoint to a specific spot in your dll: Follow the above instructions and then set or view a desired breakpoint in source. If the break point is anything other than that (unless you've set advanced options) means that there was a problem and you can hover over the breakpoint to find out more information via the tooltip.
06-29-2007 02:45 PM