This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Mark stub functions with $stub, skip them in runtime.Callers


It's been a long-standing problem in gccgo that the testing package
does not report the correct file/line information when using a method
like t.Error.  This is because the testing type uses an embedded type,
and methods like t.Error are actually inherited from the embedded
type.  This means that the method is a stub.  In the gc toolchain,
stubs are thunks that jump directly to the code and do not remain on
the stack.  In the gccgo toolchain, they do remain on the stack, which
means that code that calls runtime.Caller will see them in places
where the gc toolchain does not.

This patch fixes the problem by marking stub functions with $stub in
their name, and skipping $stub functions in runtime.Caller.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]