Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Resolving variable.member (type_code) Signals for OCDI Debugging (Microprocessor SDK)

LabVIEW 8.6 Microprocessor SDK Help
June 2008

NI Part Number:
372197B-01

»View Product Info

The LabVIEW C Code Generator adds type information to the OCDI comments for every symbol in the signal table. The debug daemon uses the type information to find the offset of the structure members if your toolchain does not provide a way to find the offset. Depending on the data type, the type information in the OCDI comments is in the form of ( type_code ), where type_code is a numeric value for non-cluster data types or is in the form of ( type_code1, type_code2, and so on), where type_code1, type_code2 are numeric values for cluster data types as shown in the following code sample:

struct _ocdi1_heap {

cl_00000 c_error_in__no_error_; /* c: error in (no error) */

int32 l_Constant; /* l: Constant */

int32 l_For_Loop_N; /* l: For Loop: N */

int32 l_sum; /* l: sum */

Boolean c_error_in__no_error__CS; /* c: error in (no error): CS */

} _DATA_SECTION __ocdi1_heap; /* hB3A9B04 */

struct _ocdi1_heap _DATA_SECTION *hB3A9B04 = &__ocdi1_heap; /* hB3A9B04 */

/* OCDI::Memory::Heap = __ocdi1_heap */

/* OCDI::Memory::Signal::0x20FC = __ocdi1_heap.c_error_in__no_error_ ((33,3,7)) */

/* OCDI::Memory::Signal::0x77C = __ocdi1_heap.l_Constant (3) */

/* OCDI::Memory::Signal::0x460 = __ocdi1_heap.l_For_Loop_N (3) */

/* OCDI::Memory::Signal::0x1218 = __ocdi1_heap.l_sum (3) */

/* OCDI::Memory::Signal::0x14CC = __ocdi1_heap.c_error_in__no_error__CS (33) */

The C parser uses the extra comments to generate the symbols for the signals in the form of variable.member (type_code). For example, __ocdi1_heap.1_Constant(3).

Use the following VIs to compute the member offset from signal type information and target-specific alignment:

These VIs are located in the following directory:

labview\vi.lib\LabVIEW Targets\Embedded\Debug\Map\GCC

Refer to the following VI for an implementation example:

labview\vi.lib\LabVIEW Targets\Embedded\Debug\Map\GCC\ EMB_Debug_Map_Gcc_ResolveSymbols.vi
Note  If your toolchain provides an easier way to obtain the offset of structure members, use your toolchain and disregard the type information in the OCDI comments.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit