Hi

Context:

I am writing a JIT and need to register the frame information about
the generated program within the context of a larger C++ program
compiled with g++. Stack layout is like this:

       catch established by C++
       JITTED code generated dynamically
       JITTED code
       JITTED code calls a C++ routine
       C++ routine calls other C++ routines
       C++ routine makes a THROW

The throw must go past the JITTED code to the established C++ catch.

Problem.

The stack unwinder stops with END_OF_STACK at the Jitted code. Why?
Following the code with the debugger I see that the unwider looks
for the next frame using the structures established by the dynamic loader,
specifically in the function "__dl_iterate_phdr" in the file
"dl-iteratephdr.c" in the glibc.

So, this means:

1) I am cooked and what I want to do is impossible. This means I will probably
  get cooked at work for proposing something stupid like this :-)

2) There is an API or a way of adding at run time a routine to the lists
  of loaded objects in the same way as the dynamic loader does.

PLEEEEEEZE do not answer with:

"Just look at the code of the dynamic loader!"

because I have several megabytes of code to understand already!!!!!!!!!

I am so near the end that it would be a shame to stop now. My byte codes for the DWARF interpreter LOAD into the interpreter successfully, and they are executed
OK, what has costed me several weeks of efforts, wading through MBs of code
and missing/wrong specs.

I just would like to know a way of registering (and deregistering obviously)
code that starts at address X and is Y bytes long. JUst that.

Thanks in advance guys

jacob

Reply via email to