Giter Club home page Giter Club logo

happydebugging's People

Contributors

mrhappyasthma avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

happydebugging's Issues

Update the `result.Print()` statements to include a newline.

Pretty self explanatory, but to make the scripts more testable I was using SBResult Print(), which does not append a newline to the end of the command (where as the python print did).

Therefore you get in the scenario where:

Some command output goes here(lldb): // The output runs into the console input.

Add new command to implement `setFrame:` override on a UIView at runtime.

A common debugging flow I have is to override setFrame: in my custom subview and set a conditional breakpoint on some rogue frame value.

It's possible to add this override at runtime via: https://developer.apple.com/documentation/objectivec/1418901-class_addmethod?language=objc

Function would need to be something like:

void SetFrame(id self, SEL _cmd, CGRect frame) {
  struct objc_super mySuper = {
    .receiver = self,
    .super_class = [self superclass],
  };
  objc_msgSendSuper(&mySuper, _cmd, frame);
}

(Note: we would need to call sell.)

It is theoretically possible (hopefully) to set a symbolic breakpoint on that method after this happens.

Add a command to fake a low memory warning (even on device).

This could be faked using something like:

expr (void)[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)];

or

with delay:

expr (void)[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning) withObject:nil afterDelay:1.0]

Add support for Accessibility Debugging

There's a private protocol on NSObject with tools for printing out accessibility elements.

// Prints a recursive tree of accessibility elements

  • (NSString *)_accessibilityTreeAsString;

There's also _accessibilityTreeAsStringWithOptions:, but it's unclear what options it takes.

https://github.com/nst/iOS-Runtime-Headers/blob/master/lib/libobjc.A.dylib/NSObject.h#L1826

Some others:

// Prints the traits for the given parameter

  • (NSArray<NSString *> *)_accessibilityTraitsAsHumanReadableStrings:(UIAccessibilityTraits)traits;

// Prints the traits of the current object.

  • (NSArray<NSString *> *_accessibilityTraitsInspectorHumanReadable;

// Adds a trait to the current object.

  • (void)_accessibilityAddTrait:(UIAccessibilityTraits)trait;

// Prints out the accessibility ancestry of this object.

  • (NSArray<NSString *> *)_accessibilityAncestry;

Screenshot command fails on device

It creates a path to the local device's folder structure so the path cannot be opened from your mac using open.

Not sure this can easily be fixed.

Error when using `ivars` command.

For some reason, I am seeing "error: error: cannot initialize a parameter of type 'id _Nonnull const __unsafe_unretained' with an rvalue of type 'NSString *'" in some cases.

I need to investigate the root cause.

Add tests for `screenshot` and `png` command.

Both of these commands save a .png file as part of their output, so we need some way to assert that these actually save the right data into the png.

We could try just comparing the result byte-by-byte with the expected data.

Add a command to highlight a given element on screen.

This could either do something like outline it in red, or display a gradient over it temporarily to gain the users attention.

I've been using the screenshot command for this, but it might be nice to have it shown to you on the simulator live.

Error in `pframe` command.

Traceback (most recent call last):
File "/google/src/files/186825105/depot/google3/third_party/HappyDebugging/scripts/pframe.py", line 16, in pframe
if temp_result.GetOutput().strip() == 'NO':
AttributeError: 'NoneType' object has no attribute 'strip'

Recursively print superclass ivars for `ivars` commands.

This might become too spammy, so perhaps this should be optional or another command?

The class_copyIvarList docs mention explicitly "Any instance variables declared by superclasses are not included."

But this could be done with something like:

id object = <instance>;
while ([object != nil) {
  // Print out ivars and the name of the current class.
  // Print out newline.  

  object = [object superclass];
}

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.