debugging msp430

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
Reply to
Juergen
Loading thread data ...

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); }

Reply to
larwe

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.