Coder Social home page Coder Social logo

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, CIImage, CGColorRef or CVPixelBuffer 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 sunbohong avatar mattjgalloway avatar bartoszj avatar kolinkrewinkel avatar tecknut avatar dstnbrkr avatar amyreese avatar agisilaos avatar soniccat avatar aadsm avatar bencochran avatar alexch2000 avatar zats avatar samanthamjohn avatar jballer avatar arorajatin avatar aledista avatar a2 avatar zertosh avatar ashton-w avatar dmpv avatar eithanshavit avatar steven5538 avatar gkassabli avatar umdemir avatar simonwhitaker avatar

Stargazers

 avatar Daniel Cardona Rojas avatar Goudarz Jafari avatar Steffen Gorenflo avatar oooop avatar  avatar  avatar Landon Epps avatar  avatar Arne Küderle avatar Carsten Ganske avatar Liucw avatar Stanley avatar 柯烂 avatar  avatar  avatar Firdavs Khaydar avatar Hephorus Elian avatar  avatar zapata-ok avatar  avatar  avatar YoHan Cho avatar ZJ avatar T9F F4TT avatar 姚文强 avatar LiBr avatar kxdkxd avatar Jason Aylward avatar Tomioka avatar Ababil Hossain avatar  avatar  avatar Toufique Imam avatar Bayram Arslan avatar  avatar Jerod avatar Fallrainy avatar Eric Xu avatar Amir Zigangaraev avatar Adrien Freire avatar Paul Steinhilber avatar Leo avatar Soneé John avatar Igor Belov avatar Indigo Ochoa avatar heedahong avatar Ihor Obrizko avatar PPGame Group avatar Gaston Morixe avatar  avatar Songsong avatar Nikita Ratashnyuk avatar  avatar  avatar Anton Smolianin avatar JamLee avatar Antonio Alves avatar Lê Tiến Đạt avatar Dimitrios Kapetanios avatar  avatar 乘风 avatar Jason Lee avatar Shaposhnikoff avatar Dalton Claybrook avatar  avatar Alex wang avatar limdongjin avatar  avatar linksign avatar Teodora Plopeanu avatar Miul avatar Melike B avatar  avatar  avatar TouchWorld avatar  avatar sweetloser avatar Shin Xiahou avatar Dmitry Frishbuter avatar Go Takagi avatar Mosab Elagha avatar Collin avatar John Penning avatar shenxiaohai avatar ‎  avatar  avatar  avatar Sean Deaton avatar Jim Rea avatar Ethan avatar Koo Bonsung avatar Meteor_Z avatar  avatar Didar avatar  avatar JeongHee avatar Muller Helen avatar 王立权 avatar Maktub Zeng  avatar

Watchers

 avatar arden avatar Kengi Chan avatar Ray Leyva avatar Toshihiro Morimoto avatar  avatar David Jacobs avatar  avatar Roberto Gamboni avatar Ari Braginsky avatar Sunil S Nandihalli avatar jin avatar  avatar Hiroaki Asai avatar Sergey Buravtsov avatar Rodrigo Gutierrez avatar Rakhmad Azhari avatar Phil Larson avatar Kwamena Appiah-Kubi avatar Jarman Rogers 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 maksa avatar Yann avatar Danny Liu avatar Galex Yen avatar Sergey Vetrogonov avatar Ben Xu avatar HoNooD avatar Natansh Verma avatar donaldcao avatar Damien Bell avatar  avatar mosn avatar barty82 avatar  avatar Ariane avatar  avatar Siam Wannakosit avatar alexsun avatar Pin Shih Wang avatar Shengbin zhou avatar Greg P avatar ZHOUPanpan avatar 김원겸 avatar  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 simlay avatar  avatar Rob Siwek avatar tomisacat avatar Rajat Agrawal avatar Xiaodong Jiang avatar ShFu avatar Wayne Zhang avatar Sun Xiaoting avatar 吴铭 avatar zhuangyihang avatar Shalini Sah avatar  avatar PORNPASOK SOOKYEN avatar  avatar jay avatar  avatar  avatar Valeriy Van avatar 开水白菜 avatar Piet Groot Kormelink avatar  avatar  avatar  avatar  avatar fengxing avatar Quanhua Guan avatar Xiaoze Yang avatar Soufien avatar  avatar Eytan Biala avatar Farooq Mulla avatar Laine Taffin Altman avatar Berty avatar

chisel's Issues

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.

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

'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.

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.

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

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

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.

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.

'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'

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.

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!

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>>

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?

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.

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.

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'

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>

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

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'

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.

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) 

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!

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

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

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?

Doesn't work?

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

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?

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

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.

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?

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

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

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.

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.

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?

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.

  • 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.