debugging msp430

Aug 31, 2006 1 Replies

Hi,



I try to debug function parameters inside a function. I am going nuts doing this. I don't know why I didn't notice problems before, but this is what I do. I have a function call



myresult_t DoSomething(portSHORT command, portSHORT* status);



I call this with portSHORT command = 0x0000; portSHORT status = 0xCCCC; (with portSHORT being 16bit wide)



DoSomething(command, &status);



Inside the function (anywhere in the function actually, not only in the first line) I neither seem to be able to get the real value of the address the pointer status is pointing to, nor the value the variable the pointer is pointing to holds (*status)



"x/2b status" should give me the address along with the content, but it's not. If I call "x/2b &status" OUTSIDE before I call the function it shows:



0x1602

The ABI uses registers for at least the first parameter, maybe the first couple of parameters (I forget... it's been a while). What is the _caller_ code generated for:

void myfunc(uint16_t a, uint16_t b, uint16_t c) { }

void main(void) { myfunc(0x1234,0x5678,0xabcd); }

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required