Crash Reporting For C++, .NET, Java, Mac OS X Applications

14
Crash Reporting For Desktop Applications How to automate crash reporting for C+ +, .NET, Java, and OS X applications. bugsplatsoftware.com/demo/

description

Overview for integrating BugSplat's user crash reporting service with your software application. Individual instructions for integrating with C++, .NET, Java, and Mac OS X applications. For more information visit http://www.bugsplatsoftware.com/resources/getting-started/

Transcript of Crash Reporting For C++, .NET, Java, Mac OS X Applications

Page 1: Crash Reporting For C++, .NET, Java, Mac OS X Applications

Crash Reporting For Desktop Applications

How to automate crash reporting for C++, .NET, Java, and OS X applications.

bugsplatsoftware.com/demo/

Page 2: Crash Reporting For C++, .NET, Java, Mac OS X Applications

–Paraphrased from Socrates

"I know that I know nothing….was only true before I integrated crash

reporting into my application!”

bugsplatsoftware.com/demo/

Page 3: Crash Reporting For C++, .NET, Java, Mac OS X Applications

• Crash reporting services integrate with software applications to track and record every crash experienced by a user.

• This allows developers to determine the quality of their application as used by their customer base.

• By capturing user crashes, developers and QA can evaluate the health of their application.

• Using this information it is possible to maximize the impact of development time and investment.

What is application crash reporting?

bugsplatsoftware.com/demo/

Page 4: Crash Reporting For C++, .NET, Java, Mac OS X Applications

How does crash reporting work?

bugsplatsoftware.com/demo/

Page 5: Crash Reporting For C++, .NET, Java, Mac OS X Applications

Preview desktop application crash reporting with a live online demo.

bugsplatsoftware.com/demo/

Page 6: Crash Reporting For C++, .NET, Java, Mac OS X Applications

Enabling your application with BugSplat technology:First, make sure you have completed the following checklist:

1. Register as a new BugSplat user.2. Validate your email address using the BugSplat welcome email that was sent to you when you registered. (If you don’t see the email, check your junk mail folder.)3. Login using your email address.4. Download and unzip the BugSplat software development kit for Microsoft Visual C++.

• Include "BugSplat.h".• Create an instance of MiniDmpSender following the example in myCrasher. TheMiniDmpSender constructor requires three parameters: BugSplat database, application name and version. The BugSplat database is created and selected on the Databases page. Typically, you will create a new database for each major release of your product. You supply application name and version to match your product release. These must be used when uploading symbol files for your application.• Link your application to "BugSplat.lib".• Add "BsSndRpt.exe", "BugSplat.dll", "BugSplatRC.dll" and the"DBGHELP.dll" provided to your applications installer.

bugsplatsoftware.com/demo/

How to integrate crash reporting with C++ Applications

Page 7: Crash Reporting For C++, .NET, Java, Mac OS X Applications

Note that you should modify your build settings so that symbol files are created for Release builds, e.g:

Note: that in order to get fully detailed call stacks and variable names for each crash on the BugSplat website, every time you build a release version of your application for distribution or internal testing, you should upload all .exe, .dll, and .pdb files for your product at on the Symbols Page. Better yet, use theSendPdbs application as part of your build process to automate symbol upload to BugSplat.

 

Test your application

The final step is to test your application by forcing a crash. Verify that the BugSplat dialog appears and that crashes are posted to your BugSplat account. Check that symbol names in the call stack are resolved correctly. If they aren’t, double check that the correct version of symbol files and all executables for your application have been uploaded on the Symbols Page.

bugsplatsoftware.com/demo/

How to integrate crash reporting with C++ Applications

Page 8: Crash Reporting For C++, .NET, Java, Mac OS X Applications

bugsplatsoftware.com/demo/

How to integrate crash reporting with .NET applications

Next: Enabling your application with BugSplat technology:

In a few simple steps your .NET application can be modified to provide full debug information on the BugSplat website when it crashes.

• Add a reference to ”BugSplatDotNet.Dll”.• Add a call to BugSplat.CrashReporter.Init and add the BugSplat exception handlers for the appropriate set of system exceptions. As shown in the myDotNetCrasher sample app, this takes just a few lines of code

The initialization call requires three parameters: BugSplat database, application name and version. You supply application name and version. The BugSplat database is created and selected on the Databases page. Typically, you will create a new database for each major release of your product.• Add ”BsSndRpt.exe”, ”BugSplatDotNet.dll”, and ”BugSplatRC.dll” to your applications installer• Edit ”BugSplatRC.dll” with VisualStudio if you wish to change the banner displayed when your application crashes.• Add symbolic debug information to your release build.

