jax
jax

Reputation: 747

Unknown code showing in GDB step through

I was running GDB and while stepping through some simple C++ code, it started displaying the code below. Does anybody have any clues as to what this code is?

_Unwind_SjLj_Register (fc=0x28feac)
    at ../../../../src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c:126
126     ../../../../src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c: No such file or directory.
        in ../../../../src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c
(gdb) step
128     in ../../../../src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c
(gdb) step
131     in ../../../../src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c
(gdb) step
133     in ../../../../src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c

Upvotes: 1

Views: 414

Answers (2)

NPE
NPE

Reputation: 500377

From the source code (don't know if that's the exact version you're using, but should be close enough to get the idea):

//
// Called at start of each function that catches exceptions
//
EXPORT void _Unwind_SjLj_Register(struct _Unwind_FunctionContext* fc)
{
    fc->prev = __Unwind_SjLj_GetTopOfFunctionStack();
    __Unwind_SjLj_SetTopOfFunctionStack(fc);
}

Generally, there's quite a lot of stuff that happens in compiled C++ code under the hood. When you step through the code, you often encounter cryptically-named compiler-generated functions, library functions like the one you've come across, etc.

Upvotes: 3

Potatoswatter
Potatoswatter

Reputation: 137810

unwind usually denotes exception handling code, so it looks like you've instruction-stepped into a throw.

Upvotes: 0

Related Questions