PATCH to buildsym.c

Mark Mitchell mark@codesourcery.com
Wed Dec 1 15:31:00 GMT 1999


>>>>> "Stan" == Stan Shebs <shebs@cygnus.com> writes:

    Stan> If you point me at a gdb.{sum,log}, I could do a quick
    Stan> analysis.

OK, I'll forward this to you privately if I can't see it right off.
Thanks!

    Stan> Indeed it is clear; my question is whether we can get away
    Stan> with specifying a detail of the compiler output that has not
    Stan> been specified previously.  Your proposal is basically to
    Stan> require that compilers issue line notes in a specific order.
    Stan> While this is attractive for improving debug of inlined
    Stan> functions, it is still a change to the spec of the
    Stan> compiler/debugger interface, and it's a change to be more
    Stan> restrictive.  So we need to understand if there are any
    Stan> compatibility pitfalls.

We *already* specify this detail.  In particular, we specify that if a
compiler wants a debugger to show a particular line for a particular
instruction then it must emit a line note for that instruction and
*not* emit any line notes with higher numbered lines for that same
instruction.

We're changing the specification; on that I agree.  I'd just argue
that a) the old specification doesn't make much sense, and b) there
are no known examples of compilers purposefully using the old
specification (in particular, that emit line notes for lines that they
don't intend the instruction to correspond to, but only if the line
numbers are smaller than the correct line note.)

    Stan> Yeah, well, some versions of Sun's compiler have been
    Stan> notable for oddity of debug output.  The stabs manual
    Stan> mentions some amusing cases, although reassuringly, none of
    Stan> them involve line numbers.

I'm sure lots of compilers do lots of weird things!  (I know GCC
does...)

I guess I'm arguing that since we know that GCC wants to do this, and
since GDB is primarily used with GCC, and since we seem to agree that
the change (abstractly) makes sense, and since we don't actually know
that anything will be broken, that we should go for the change.

If someone complains, then we can back out the patch and try to change
GCC, we can make GDB do different things depending on a user-provided
flag, etc.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gdb mailing list