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 <xHeap+1010): 0xCC 0xCC
inside the function it "x/2b status" shows
0x11 <__data_start>: 0x00 0x00

When I try "p/x *status" it shows
$5 = 0x0
not giving me any address and I can tell from the value that it's
wrong, because I set the variable to 0xCCCC before I called the
function.

I tried to make sense of all this using "disassemble" and stepping
through the assembler code with "stepi" but it looks like everything is
fine.
If I set the value of *pcData=0x3333 this is really written to the
variable if I return from the function so everything is fine.
But I cannot debug like this obviously :-)
I set optimization to -O0 so there is no optimization.
If I set optimization to -O1 I am running into problems because I then
have even more problems because sometimes my variables are only
available through registers and then I cannot deal with the values any
more, so setting optimization to a higher value is not an option.

So, I am looking for a solution how to be able to debug something like
this with optimization -O0.
Any idea what I do wrong or is it just not possible to display the
value of paramters inside of a function?

Thanks in advance

Juergen


I am using
cpu: MSP430xF1611
gcc: msp430-gcc 3.3.6
gdb: msp430-gdb 5.1.1
OS: linux
embedded OS: freeRTOS
MSP-FET430UIF for JTAG-Debugging

.



Relevant Pages

  • Re: debugging in release mode
    ... I have no doubt that it's a problem of mine and not of the compiler. ... I don't really need optimization ... for the sake of memory space or execution speed. ... shows the differences between the default debug mode and the default release ...
    (microsoft.public.vc.mfc)
  • RE: Step by Step skips large chunks of code
    ... project settings it is in debug mode and no optimization is set. ... We have several similar projects that debug fine, ... Microsoft Online Community Support ...
    (microsoft.public.vsnet.debugging)
  • Re: Downside of using Debug builds for production
    ... use of Microsoft's Exception Handling application block. ... the process if I desire to debug the application. ... For example, an "optimized" build could in some cases be larger than the "non-optimized" build, depending on what the optimization goals are. ... it seems to me that you are really only interested in one aspect of the "debug" build: the inclusion of symbols allowing for the stack trace to include line numbers in the exceptions. ...
    (microsoft.public.dotnet.framework)
  • Tricking pl1s production_table
    ... you're using debug and break statements to create a trace log. ... testprog: procedure options; ... I can't just go compile everything with -table ... which doesn't happen below optimization level 2. ...
    (comp.sys.stratus)
  • Re: Incompatible command-line options
    ... To be able to debug it, I have set optimization to disabled and debug info to "...edit and continue". ... Double-check that you don't have any necessary code inside ASSERT statements. ...
    (microsoft.public.vc.mfc)