[gdb][script] Syntax change from version 6.5 to 10.2 gdb gcc toolchain

Viewed 36

The old syntax in the 6.5.0 that works for this statement:

set {int}(&FlashBufferStart+$EraseCnt*2+0) = 0x1000

This would mean placing value 0x1000 into into into the allocated address.

With the new 10.2.0 this sentence will result an error:

Cannot perform pointer math on incomplete type "<data variable, no debug info>"

I have tried using type casting parenthesis, {int} , {void*}, or value might just ended totally different, I have seen similar post for this error but it didn't solve the issue. Any idea?

1 Answers

With the new 10.2.0 this sentence will result an error:

It appears that GDB doesn't know the type of FlashBufferStart.

GDB-6.5 probably assumed that this is a char (or maybe in int), and silently performed arithmetic corresponding to the assumed pointer type.

GDB=6.10 is telling you that it doesn't understand what you want it to do instead.

Solution: cast &FlashBufferStart to appropriate pointer type, so GDB knows what you want.

Related