Coder Social home page Coder Social logo
chisel

facebook / chisel Goto Github PK

View Code? Open in 1sVSCode Editor NEW
8.8K 275.0 768.0 3.46 MB

Chisel is a collection of LLDB commands to assist debugging iOS apps.

License: MIT License

Python 90.94% C 0.86% Objective-C 2.24% Objective-C++ 5.00% C++ 0.82% Makefile 0.14%

chisel's Introduction

Support Ukraine - Help Provide Humanitarian Aid to Ukraine.

Chisel

Chisel is a collection of LLDB commands to assist in the debugging of iOS apps.

[InstallationCommandsCustom CommandsDevelopment Workflow ContributingLicense]

For a comprehensive overview of LLDB, and how Chisel complements it, read Ari Grant's Dancing in the Debugger — A Waltz with LLDB in issue 19 of objc.io.

Installation

brew update
brew install chisel

if .lldbinit file doesn't exist you can create it & open it by tapping on the terminal

touch .lldbinit 
open .lldbinit 

Then add the following line to your ~/.lldbinit file.

# ~/.lldbinit
...
command script import /usr/local/opt/chisel/libexec/fbchisellldb.py
  • Note that if you are installing on an M1 Mac, the path above should be /opt/homebrew/opt/chisel/libexec/fbchisellldb.py instead.

Alternatively, download chisel and add the following line to your ~/.lldbinit file.

# ~/.lldbinit
...
command script import /path/to/fbchisellldb.py

The commands will be available the next time Xcode starts.

Commands

There are many commands; here's a few: (Compatibility with iOS/Mac indicated at right)

Command Description iOS OS X
pviews Print the recursive view description for the key window. Yes Yes
pvc Print the recursive view controller description for the key window. Yes No
visualize Open a UIImage, CGImageRef, UIView, CALayer, NSData (of an image), UIColor, CIColor, or CGColorRef in Preview.app on your Mac. Yes No
fv Find a view in the hierarchy whose class name matches the provided regex. Yes No
fvc Find a view controller in the hierarchy whose class name matches the provided regex. Yes No
show/hide Show or hide the given view or layer. You don't even have to continue the process to see the changes! Yes Yes
mask/unmask Overlay a view or layer with a transparent rectangle to visualize where it is. Yes No
border/unborder Add a border to a view or layer to visualize where it is. Yes Yes
caflush Flush the render server (equivalent to a "repaint" if no animations are in-flight). Yes Yes
bmessage Set a symbolic breakpoint on the method of a class or the method of an instance without worrying which class in the hierarchy actually implements the method. Yes Yes
wivar Set a watchpoint on an instance variable of an object. Yes Yes
presponder Print the responder chain starting from the given object. Yes Yes
... ... and many more!

To see the list of all of the commands execute the help command in LLDB or go to the Wiki.

(lldb) help
The following is a list of built-in, permanent debugger commands:
...

The following is a list of your current user-defined commands:
...

The bottom list contains all the commands sourced from Chisel.

You can also inspect a specific command by passing its name as an argument to the help command (as with all other LLDB commands).

(lldb) help border
Draws a border around <viewOrLayer>. Color and width can be optionally provided.

Arguments:
  <viewOrLayer>; Type: UIView*; The view to border.

Options:
  --color/-c <color>; Type: string; A color name such as 'red', 'green', 'magenta', etc.
  --width/-w <width>; Type: CGFloat; Desired width of border.

Syntax: border [--color=color] [--width=width] <viewOrLayer>

All of the commands provided by Chisel come with verbose help. Be sure to read it when in doubt!

Custom Commands

You can add local, custom commands. Here's a contrived example.

#!/usr/bin/python
# Example file with custom commands, located at /magical/commands/example.py

import lldb
import fbchisellldbbase as fb

def lldbcommands():
  return [ PrintKeyWindowLevel() ]
  
class PrintKeyWindowLevel(fb.FBCommand):
  def name(self):
    return 'pkeywinlevel'
    
  def description(self):
    return 'An incredibly contrived command that prints the window level of the key window.'
    
  def run(self, arguments, options):
    # It's a good habit to explicitly cast the type of all return
    # values and arguments. LLDB can't always find them on its own.
    lldb.debugger.HandleCommand('p (CGFloat)[(id)[(id)[UIApplication sharedApplication] keyWindow] windowLevel]')

