Reputation: 505
I'm using static analysis to verify an OSX program that I have developed personally. using GDB I have found the memory address of a NSString. Is there any way of parsing it as a NSString and read its contents? 'po' does not work as the symbol table is not included. all other examine memory commands do not work. I'm assuming the string literal is contained within the object somewhere, can I dump the entire object UTF-8/16?
Upvotes: 0
Views: 602
Reputation: 8012
There are at least two different layouts of constant string object. Both of them store a pointer to the string's bytes in the object; I think one layout uses UTF-8 and the other uses UTF-16. The right set of x/x and x/s commands ought to be able to print the contents, but if the debugger's memory commands aren't working then that doesn't help.
Upvotes: 1