Note: In order to get symbolic stack reports, debug information (PDB files) need to be uploaded to the BugSplat website along with your application’s executable files.

First, make sure you have completed the following checklist:1. Register as a new BugSplat User.2. Login using your BugSplat User Id3. Download and unzip the BugSplat software development kit for .NET Applications.

To get a feel for the BugSplat service prior to enabling your application, feel free to experiment with the myDotNetCrasher sample application which is part of the BugSplat software development kit. You may also want to browse the .NET API documentation.

Page 9: Crash Reporting For C++, .NET, Java, Mac OS X Applications

bugsplatsoftware.com/demo/

Modify your build settings so that symbol files are created for Release builds, e.g:

How to integrate crash reporting with .NET applications

Page 10: Crash Reporting For C++, .NET, Java, Mac OS X Applications

bugsplatsoftware.com/demo/

Note: Remember that after each build, you should upload the new executable and pdb files. The myDotNetCrasher sample app uses a Visual Studio post build event to automate this step.

Finally, note that the Visual Studio debugger’s hosting process can interfere with BugSplat’s ability to resolve symbols; it should be disabled in your project’s debug settings when submitting crash reports that occur while debugging.

Test your application by forcing a crash, then verify that crashes are posted and symbol names are resolved.

How to integrate crash reporting with .NET applications

Page 11: Crash Reporting For C++, .NET, Java, Mac OS X Applications

bugsplatsoftware.com/demo/

How to integrate crash reporting with Java applications

Enabling your application with BugSplat technology:

First, make sure you have completed the following checklist:1. Register as a new BugSplat User.2. Download and unzip the BugSplat software development kit for Java Applications.

Creating crash reports using your own application

Add BugSplat to your application as follows:Add the BugSplat library to your CLASSPATH.Import the BugSplat exception

handler classcom.bugsplatsoftware.client.BugSplat.Add a call to BugSplat.Init as shown in the MyJavaCrasher sample code.

The initialization call requires three parameters: BugSplat database, application name and version. You supply application name and version. The BugSplat database is created and selected on the Versions page. Typically, you will create a new database for each major release of your product.

• Add a try-catch block in your application entry point (for example, in main).• To handle both runtime Exceptions and Errors, catch Throwable, construct an Exception object, and pass it to BugSplat.HandleException.

 

Page 12: Crash Reporting For C++, .NET, Java, Mac OS X Applications

bugsplatsoftware.com/demo/

Catching exceptions in Threads

If your application creates threads, you will want an exception report to be generated before the thread is terminated:

• Subclass the ThreadGroup class, and override the uncaughtException method:class MyThreadGroup extends ThreadGroup {• public MyThreadGroup(String s) {• super(s);• }• public void uncaughtException(Thread thread, Throwable throwable) {• BugSplat.HandleException(new Exception(throwable));• }• }•• Construct an instance of your ThreadGroup class.• Construct an instance of your Thread, providing your ThreadGroup instance in the constructor.• Start the thread.

 

Remember to test your application by forcing a crash, and verifying that crashes are posted a good call stack is created.

How to integrate crash reporting with Java applications

Page 13: Crash Reporting For C++, .NET, Java, Mac OS X Applications

bugsplatsoftware.com/demo/

How to integrate crash reporting with Mac OS X applications.

Enabling your application with BugSplat technology:

First, make sure you have completed the following checklist:1. Register as BugSplat user.2. Download and unzip the BugSplat software development kit for Mac OS X Cocoa Applications.

Creating defect reports using your own application

Add BugSplat to your application as follows:• Add the BugSplat.Framework to your Cocoa project.• Add a Copy Files build step to the Targets to embed the framework onto your application.• Import the BugSplat exception handler class: #import <BugSplat/BugSplat.h>.• Add BugSplat member to the interface for your application class: BugSplat* bugSplat;.• In the init method for your class, send the bugSplat object an initWithVendormessage as shown in the sample code above for MyCocoaCrasher.• Optionally, use these methods to set options:

setDescription - a description of your applicationaddAdditionalFiles - add a log file, system info, etc.setQuietMode - suppress all dialogs (for server applications)

Remember to test your application by forcing a crash, and verify that crashes are posted and a good call stack is created.

Page 14: Crash Reporting For C++, .NET, Java, Mac OS X Applications

bugsplatsoftware.com/demo/

Please contact us at [email protected] with any

questions or problems you have – we want to help integrate

crash reporting with your application!