Then all that's left is to source the commands in lldbinit. Chisel has a python function just for this, loadCommandsInDirectory in the fbobjclldb.py module.

# ~/.lldbinit
...
command script import /path/to/fbobjclldb.py
script fbobjclldb.loadCommandsInDirectory('/magical/commands/')

There's also builtin support to make it super easy to specify the arguments and options that a command takes. See the border and pinvocation commands for example use.

Development Workflow

Developing commands, whether for local use or contributing to Chisel directly, both follow the same workflow. Create a command as described in the Custom Commands section and then

  1. Start LLDB
  2. Reach a breakpoint (or simply pause execution via the pause button in Xcode's debug bar or process interrupt if attached directly)
  3. Execute command source ~/.lldbinit in LLDB to source the commands
  4. Run the command you are working on
  5. Modify the command
  6. Optionally run script reload(modulename)
  7. Repeat steps 3-6 until the command becomes a source of happiness

Contributing

Please contribute any generic commands that you make. If it helps you then it will likely help many others! :D See CONTRIBUTING.md to learn how to contribute.

License

Chisel is MIT-licensed. See LICENSE.

chisel's People

Contributors

kastiglione avatar longv2go avatar arigrant avatar antons avatar bartoszj avatar sunbohong avatar mattjgalloway avatar kolinkrewinkel avatar PeteTheHeat avatar tecknut avatar dstnbrkr avatar soniccat avatar agisilaos avatar aadsm avatar bencochran avatar alexch2000 avatar aledista avatar a2 avatar zertosh avatar Ashton-W avatar dmpv avatar eithanshavit avatar arorajatin avatar jreese avatar jballer avatar zats avatar adamjernst avatar alanzeino avatar algal avatar Goom11 avatar

Stargazers

Yuriy Solodkyy avatar Igor Kislyuk avatar Remmelt koenes avatar  avatar  avatar jack avatar AlexPlex avatar  avatar Dimitar Stefanovski avatar  avatar Shahbaz Javeed avatar Mustafa avatar  avatar Cristi Olteanu avatar Turgay Afsar avatar  avatar Oğuzhan Varsak avatar Denis Karpenko avatar Fabrizio Destro avatar Jinwoo Kim avatar JaminZhou avatar Matt Ronchetto avatar Pete Schaffner avatar Jason Ou avatar Tomonori Ueno avatar Even Gabrielsen avatar 최민한 avatar  avatar Robert Bedell avatar Xianhe avatar  avatar KpwnZ avatar Alexey Ivashko avatar BigDaddy avatar Serhat Şahin avatar  avatar leejunhui avatar eg avatar Otniel avatar Andrea Sacerdoti avatar  avatar jimchow avatar  avatar Heikki avatar George Kontridze avatar Elias avatar Andrey Oshev avatar  avatar 龙虎山大天师 avatar SunneyG avatar  avatar lidium avatar David Smith avatar Vatsal Kelawala avatar  avatar roseau avatar ❂ avatar Michał Ziobro  avatar  avatar Igor Silaev avatar berchan avatar Eugene Myazin avatar fiky avatar Jinwoo, Kim avatar Wuxiang Lin avatar Jeffrey Zhuang avatar ZhgChgLi avatar  avatar Yan Lucas avatar xq113 avatar Jorge Facundo Alegre avatar  avatar Rita Zerrizuela avatar An Tran avatar dwaragi avatar Michel Anderson Lütz Teixeira avatar Eduardo Bocato avatar Arpit Soni avatar Gabriel Marson avatar  avatar Shreesha avatar  avatar Skinnyy avatar ReverseScale avatar Ajith Renjala avatar KarimMetawea avatar Akinde-peters Joseph avatar Cole Dunsby avatar admin avatar He(Heva) Wu avatar Adam Zethraeus avatar Fedar Valiauka avatar avidrush94 avatar Gagan Singh avatar Kotaro Suto avatar Viktor Lund avatar Eric Zelermyer avatar  avatar Shuanglin avatar baird avatar

Watchers

 avatar arden avatar Kengi Chan avatar Ray Leyva avatar Toshihiro Morimoto avatar  avatar David Jacobs avatar Dave Lee avatar Roberto Gamboni avatar Ari Braginsky avatar weaksauce avatar Sunil S Nandihalli avatar jin avatar Kolin Krewinkel avatar Hiroaki Asai avatar evandrix avatar Sergey Buravtsov avatar Rodrigo Gutierrez avatar Jevin Sweval avatar Rakhmad Azhari avatar Phil Larson avatar Kwamena Appiah-Kubi avatar Jandy avatar Tony Tang avatar  avatar Yothin Samrandee avatar Option_Sky avatar Edward Ishaq avatar Wahyu Sumartha avatar  avatar Louis Zhu avatar Marco avatar senseb avatar Jouni Miettunen avatar Hirofumi Yoshikawa avatar Minh-Triet Pham Tran avatar Idris Raja avatar maksa avatar Yann avatar Danny Liu avatar Galex Yen avatar Sergey Vetrogonov avatar Ben Xu avatar HoNooD avatar Natansh Verma avatar  avatar Damien Bell avatar Matt Galloway avatar mosn avatar barty82 avatar  avatar Ariane avatar James Cloos avatar  avatar Siam Wannakosit avatar alexsun avatar Pin Shih Wang avatar Shengbin zhou avatar Greg P avatar PanZhow avatar 김원겸 avatar Ari Grant avatar Krister Kari avatar Griffin Schneider avatar Dimitar Lazarov avatar Derek avatar Aaron Kushner avatar Alex Wu avatar emen avatar curer avatar  avatar Chris B. Page avatar  avatar Rob Siwek avatar tomisacat avatar Rajat Agrawal avatar Xiaodong Jiang avatar ShFu avatar Wayne Zhang avatar Sun Xiaoting avatar zhuangyihang avatar Shalini Sah avatar  avatar PORNPASOK SOOKYEN avatar  avatar jay avatar  avatar  avatar Michael Anthony avatar Valeriy Van avatar 开水白菜 avatar Piet Groot Kormelink avatar  avatar  avatar  avatar  avatar fengxing avatar Abael He avatar Quanhua Guan avatar Xiaoze Yang avatar

chisel's Issues

got error at ' isMac = runtimeHelpers.isMacintoshArch()'

run any command, got this error
Traceback (most recent call last):
File "/usr/local/opt/chisel/libexec/fblldb.py", line 81, in runCommand
command.run(args, options)
File "/usr/local/Cellar/chisel/1.2.0/libexec/commands/FBPrintCommands.py", line 104, in run
isMac = runtimeHelpers.isMacintoshArch()
AttributeError: 'module' object has no attribute 'isMacintoshArch'

Install instructions from `brew` misses information

Installation misses instructions when installing from brew and, I guess, when you use python from OS X, not the one installed with brew. I had to manually add this command to ~/.lldbinit:

command script import /usr/local/Cellar/chisel/1.0.0/libexec/fblldb.py

while the instructions suggest that it is needed only when installing manually.

Ability to visualize colors

If I run visualize someColor, I get:

UIDeviceRGBColor isn't supported. You can visualize UIImage, CGImageRef, UIView, CALayer or NSData.

Chisel should generate a square or circular image of the color, optionally with some RGB/hex info included in the image, and open the image in Preview.

Can't install chisel

The command specified in the Readme does not work:

brew install chisel
Error: No available formula for chisel
Searching taps...
Error: 404 Not Found
Please report this bug:
https://github.com/mxcl/homebrew/wiki/troubleshooting
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:277:in open_http' /usr/local/Library/Homebrew/cmd/search.rb:98:invalue'
/usr/local/Library/Homebrew/cmd/search.rb:98:in search_taps' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:230:ininject'
/usr/local/Library/Homebrew/cmd/search.rb:95:in each' /usr/local/Library/Homebrew/cmd/search.rb:95:ininject'
/usr/local/Library/Homebrew/cmd/search.rb:95:in search_taps' /usr/local/Library/Homebrew/cmd/install.rb:54:ininstall'
/usr/local/Library/brew.rb:91:in `send'
/usr/local/Library/brew.rb:91

pvc doesn't work when running on 64-bit devices

When running on an iPhone 5s:

error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x10).
The process has been returned to the state before expression evaluation.
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x10).
The process has been returned to the state before expression evaluation.
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x10).
The process has been returned to the state before expression evaluation.
[Error getting description.]
   | [Error getting description.]
   |   | [Error getting description.]

When disabling the arm64 architecture, this works. It might an LLDB bug? http://stackoverflow.com/questions/11372232/strange-behaviours-with-stringwithformat-float

Tag new release and upgrade Homebrew formula

The Homebrew formula is still pointing at the 1.0.0 tag (and the sha b6cd385bb8ac66116de398e93cf0ab8b28955293, which I don't see in the repo). If everything is stable, I'd be more than happy to tag 1.0.1 and update the homebrew formula.

Really, I just want coworkers to be able to use my fvc --view command without manually installing chisel.

Many OS X features say that work break in OS X apps

Try testing this on an OS X application on a particular NSView you know the visual location of.

This is after the latest version of Chisel is loaded into LLDB

pro at -n Xcode 
hide 0x7fe500fd5660

The above works. But try the mask command

mask 0x7fe500fd5660
error: error: use of undeclared identifier 'UIWindow'
error: expected expression
error: use of undeclared identifier 'UIApplication'
error: expected ']'
note: to match this '['
error: 4 errors parsing expression
error: error: use of undeclared identifier 'UIView'
error: expected expression
error: use of undeclared identifier 'None'
error: expected ']'
note: to match this '['
error: 4 errors parsing expression
error: use of undeclared identifier 'None'
error: 1 errors parsing expression
error: error: use of undeclared identifier 'UIWindow'
error: expected expression
error: use of undeclared identifier 'UIApplication'
error: expected ']'
note: to match this '['
error: 4 errors parsing expression
error: error: use of undeclared identifier 'None'
error: 1 errors parsing expression
Traceback (most recent call last):
  File "/Users/derekselander/lldb/fblldb.py", line 81, in runCommand
    command.run(args, options)
  File "/Users/derekselander/lldb/commands/FBDisplayCommands.py", line 93, in run
    viewHelpers.maskView(viewOrLayer, options.color, options.alpha)
  File "/Users/derekselander/lldb/fblldbviewhelpers.py", line 24, in maskView
    origin = convertPoint(0, 0, viewOrLayer, window)
  File "/Users/derekselander/lldb/fblldbviewhelpers.py", line 47, in convertPoint

The border command that says is available in the README also doesn't work on OS X

border 0x7fe500fd5660
error: use of undeclared identifier 'UIColor'
error: 1 errors parsing expression

Seems like some of these commands are hardcoded for iOS only?

'import' is not a valid command

Executing command source ~/.lldbinit I get the following error:

error: Aborting reading of commands after command #0: 'command source /Users/justin/Developer/Tools/Chisel/fblldb.py' failed with error: Aborting reading of commands after command #9: 'import lldb' failed with error: 'import' is not a valid command.

Print NSData as text

I often get NSData representing UTF-8-encoded strings back from APIs. What I want essentially comes down to a shortcut for:

po [[NSString alloc] initWithData:(NSData *)self.mutableData encoding:NSUTF8StringEncoding

But it would need to coexist with the existing feature to print NSData representing an image. It might also be nice to have an option to copy the resulting text to the clipboard, or open it in $EDITOR or maybe even a configurable app (e.g. TextMate or CocoaJSONEditor).

Posting this here to get feedback on what kind of features/options people would want. Would you want other encodings besides UTF-8? How would the interface for that work? If there is interest and some consensus on the interface, I can probably submit a PR.

Mine painter crash

openeye.openmods.info/crashes/bba0c6fbe6cdcfab88360b36da8c4db8

mine painter, is most likely the problem but the mod author dose not seem to be responding to contact attempts with this bug from other people, it occurs when you try to take a "chip" out of one of the converted blocks from chisel. and now the world will not open.

sorry if this is the wrong place to post bugs, couldn't think of anywhere else better otherwise :)

-thx

PVC command error in Xcode 6.3 beta1

test on a simple iOS One View Application
error message as follows.

(lldb) pvc
error: error: use of undeclared identifier 'CGRect'
error: missing '[' at start of message send expression
error: expected ']'
note: to match this '['
error: 3 errors parsing expression
[Error getting description.]

(lldb) 

Issues running in Swift

I am getting errors because my expressions are running in Swift despite the evaluateExpressionValueInFrameLanguage function

Typical error statement:

error: expected ',' separator
(int)((BOOL)((unsigned long)CFGetTypeID((CFTypeRef)(shape)) == (unsigned long)CGImageGetTypeID()))

Is there something I'm missing here? I'm just calling visualize <value>

Installation issues

Hi!

The install instructions are not working as expected. I updated .lldbinit to include the following:

command source ~/chisel/fblldb.py
command alias pi print (int)

The second command being for debug purposes and works fine, chisel however does not. I also tried expanding the tilde to the full path but it didn't help. Any advice on what might be wrong with the installation?

Break out a libChisel

I mentioned this in a recent comment, but I'd like to get more feedback on this idea.

Many of the commands end up marshaling a bunch of expressions back and forth between LLDB's python interpreter and the target app, but this has proven to be slowish at times. For example the manual path pvc is a fair bit slower than the path that uses +[UIViewController _printHierarchy].

I believe there could be a solid usability and maintainability improvement if we divided the architecture into two halves:

  1. Code that interacts with LLDB's interfaces.
  2. Code that interacts with the app's objects and data.

I think we could bundle a dynamic library and have Chisel load that into the app via target modules addprocess load. This adds some complexity, but the benefits would be faster interaction & feedback with Chisel commands, and also I think this would smooth the path toward adding testing to the project. Plus not having to write objc encoded in python strings is an improvement.

cc @arigrant @mattjgalloway @mmmulani @dstnbrkr @KingOfBrian @kolinkrewinkel

Feature idea: commands for only breaking on or off main thread

It may not be that common, but I just had a case where I wanted to restrict a certain breakpoint to only the main thread. The breakpoint command has a -t flag, but the tid is not the simply the thread number, instead the tid needs to be looked up via thread list.

As for a command for breaking only when off the main thread, I don't know yet if the Python API would allow that.

'vs' command broken?

XCode prints this, anyone knows how to fix it?

Traceback (most recent call last):
File "/usr/local/Cellar/chisel/1.2.0/libexec/fblldb.py", line 81, in runCommand
command.run(args, options)
File "/usr/local/Cellar/chisel/1.2.0/libexec/commands/FBFlickerCommands.py", line 60, in run
walker = FlickerWalker(object)
File "/usr/local/Cellar/chisel/1.2.0/libexec/commands/FBFlickerCommands.py", line 67, in init
self.handler = inputHelpers.FBInputHandler(lldb.debugger, self.inputCallback)
File "/usr/local/Cellar/chisel/1.2.0/libexec/fblldbinputhelpers.py", line 16, in init
self.inputReader = lldb.SBInputReader()
AttributeError: 'module' object has no attribute 'SBInputReader'

Add command to enable writing to const types

@rohan-mehta seeded this idea. When a variable is const, lldb will respect that and prevent assignment to the variable. Perhaps we could add a chisel convenience command that does this for the user:

(lldb) e CGFloat *p = (CGFloat *)&constVariable; *p = 1.0

chisel only works fine once

I installed chisel correctly, and it work fine when i debug first time.
but when i run debugging again, chisel can not be loaded. So i have to restart the xcode to make it works again.

please tell me how to fix this?

the scripts works like this

//first time
(lldb) visualize someview

//second time
(lldb) visualize someview
error: 'visualize' is not a valid command.

Where to create .lldbinit file

Its specified in the documentation as

Alternatively, download chisel and add the following line to your ~/.lldbinit file. If it doesn't exist, create it.

I really don't know where to locate this .lldbinit file.

I downloaded .lldbinit file and placed it in my project folder like .gitignore but it dint work.

Sorry for this newbie question, but I really done know where to locate this or create and put this.

Issue with Visualize command with CGImageRef

Whenever I try the visualize a CGImageRef. I got the following error:

error: error: cannot initialize a parameter of type 'CGImage *' with an lvalue of type 'CGImageRef' (aka 'CGImage *')
error: 1 errors parsing expression
Traceback (most recent call last):
  File "/usr/local/opt/chisel/libexec/fblldb.py", line 81, in runCommand
    command.run(args, options)
  File "/usr/local/Cellar/chisel/1.2.0/libexec/commands/FBVisualizationCommands.py", line 138, in run
    _visualize(arguments[0])
  File "/usr/local/Cellar/chisel/1.2.0/libexec/commands/FBVisualizationCommands.py", line 109, in _visualize
    _showImage('(id)[UIImage imageWithCGImage:' + target + ']')
  File "/usr/local/Cellar/chisel/1.2.0/libexec/commands/FBVisualizationCommands.py", line 37, in _showImage
    imageBytesStartAddress = fb.evaluateExpression('(void *)[(id)' + imageDataAddress + ' bytes]')
TypeError: cannot concatenate 'str' and 'NoneType' objects

Using Xcode 6.3.2

AppCode compatibility?

Is this intended to work/already works in AppCode?

I've installed as per the instructions and have chisel commands (pviews, visualize, etc...) working in Xcode.

Issuing "help" in lldb within AppCode displays the chisel commands. However, I don't see any results in AppCode from issuing commands (pviews, visualize, etc...) . Other non-chisel commands, even 3rd party additions, work.

I generally assume issues like these are my own fault somehow, but it would be reassuring to know if these commands work for others within AppCode.

Thanks!

Add pjson command

@ilkera suggested we add a pjson command which would accept NSArray and NSDictionary and print their contents as JSON. It would also be good to accept an instance of NSString or NSData which represents URL encoded form data, and print that as JSON. The pjson command should also copy the results into the copy buffer as well.

Improve documentation

It would be nice to have a more comprehensive set of docs in the GitHub wiki (perhaps even just copy/pasted from help , initially). It's not clear from the README what all of these awesome commands can do!

bmessage breakpoints fail on methods defined in categories

I don't know if there was a recent change or regression to lldb, but in order to set breakpoints on methods defined in categories, the category needs to be included in the breakpoint name.

For example, setting a breakpoint on -setFrame: now has to be:

breakpoint set -n '-[UIView(Geometry) setFrame:]'

Currently, bmessage doesn't consider categories when creating the breakpoint and silently fails on methods defined in categories.

I don't know of anyway to find out the category from the objc runtime. If that's indeed not possible the two ways I fixes I can think of are:

  1. Use a regex breakpoint: br s -r '-\[UIView(\(.+\))? setFrame:\]'
  2. Scrape the category out of the symbol table: target modules dump symtab.

Any better ideas?

Create test suite

Let's build a test suite for Chisel. I'm thinking integration tests.

  • Build an app for the test harness.
  • Build test runner
  • Profit Write tests

Thoughts?

pviews output incorrectly

  • pviews
(lldb) pviews 0x177d6310
resize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x177d5b60>>
   | <UIView: 0x177d7190; frame = (0 84; 320 0.5); autoresize = RM+BM; layer = <CALayer: 0x177d6db0>>
  • po `-recursiveDescription`
    
(lldb) po [0x177d6310 recursiveDescription]
<HYSelectOneWayShipHeaderView: 0x177d6310; frame = (0 0; 320 85); autoresize = W+H; layer = <CALayer: 0x177d6440>>
   | <UILabel: 0x177d6610; frame = (10 38; 85 47); text = '2014-05-29'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x177d66c0>>
   | <UIButton: 0x177d66f0; frame = (0 0; 160 37); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x177d5880>>
   |    | <UIImageView: 0x177e18d0; frame = (21 13; 6 11); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x177e1950>>
   |    | <UIButtonLabel: 0x177dbc90; frame = (62 10; 42 17); text = '前一天'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x177dbd40>>
   | <UIButton: 0x1751f580; frame = (160 0; 160 37); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x1751f680>>
   |    | <UIImageView: 0x1751cfd0; frame = (136 13; 6 11); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x1751cf60>>
   |    | <UIButtonLabel: 0x177d84c0; frame = (57 10; 42 17); text = '后一天'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x177d8570>>
   | <UIView: 0x1751e760; frame = (160 0; 0.5 37); autoresize = RM+BM; layer = <CALayer: 0x1751e7c0>>
   | <UIView: 0x1751e690; frame = (0 36; 320 0.5); autoresize = RM+BM; layer = <CALayer: 0x1751e660>>
   | <UILabel: 0x1751e5b0; frame = (128 38; 85 47); text = '广州
番禺莲花山'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x1751e580>>
   | <UILabel: 0x1751e370; frame = (231 37; 85 47); text = '香港
港澳码头'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x1751e340>>
   | <UIImageView: 0x1751e180; frame = (215 57; 15 8); autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x1751e150>>
   | <UILabel: 0x177d7480; frame = (93 38; 40 47); text = '周四'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x177d5b60>>
   | <UIView: 0x177d7190; frame = (0 84; 320 0.5); autoresize = RM+BM; layer = <CALayer: 0x177d6db0>>

libobjc required

Found out that if an app isn't calling the objc runtime, then the objc runtime definitions required by Chisel aren't available and cause Chisel to give unfriendly errors. For example Ivar is needed by pivar and wivar, and without those, the error message is:

error: error: use of undeclared identifier 'Ivar'
error: 1 errors parsing expression
Traceback (most recent call last):
  File "/Users/kastiglione/.../chisel/fblldb.py", line 81, in runCommand
    command.run(args, options)
  File "/Users/kastiglione/.../chisel/commands/FBPrintCommands.py", line 244, in run
    printCommand = 'po' if ('@' in ivarTypeEncodingFirstChar) else 'p'
TypeError: argument of type 'NoneType' is not iterable

Doesn't seem to work for me

Followed install instructions. Relaunched Xcode. None of the chisel commands are recognized in the debugger window and neither are "po" and "p". Any ideas?

Removed .lldbinit file as well as chisel-master folder. Relaunched Xcode. "po" and "p" still unavailable. Any idea about how to get "po" and "p" back?

Thanks.

Doesn't work?

I followed all the instructions but it still can't recognize any chisel command. xcode6.3.2
what to do?

New Release?

What are the plans for doing a new release? there's been 50+ commits since 1.2 and some bug fixes so it seems we should do one soon.

Feature idea: playout command, like pviews but just for layout

A playout command might differ from pviews by:

  1. Don't show full -description, just show class name and frame. Perhaps an flag to allow inclusion of a given property, if present.
  2. Order the tree visually, top (minY) to bottom (maxY), left (minX) to right (maxX). Currently pviews shows things in breadth first of subview order (back-to-front) but this order can differ from visual order.
  3. Show frames converted to the given root view, so all origins can be compared without reference to the parent's frame.

Alternatively, could make pviews do these biddings via flags.

wivar not work

In my ViewController, I have

@interface ViewController ()
@property (nonatomic, strong) NSNumber *number;
@end

And in LLDB
wivar self _number

I change that number, but the program does not pause. Use Xcode Debugger -> Right click on variable -> Watch works

show{view,layer...} could not work, didi i miss something?

Xcode 5.01

There are so many warnings/errors:
First UIGraphicsBeginImageContextWithOptions not defined
Then tens of thousands context 0x0

showview self.view
Error [IRForTarget]: Call to a symbol-only function 'memset' that is not present in the target
error: warning: function 'UIGraphicsBeginImageContextWithOptions' has internal linkage but is not defined
note: used here
error: The expression could not be prepared to run in the target
Mar 11 11:37:57 shin-de-iMac.local App58ForIphone[4817] <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Mar 11 11:37:57 shin-de-iMac.local App58ForIphone[4817] <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

command 'mask' always get wrong

when I use mask self.view or mask (UIView *)self.view, get the following error code: 'error: error: no known method '-initWithFrame:'; cast the message send to the method's return type'

border <view> not working on osx

i have an NSView* view and i try to border it but i get this.
(lldb) border view
error: use of undeclared identifier 'UIColor'
error: 1 errors parsing expression

fb.evaluateIntegerExpression converting incorrectly to hex?

I'm working on getting a count of a method, and it returns a large number, 0x7fffffff (2147483647). The value 2147483647 is getting passed to int('2147483647', 16), which is not correct, it should be int ('2147483647', 10). Am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.