eclipse-cdt-cloud / cdt-gdb-adapter

CDT GDB Debug Adapter
Eclipse Public License 2.0
28 stars 40 forks source link

Ensure --frame is included even for frame 0 #236

Closed jonahgraham closed 1 year ago

jonahgraham commented 1 year ago

Some commands take a --frame or --thread, but the code had a common javascript error of if (numberVar) instead of if (numberVar !== undefined).

For threads this isn't often a problem as GDB doesn't use thread 0 typically. But for frames this is a problem as --frame 0 was being omitted, leaving GDB to return info about the last frame that was accessed, e.g like this:

-stack-list-variables --thread 4 --frame 1 --simple-values
-stack-list-variables --thread 4 --simple-values

Because the second line doesn't include the frame, GDB uses frame 1 still. However that will lead to errors as it should be frame 0 that is queried.

Fixes #235