Fragmentation in mass spectrometry is a feature, not a drawback. Determination of the molecular ion peak (M peak), while not always trivial (and sometimes the peak is not even present), is less important than determination of the structure of the compound.

Mass spectrometers allow this to be done quite easily and in a wonderful way: shooting electrons through the electron gun into the chamber containing the sample breaks chemical bonds in the sample. This creates ions of various molecular weights which are detected as the magnetic field is altered to put different masses of charged particles into the detector at different field strengths, generating a spectrum.

For example, a peak of weight 29 is characteristic of an ethyl group (2 carbons + 5 hydrogens = 24 + 5 = 29), rather than 30 as it is a cation (different from ethane in that it has one fewer hydrogen). This means that, somewhere on your molecule, there is an ethyl group, and how big the peak is tells you how much that fragment is being generated and therefore what its chemical environment is.

Another great application is looking at the M+1, M+2, and higher peaks. What's going on here, you ask? Ion fragments bigger than the original molecule? What is going on is you are seeing the fraction of the sample containing such atoms as carbon-13 (a carbon with one more neutron than carbon-12, the most common form). Why is this useful? You can find out from this about how many carbons, bromines, chlorines, and so forth are in the molecule by simple inspection of a small part of the mass spectrum, giving you a good start on compound identification. Just look at the relative size of the peaks, and compare them to a table of relative abundances of higher-mass isotopes of the elements which might be in the compound.

For a more elaborate explanation of the joys of mass spectrometers, I refer you to such books as Pavia et al's Introduction to Spectroscopy. Suffice it to say, though, that mass spectroscopy (itself a misnomer, as mass spectrometers aren't really spectrometers in the strictest sense of the word) is one of the most powerful tools available to modern chemists for compound identification, and, together with NMR, can provide a complete picture of pretty much any molecule.