gpt-4-0314· openai
Suzhen/CodeChat
gdb print array, get this "\001\002\003\004\005\006\a\b\t"
- User
gdb print array, get this "\001\002\003\004\005\006\a\b\t"
- Assistant
When you get an array like "\001\002\003\004\005\006\a\b\t" in gdb, it means that you are looking at an array of characters. Each of the elements is a non-printable character represented by an escape sequence.
You can use the
x/n(examine) command in gdb to display the memory contents in different formats, wherenis the number of elements you want to display. For instance, if you have an array of 9 elements as in your question, you can print the array content in hexadecimal format using the following command in gdb:codex/9xb <array_address>Replace
<array_address>with the actual address of the target array.