How Can I Debug a Shared Library Function Executing Within a VI in Linux? Primary Software: LabVIEW Development Systems>>Professional Development SystemPrimary Software Version: 8.5.1 Primary Software Fixed Version: N/A Secondary Software: LabVIEW Signal Express>>Development System
Problem: I have called a shared library function from my VI. When I run the VI, LabVIEW never returns from the called function or returns an unknown error. I suspect there is a problem in the called function. Is there any way for me to debug this function as it runs in my VI? Solution: You can attach a debugger to the running LabVIEW process in Linux. One of the most common debuggers in Linux is GDB. It is included with most Linux Distributions. You can use this debugger to halt executing functions and then step through code. Start the GDB debugger with the following command: gdb Ensure that your VI is running, and execution is currently within the shared function you wish to debug. Once the debugger finishes initializing, you can then run the following command from within GDB to attach the debugger to the running LabVIEW process. attach PID Replace PID with the process ID of the LabVIEW. Refer to the related links section below to obtain the correct process ID (PID) of LabVIEW. You can now use standard GDB commands to debug the executing shared library function. Refer to the related links section for GDB documentation and command syntax. When you finish debugging the function, you can detach from the process and allow it to finish execution normally with the following command run from within the GDB environment. detach You can then exit GDB with the quit command. quit Related Links: KnowlegeBase 4NML1TMO: How Can I Find The Process ID (PID) of LabVIEW in Linux? KnowlegeBase 3MNE8C7T: What is the Difference Between .so Files and .a Files in Linux? GDB: The GNU Project Debugger GDB Documentation Attachments:
Report Date: 07/23/2008 Last Updated: 08/28/2008 Document ID: 4NMM33MO |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
