¿LLDB tiene variables de conveniencia (var var)?


¿LLDB tiene variables de conveniencia? Si es así, ¿cómo los uso? Si no, ¿hay alguna cosa similar para usar?

Referencia: http://software.intel.com/sites/products/documentation/hpc/atom/application/debugger/commands143.html

 40
Author: Peter Mortensen, 0000-00-00

3 answers

Finalmente lo descubrí yo mismo. Ejecuta help expr en LLDB y verás:

Variables definidas por el usuario: Puede definir sus propias variables por conveniencia o para ser utilizadas en expresiones posteriores. Los define de la misma manera que definiría las variables en C. Si el primer carácter de su variable definida por el usuario es un$, entonces el valor de la variable estará disponible en el futuro expresiones, de lo contrario solo estará disponible en el actual expresion.

Así que expr int $foo = 5 es lo que quiero.

 47
Author: an0,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-08 14:30:28

Hoy luché con esto. Esto es lo que parece tratar con variables Objective-C en LLDB:

expr UIApplication *$app = (UIApplication *)[UIApplication sharedApplication]
expr UIWindow *$keyWindow = (UIWindow *)[$app keyWindow]

Etc. He encontrado que LLDB funciona mejor si no anidas ninguna llamada, y explícitamente das un tipo de retorno en cada llamada.

Todavía tengo un error de segmentación cuando intento hacer que initWithFrame: funcione en una UIView más adelante. :/

 19
Author: escrafford,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-08 14:34:14

Simplemente use el formulario:

(lldb) expr var

De su tutorial :

(lldb) expr self
$0 = (SKTGraphicView *) 0x0000000100135430
(lldb) expr self = 0x00
$1 = (SKTGraphicView *) 0x0000000000000000

También puede llamar a funciones:

(lldb) expr (int) printf ("I have a pointer 0x%llx.\n", self)
$2 = (int) 22
I have a pointer 0x0.
(lldb) expr self = $0
$4 = (SKTGraphicView *) 0x0000000100135430
 3
Author: john.k.doe,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-08 14:26:09