Chisel
is a collection of LLDB
commands to assist in the debugging of iOS apps.
[Installation • Commands • Custom Commands • Development Workflow Contributing • License]
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.
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.
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!
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.
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
- Start
LLDB
- Reach a breakpoint (or simply pause execution via the pause button in
Xcode
's debug bar orprocess interrupt
if attached directly) - Execute
command source ~/.lldbinit
in LLDB to source the commands - Run the command you are working on
- Modify the command
- Optionally run
script reload(modulename)
- Repeat steps 3-6 until the command becomes a source of happiness
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.
Chisel
is MIT-licensed. See LICENSE
.
chisel's People
Forkers
jamieomatthews karnlund cocoaplayground jkubicek dev-life sashka ashton-w rajeshvv simonhurst bencochran donjordano timpickles julioacarrettoni alistra ips-etorres marcadams patsluth clintron hugemango yulin724 jjsaccolo dmaxall syjiangrui octwu sammyzheng hariprasad-ka davidpsy slavic1 xuezouing kerasking mdeora 2bj lucker6666 huangzhiyong funky-monkey taoyufan mahaah n8gray markd2 nagyist neoremind devmario algal glym jestrada bitesher dstnbrkr sgl0v steamx suyashi5776 bredfield briantun aj4pb rayleyva yuanshankongmeng nicolastinkl alirezaershadi nirvana-icy chinesejian dvska levinkkk liyong03 hiediutley yangyangtl wanily charlschun hollylee kautaleksei speednoisemovement wjcwukong daansari antonyzhao martintsch emaxerrno aldocastro yhtsnda 20032334 myseven wentaozone payotte mrtom lihui7115 antmd wellcomez redbullhorns superboonie lvzongsheng barrycug jamala alexsosn liufeigit xingql ragopor bhargavg xfxj23 summermk creantan shadown tchernicum haikuswchisel's Issues
add parameter to take window or window level for pvc
pvc
only works in the key window. You should be able to specify the window or window level that you want to perform pvc on incase the problem view controller is on another window.
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'
Preview not show up
Nothing happen when i input "show self.view".
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'
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.
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
-
ProfitWrite tests
Thoughts?
The mask command breaks if the orientation is portrait upside down.
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
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>>
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.
Feature idea: playout command, like pviews but just for layout
A playout
command might differ from pviews
by:
- Don't show full
-description
, just show class name and frame. Perhaps an flag to allow inclusion of a given property, if present. - 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. - 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.
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
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.
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
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?
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.
Add target/action commands
As described in the Dancing in the Debugger — A Waltz with LLDB, it's straight forward to manually determine the targets/actions of a control. However, what was new to me in that article is the ability to use a 0
value UIControlEvents
, as a form of a wildcard.
I think there might be room for two commands: pactions
, and bactions
.
cc @arigrant
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.
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
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.
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
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
Doesn't work?
I followed all the instructions but it still can't recognize any chisel command. xcode6.3.2
what to do?
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:
- Use a regex breakpoint:
br s -r '-\[UIView(\(.+\))? setFrame:\]'
- Scrape the category out of the symbol table:
target modules dump symtab
.
Any better ideas?
Update homebrew formula
See #81
'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.
'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'
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:in
value'
/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:in
inject'
/usr/local/Library/Homebrew/cmd/search.rb:95:in each' /usr/local/Library/Homebrew/cmd/search.rb:95:in
inject'
/usr/local/Library/Homebrew/cmd/search.rb:95:in search_taps' /usr/local/Library/Homebrew/cmd/install.rb:54:in
install'
/usr/local/Library/brew.rb:91:in `send'
/usr/local/Library/brew.rb:91
Specify objc++ where necessary for Swift support
In #68 (comment) @moreindirection pointed out that in the context of Swift, many lldb commands called internally from Chisel commands need to be updated to explicitly specify the language as objc++
.
See #73
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!
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)
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
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?
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>
bmessage: Consult skip-prologue setting on x86
If the target.skip-prologue
setting is set to true
, then functionPreambleExpressionForSelf()
will return an invalid expression. When the prologue is skipped, the expression should be *(id*)($ebp+8)
.
cc @rohan-mehta
short option can't works well in command 'fvc'
full option can works well, bug if i use short option, it show nothing.
(lldb) fvc -n=viewcontroller
(lldb) fvc --name=viewcontroller
0x7fd01a90f310 ViewController
is autocompletion of variables/methods possible?
or is it a limitation of lldb?
like when i type "po s" i get "po self", but if i do "pview s" i get nothing.
Merge `show{view,layer,image,imageref}` into `visualize`
As suggested in #11
We should actually merge
show{view,layer,image,imageref}
intovisualize
which basically does an-isKindOfClass:
check and assume the else clause means imageref.
123456789
987654321
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.
Adding ComponentKit's debugging commands to Chisel
It would be nice to have something to print the components' hierarchy in Chisel.
Wouldn't
pcomponents
be better of
po [CKComponentHierarchyDebugHelper componentHierarchyDescription]
make all commands work with remote debug sessions
Commands such as visualize
and border
do not work when connected to a process running on a remote machine and connected through the gdb-remote
command through lldb
on the client machine.
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:
- Code that interacts with LLDB's interfaces.
- 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 add
process 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
Detect if debugging an iOS or Mac app and use NSView vs UIView appropriately.
I'm working on a lot of Mac stuff these days, and a lot of these commands shouldn't be that much different in implementation.
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.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.