Programmatically get all frame variables in objective-c -


i'm trying create own custom assert. however, assertion automatically include of relevant variables. seems basic me, , i've searched around hour can't seem find way access relevant stack frame variables. know how these variables?

fyi - don't need access variables in debugger, need access them programmatically. upload them along crash report give me more information crash. know can print them out manually...that i'm looking avoid.

you asking re-invent sized chunk of debugger.

without symbols, there isn't can interrogate figure out layout of local frame. symbols, quite optimizer have stomped on local variables optimizer re-use stack slots @ whim once determines variable no longer needed within frame.

note many crashes won't able caught @ or, if caught, frame within occurred have long since been destroyed.

since mention creating custom assertion, sounds aren't looking introspect crashes as dump snap of local frame when programatically detect things have gone off rails. while there isn't means of automatically reporting on local stack state, like:

{ ... function ....   ... local variables ...   #define reportblock ^{ ... code summarizes locals ... ; return summary; }    yourassert( cond, "cond gone bad. summary: %@", reportblock()); } 

note #define ensures each yourassert() captures state @ time of assertion. note above might have potentially significant impact on performance.

note made code up. seems worthy of investigation, may prove non-viable number of reasons.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -