Argument passing is displayed wrong in hiwave debugger

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Argument passing is displayed wrong in hiwave debugger

Jump to solution
1,693 Views
Flo
Contributor I
Hi.

I've discovered an anoying bug in Hiwave debugger for HC08 V6.1. (CW version 5.0 patch 1).
The "Procedure" window displays the current stack trace including the arguments
passed to a called function.
Following the calling convention for HC08 a maximum of 2 bytes is passed in
registers. This is allways the last variable to pass, all the other are passed
on stack.
The debugger only displays arguments passed via stack correctly. The ones
passed in registers show wrong values (normally the pushed return address).
This affects C and C++ functions and also "Data" windows that display e.g. a
passed this-pointer.
Take care when dereferencing this-pointers!

How do i post a bug report?

Flo
Labels (1)
Tags (1)
0 Kudos
1 Solution
404 Views
Flo
Contributor I
Hello CrasyCat.

It's clear to me, that it's only a display problem.
But not all functions push the register content on the stack on entry. If this is not necessary the argument is processed directly.
In fact my debugger shows a wrong value in the procedure window where the passed arguments stand in this case (no undefined).
You are right, once you know this problem it's not a problem anymore.
But before I discovered it, it was very confusing because i saw a wrong this-pointer, then looked at the wrong memory, saw wrong content ....

and it wasn't at all a problem of my code!

Flo

View solution in original post

0 Kudos
2 Replies
404 Views
CrasyCat
Specialist III

Hello

I have made some test locally. This is a display issue only.

The parameter value is pushed on the stack in the called  function entry code. After entry code has been executed, appropriate value is displayed on the procedure and local data window.

Basically the debugger shows "undefined" for local variables or parameters, which value is kept into register. In the procedure window is just shows an empty parameter. This is a display problem only within the debugger and does not affect code execution.

The generated code is correct.

We do not have any fix for this display issue now. You can submit a defect using our on-line support web page.

Go to following URL: 

http://www.freescale.com/webapp/sps/site/homepage.jsp?nodeId=054670&tid=FSH 

And click on "Submit a service request".

CrasyCat

0 Kudos
405 Views
Flo
Contributor I
Hello CrasyCat.

It's clear to me, that it's only a display problem.
But not all functions push the register content on the stack on entry. If this is not necessary the argument is processed directly.
In fact my debugger shows a wrong value in the procedure window where the passed arguments stand in this case (no undefined).
You are right, once you know this problem it's not a problem anymore.
But before I discovered it, it was very confusing because i saw a wrong this-pointer, then looked at the wrong memory, saw wrong content ....

and it wasn't at all a problem of my code!

Flo
0 Kudos