rohanrhu / gdb-frontend

☕ GDBFrontend is an easy, flexible and extensible gui debugger. Try it on https://debugme.dev
https://oguzhaneroglu.com/projects/gdb-frontend/
GNU General Public License v3.0
2.79k stars 98 forks source link

Evaluating pointers as arrays #64

Open NanShanJi opened 3 months ago

NanShanJi commented 3 months ago

image

Hello, it seems that it does not support the display of pointer array values

rohanrhu commented 3 months ago

Hi, you can evaluate and show pointers as array.

Open a new evaluator (𝑓𝑥 button on the top bar) and cast your pointer into an array like this:

*argv@2

The syntax is *ptr@NUM_OF_ITEMS.

image

(The first evaluator window is a pointer evaluated and you can't see it as an array but the second one it is casted into an array.)

GDB doesn't know that how many items there are on the memory from the address your pointer is pointing; so you must convert it into an array like this with a length.