Skip to main content

Posts

Showing posts with the label debugging

Programmatically stop Javascript execution in FireFox/FireBug

I am currently debugging complex Javascript/AJAX code written with mootools with FireBug. I am looking for a way to stop the JS execution as if it was a breakpoint programmatically. Ex: instructions ... degugger.breakpoint(); // the execution stops here as if a breakpoint was // manually set other instructions ... any idea? Source: Tips4all

Tiny PHP "standalone” server (or framework) for local debug without Apache/Nginx/Lighttpd/etc

There's manage.py runserver in Django or ruby script/server in Ruby on Rails — those familiar with one of those frameworks should already get the idea what I'm looking for. They run tiny "standalone" web server, which is perfectly enough to debug the application locally, without any need for other software (Apache/Nginx/Lighttpd/etc). I wonder is there any PHP implementation of such tool, or, maybe, some PHP framework has such feature? Surely, I can pack pre-built pre-configured static nginx executable, but this would not be pretty, and certainly not cross-platform. Having standalone debug webserver written in PHP itself will make the package self-contained. I.e. I'd like to type something like php tools/runserver.php , point browser to http://localhost:8000/ and see the site up and running, ready to debug. My Google-fu has failed me, but I strongly suspect that there is such project already. Source: Tips4all

Android: How to track down the origin of a InflateException?

While starting my application I get the following warning in Logcat: 04-09 10:28:17.830: WARN/WindowManager(52): Exception when adding starting window 04-09 10:28:17.830: WARN/WindowManager(52): android.view.InflateException: Binary XML file line #24: Error inflating class <unknown> 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.createView(LayoutInflater.java:513) 04-09 10:28:17.830: WARN/WindowManager(52): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.inflate(LayoutInflater.java:385) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.inflate(LayoutInflater

How to use MallocStackLogging on the device?

I've a memory issue in an iPhone app that I'd like to debug with MallocStackLogging . The error involves the gyroscope so I have to debug on the device not the simulator. I've set the MallocStackLogging environment variable and the iPhone properly records the mallock stack logs: MyApp(1856) malloc: recording malloc stacks to disk using standard recorder MyApp(1856) malloc: stack logs being written into /private/var/mobile/Applications/1FD1F8D2-5D30-4AA7-B426-C52FE20266DE/tmp/stack-logs.1856.MyApp.index MyApp(1856) malloc: Please issue: cp /private/var/mobile/Applications/1FD1F8D2-5D30-4AA7- B426-C52FE20266DE/tmp/stack-logs.1856.MyApp.e8z3IL.link /tmp/ Now how can I work with them? I can transfer them to the Mac using the Xcode Organizer. But what should I do with these two files? stack-logs.1856.MyApp.index stack-logs.1856.MyApp.e8z3IL.link I tried moving the files in /tmp on the Mac and called: $ malloc_history 1856 -all_events malloc_history cannot exa

Guard Malloc doesn"t work

I'm experimenting with different profiling options that Xcode provides, but when I enabling Guard Malloc option in Diagnostics tab and trying to run, I'm getting this error with immediate crash: dyld: could not load inserted library: /usr/lib/libgmalloc.dylib And it is right, /usr/lib/ doesn't contain this library. I've located it in: Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/lib/ So I've created link, and started Command Line Tool (just to be sure, because it apparently part of MacOS SDK), enabled Guard Malloc again but the problem remains. I don't quite get where is a problem: does it new Xcode 4.3 inadvertence, problem with my system or planned decision by Apple to replace it with something else (maybe Instruments )?

How can I hide long class paths in stack traces to make them readable?

Often stack traces can get so verbose from long class paths that they are very painful to read. Here's an example: 1) No implementation for java.util.Set< com.mydomain.myapp.android.activities.catbrowser.generalizedbrowser.listview. helpers.databaseitem.itemmanipulators.ItemManipulator< com.mydomain.myapp.flash.Cat>> annotated with @com.google.inject.assistedinject.Assisted(value=) was bound. while locating java.util.Set< com.mydomain.myapp.android.activities.catbrowser.generalizedbrowser.listview. helpers.databaseitem.itemmanipulators.ItemManipulator< com.mydomain.myapp.flash.Cat>> annotated with @com.google.inject.assistedinject.Assisted(value=) ... If I could trim the class path, only showing class names and methods, it would look like this: 1) No implementation for Set<ItemManipulator<Cat>> annotated with @Assisted(value=) was bound. while locating Set<ItemManipulator<Cat>> annotated with @Assisted(v

App crashing in cocos2d app on device when nothing happening

I have a somewhat simple game that I'm making and now that I'm testing what I consider a bare bone version of the app on devices, I keep getting crashes over and over. I'm fairly new at debugging on actual devices, so any help would be great. The really weird part is that it will usually crash when nothing is firing. No touches, no animations, nothing is happening. I've tried running Instruments to check for memory leaks. All I find are two objects that are both created in the menu scene. I'm changing scenes using Game *game = [Game nodeWithPlayers:arr Tutorial:NO]; [[CCDirector sharedDirector] replaceScene:game]; which sends some data (mainly # of players) to the Game scene. I put a comment in the dealloc of my menu scene and it fires, so I know that's happening. The two objects that are reported as memory leaks are my MenuManager object that helps w/ some menu animations and positions in the menu scene, and my SoundManager object which at the moment