Alf,
The two stepping issues where the program location appears to jump to an unexpected line are gcc bugs or limitations. Effectively, those lines are what the gcc dwarf info is reports for those addresses. This often happens with optimized code, but in this specific case I don't really understand why gcc would be reporting it. However, I suspect if you re-compiled with a lower level of optimization that GCC would report the line info more accurately.
The issue where the parameter has a wrong value is a CCS bug. I've filed it as SDSCM00049857. Effectively "length" is stored in R13, but the debugger thinks it's stored in FP (an alias for SP).
Regarding the hang, the dump file wasn't due to a hang and didn't actually tell me much. If you run into the hang again, wait a good 20 seconds before killing CCS. You should then see a *.dmp file prepended with hang_ or unresponsive_. If so, please send me that file and I'll take a look.
Darian