D
D
dimakovalenko2014-08-11 22:36:00
Debugging
dimakovalenko, 2014-08-11 22:36:00

Evaluation in LLDB: how to free memory allocated for variables $1, $2, $3 etc?

Introductory. If in the LLDB console on iOS run

(lldb) p/x $r1
(unsigned int) $1 = 0x07000006

(lldb) p/x $r1
(unsigned int) $2 = 0x07000006

(lldb) p/x $r1
(unsigned int) $3 = 0x07000006

...и т.д.

about 1500 times, then in the end we get an error:
error: Couldn't allocate space for the stack frame: Couldn't malloc: address space is full
Errored out in Execute, couldn't PrepareToExecuteJITExpression

The fact is that every time we execute p/x $r1 , the debugger evaluates (I don’t know the corresponding term in Russian, sorry) the $r1 expression , during which memory is allocated for the $N variable (where N=1,2, 3,... ). After a certain number of attempts, the memory runs out and we see an error message.
Actually the question is: Is it possible to somehow free the memory allocated by the debugger for the variables $1 , $2 , $3 , etc.? Is there some special command for this in LLDB (I didn’t find it in the documentation - maybe there is an undocumented one?) Or maybe a script can be written in Python and attached to LLDB?
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question