eclipse-cdt-cloud / eclipse-cdt-cloud/cdt-gdb-vscode
unambiguously set output radix
- Dominant language
- TypeScript
- Stars
- 26
- Forks
- 31
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 2
Description
The conversations in https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/pull/523#discussion_r3057696490 today made me realize there is a small (potential) bug with how output radix is set. Perhaps this has been covered/discussed enough, but I wanted to raise it in a new issue instead of losing the information
In:
https://github.com/eclipse-cdt-cloud/cdt-gdb-vscode/blob/ae6bb90c5fc0f21ba8b9e27fb12551d7cbdb4945/src/switchRadix.ts#L39
The GDB docs recommend always setting radix unambiguously (or using input, but we don't know what that is). The use of `10` and `16` are both ambigious. [link](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Numbers.html#:~:text=The%20base%20must%20itself%20be%20specified%20either%20unambiguously%20or%20using%20the%20current%20input%20radix.)
For example, changing the code to:
```typescript
expression: `> set output-radix ${radix === 'hexadecimal' ? 16. : 10.}`,
```
or
```typescript
expression: `> set output-radix ${radix === 'hexadecimal' ? 0x10 : 0xa}`,
```
would do it.
Contributor guide
Assessment
This issue has not been assessed yet.