Hello,
I am working on implementing a feature into one of our projects, and I am running into a bit of a conundrum. I am generating a generic text file (using python) in which it deconstructs one of my Structures (and all sub-Structures) into a list of generic types
for example, if I had a structure like this:
#define MAX_ARRAY_SIZE_DEFINITION 100
#define MAX_ARRAY_SIZE MAX_ARRAY_SIZE_DEFINITION
typedef struct{
uint_32 checksum;
uint_16 sig1;
uint_16 sig2;
MyStruct2 SubStruct;
}MyStruct;
typedef struct{
uchar X;
uchar Y;
uint_16 Z[MAX_ARRAY_SIZE];
}
The output would look like this:
uint_32 Checksum
uint_16 sig1
uint_16 sig2
uchar x
uchar y
uint_16 Z[100]
The problem I have is that the MAX_ARRAY_SIZE is not easily readable (and not as simple as it is defined in the code above), so there is no way for me to parse that part out.
I was looking through the TDT files, and ELF files to see if I could determine the array size based on those files, but I cannot get what i need from the ELF file (that i know of, been using Objdump a whole bunch but can't discern the information i need from it). So I was wondering if the TDT files held an encoded definition of the array size?
"Z" is actually a much more detailed and unique name, so i can find it exactly as-is.
Hi Mashall.
To investigate your problem, we need more information:
1. Your CW version: Start the IDE and click on Help | About Freescale CodeWarrior. Click on Installed Products.Save all info displayed into a txt file and upload it here
2. your chip part number
3. demo project.
4. problem screenshot.
Thanks for your cooperation.
Best Regards,
Jennie Zhang
Chip: MFC5282 (M5282EVB(CFM) is what i use to flash it using CF Flasher)
Demo Project: none, this is a fully-released build that we developed and built-upon the MQX RTOS.
Problem SS: I don't think you understood what i was asking, no way to screenshot... I am asking if the .tdt files or .elf files contain information about variable array declaration.
Hi Marshall,
The C preprocessor macros are used automatically by the C compiler to transform your program before actual compilation, so you will need to preprocess the files so that all the substitutions are made in order to get the size of the array:
You will see that inside the generated file the MAX_ARRAY_SIZE_DEFINITION has been replaced by its value:
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
I was really hoping that would work for me. Unfortunately my pre-process did not replace all of the array definitions :\
It looks like we have different versions of software as well, maybe it was not implemented in my version?
Hi Marshall,
I have tested on my side using CodeWarrior for ColdFire v6.4 and it is also working:
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer