On 2013-07-29, ravim <ravi.mandl...@gmail.com> wrote: > My apologies if I am asking something irrelevant to this forum. We are using > mspgcc and mspdebug for our project. We are facing some issues with what we > assume might be stack overflow. The timer interrupts stops working after > around 2 hours, however device still receives packets. Also, when we reset > the device after timer gets stuck, they never turn back on unless we > re-install the code. We are trying to debug. > > I wanted to know if there is any possible way we can know the size of > global variables in the binary?
Not easily, no. It's pretty easy to find the total size of non-automatic initalized variables (section .data) and total size of non-automatic uninitialized variables (.bss) by looking at a linker map file or by using the "size" or "objdump" commands on the linked ELF file. You can generate a linker file by passing the "-Map <mapfilename>" option to the linker. If you are using the "gcc" binary to do the linking, then you can tell it to pass an option on to the linker by using the -Wl option: gcc -Wl,-Map,foo.map -o foo.elf file1.o file2.o file3.o However, I'm not aware of a simple way to find the sizes of only the _global_ variables and not include local variables that have a static storage class (The .bss and .data sections include both global and local variables). > This will help us narrow down a few specifics. We know there is > something in TinyOs when we make, it let us know size of global > variables, we are looking for something similar in mspdebug. Why mspdebug? -- Grant Edwards grant.b.edwards Yow! I want a VEGETARIAN at BURRITO to go ... with gmail.com EXTRA MSG!! ------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users