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

Reply via email to