1. A method for debugging a computer program, comprising: running at least part of said computer program on a computer, thereby prompting said computer to execute a sequence of instructions and to generate a trace corresponding to said executed sequence of instructions; and, when said program has generated an exception, selecting by said computer a set of one or more exception strings among one or more candidate strings wherein each candidate string is a substring of said trace by successively determining whether each of the candidate strings is unique in an order so that any first candidate string which is a substring of a second candidate string is examined for uniqueness only after determining that the second candidate string is unique, wherein the candidate strings are denoted, the candidate string starting with a I-th literal and ending with a J-th literal of said trace, wherein the order is defined by an outer loop over J from an initial value JMAX down to a final value JMIN and an inner loop over I from an initial value IMIN up to J, where I and J represent integers, so that each of said exception strings is a unique substring of said trace; and indicating said exception strings to a user or to a debugging tool.