Greeting Dr. Martin G.

My guess is that optimization is causing problems with your debugger sessions.  
I use these compile and link flags on the windows platform (msp target).  I 
think the -g is important in this respect.

These are the flags I have used in the past.

+++
CFLAGS= -save-temps -g -DMSP430F133 -mmcu=msp430x133 -mendup-at=main 
-Wimplicit-function-declaration -Wall -W -Wno-char-subscripts 

LINKFLAGS= -Wl,--print-map -Wl,--cref  -Wl,-Map=map.txt -Wl,-T .\msp430x133.x 
+++

Cheers,
Jody Baudoin


-----Original Message-----
From: [email protected]
[mailto:[email protected]]on Behalf Of Dr.-Ing.
Martin Göttlicher
Sent: Sunday, January 09, 2005 10:50 AM
To: [email protected]
Subject: [Mspgcc-users] gdb not working as expected / How to find out if
sufficient memory is available


Hello,

I'm using the mspgcc tool chain on a SuSE Linux 9.2 built as described in the 
documentation. I'm able to compile load and run programs but using the 
debugger (GNU gdb 5.1.1) does not work as expected. 

When I compile and link the following program:

#include "io.h"
#include "signal.h"

static uint16_t sum(uint16_t a, uint16_t b) {
    uint16_t s = a + b;
    return s;
}

int main(void) {
    uint16_t s;
    /* Disable watchdog during initialization */
    WDTCTL = WDTPW|WDTHOLD;

    s = sum(1000u, 400u);

    while (1) {
        /* Enter Low Power Mode 3 */
        LPM3;
    }
    return 0;
}

with:
/usr/local/msp430/bin/msp430-gcc -mmcu=msp430x149 -g -c simpletest.c -o 
simpletest.o
/usr/local/msp430/bin/msp430-gcc -mmcu=msp430x149 simpletest.o -o simpletest

When I step into the function sum and look for the function arguments the 
debugger prints:
p a
$1 = 1400
p b
$2 = 16383
The sum s however gets calculated correctly.
p s
$3 = 1400

I would be very happy if someone on this list could give me a hint what I'm 
doing wrong since the application I 'm actually developping does not behave as 
expected and I need a reliable debugger to solve the problem. My application 
uses some rather large structures so there may be a memory problem. Does 
anybody know how to check if sufficient memory is available.

Regards,
Martin


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to