Imprima un objeto usando el depurador GDB por ID de objeto (es decir, 0xee63d60)

Is there a way to do a "po" or print object by the object's id/memory location? For instance if I have an object with id: 0xee63d60 can I show what is in that object? I know I can use:

(gdb) info malloc-history 0xee63d60

to get the StackTrace, which is very helpful but I would love to see what is in that object or even what it's name is.

preguntado el 03 de mayo de 12 a las 17:05

2 Respuestas

(lldb) po 0xee63d60 funciona para mi.

contestado el 03 de mayo de 12 a las 18:05

Is that because you're using lldb instead of gdb? - mate hudson

Nope. I just tested in GDB, and I get the same result. - jose hinman

I believe if you are paused in a "break point" you can right-click an object and select Print Object. This should print out the "description" of the object. See +(NSString *)description of the NSObject class. You can override this method if you need something more specific.

Espero que esto ayude

contestado el 03 de mayo de 12 a las 17:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.