We are pleased to find so many industry leading talents in one company. Our teams are already finding Wintellect’s offerings useful and productive.
– Bill Bowlus, Training Business Manager
MSTE COG, Microsoft
 
Course Offerings
ROI Calculator
Service Offerings
Service Offerings
Tutorials
Forums
FAQs
Articles
Books
Contests
Public Events
Newsletters
Tips
Bugslayer's Tips
Power Collections
Wintellog
Background
Photo Gallery
Press Center
Partners
Testimonals
Instructors

Newsletter
Every month, we share a little know how with registered folks through an email newsletter. Interested? Sign up today.


Poll
What is the oldest significant piece of code you have in a current application?

View Results

Newsletter
Wintellect News - December 2000 - Volume #1 Issue #3

Nothing But .NET
Looking for .NET developer training? Wintellect is now offering a full slate of .NET courses designed to get developers up to speed quickly on this emerging technology. With Beta 1 now available for downloading by the masses, there's no better time than the present to see what .NET is all about. Let us show you the way.

Learn How To Ship Better Code with Wintellect's John Robbins
Wintellect's John Robbins, author of Debugging Applications, a former engineer on NuMega's BoundsChecker, TrueTime, and TrueCoverage, and head of Wintellect's debugging business can help you debug your applications smarter and better. His five day Debugging Windows Applications will show you the same debugging secrets he uses to debug the toughest problems on the planet. His next public course is coming up in January and is one you don't want to miss. In his course, you'll get 40 hours of non-stop tricks and tips that you can apply immediately when you get back to work on Monday. Debug better, ship faster!

Strip Your Privates!
by John Robbins
Wait! Before you think I'm off my rocker and am insinuating something I shouldn't be talking about in a Wintellect newsletter, hear me out. The trouble with your privates is that they keep you from getting the most information about a crash at a customer site you can. While your mind might have been off in the gutter, I am talking about the private symbols in your PDB files. No one wants to distribute their PDB files with their application because they contain all the data structures and other information that will make reverse engineering your application much easier. Unfortunately, without the PDB files, Dr. Watson can't walk the stack nor get any symbol information so you are stuck with Dr. Watson logs that have essentially nothing in them. Fortunately, with a little help from Wintellect, you can now get full call stacks and symbols without giving away all your secrets in the process. If that's not having your cake and eating it too, I don't know what is!

All the magic to make your life easier comes from a little program called PRIVATESTRIP.EXE, which you can download it here. PRIVATESTRIP.EXE will produce a second set of PDB files for your binaries that contain nothing but the public symbols and Frame Pointer Omission (FPO) data necessary to walk the stack. You can give your customers the stripped PDB files and Dr. Watson will automatically use them. Of course, I am assuming that you are building your release builds with full debug symbols as I have recommended for years. If you are not building release builds with symbols you can learn what you need to do in my book Debugging Applications.

PRIVATESTRIP.EXE is a console application that has the following usage:

Usage: PrivateStrip -i <input path> -o <output path> <output path> [-r] [-?]
                           [-nologo]
  -i <input path>   - Path to binaries and associated PDB files
  -o<output path>   - The directory where stripped PDBs are written
  -r                - Recurse input path for all binaries
  -?                - Show online help
  -nologo           - Suppress program information

I wrote PRIVATESTRIP.EXE so that it could process a complete project at once instead of individual files so the input and output paths are mandatory. The input path is where you build your release build binaries. If you are building to multiple directories, the -r switch allows you to recursively get all your binaries. The output path is a little different. In order to allow you to keep the real PDB files with full symbolic information, PRIVATESTRIP.EXE writes the stripped PDB files to a different directory segregated by file extension. For example, if you pass -o D:\DEV\STRIPPED to PRIVATESTRIP.EXE for the output directory, the stripped PDB's for DLLs go in D:\DEV\STRIPPED\DLL and stripped PDB's for EXEs go in D:\DEV\STRIPPED\EXE. The PRIVATESTRIP.EXE download includes full source code so you can see exactly how everything works.

One thing to keep in mind about PRIVATESTRIP.EXE is that it uses the SplitSymbols IMAGEHLP.DLL function to do the work. Therefore, PRIVATESTRIP.EXE needs write access to the binaries it updates because SplitSymbols will update the file checksum and update the debug MISC directory. The only possible consequence of the debug MISC directory update is that the full path to the PDB file is overwritten with just the name of the PDB file. That just means to debug your release build, you will need have the full PDB file in the same directory as the binary, the default anyway, or in the %SYSTEMROOT%\Symbols\ directory.

Once you have your stripped PDB files, it's time to make them easy for your end users to work with. You should write an installation utility to install them on their machine as well as uninstall them. One other thing you should consider doing is determining exactly which system DLLs your program loads as well. If your customers are running Windows NT or Windows 2000, you can then get the symbols for each of the service packs and install just those DLLs you load. Ideally, you will create an installation kit for each service pack level. That way your users won't have to install the 250+ MB worth of symbols they don't need. While you might not want to go to the trouble of getting the Windows NT or Windows 2000 symbols on your end user's machines, having them will ensure you will get complete call stacks all the way back to BaseThreadStart and BaseProcessStart, which is as far back as you can go. If your end users are on WindowsMe/9x, you are out of luck, as Microsoft does not make the symbols available for that product.

The key to solving problems quickly in the field is getting all the information you need to identify the sources of crashes. With PRIVATESTRIP.EXE, you now have a way to get the best and most information-filled Dr. Watson logs possible, without giving away your company's secrets. All it takes is a little stripping!

TELL A COLLEAGUE
Other developers are welcome to receive these updates; if you know of anyone else interested, tell him or her to sign up online. http://www.wintellect.com/

 

 

 

Do you have what it takes to be a Wintellectual? -- Click here to play Who Wants to be a Wintellectual!

Devscovery -- $100 OFF -- Washington DC

Microsoft Certified Partner

Microsoft.NET CodeWise Community Member