How to insert dynamic code? (continued)

2006-07-13 Thread jacob navia
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

Re: How to insert dynamic code? (continued)

2006-07-13 Thread Andrew Haley
jacob navia writes: 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

Re: How to insert dynamic code? (continued)

2006-07-13 Thread jacob navia
Andrew Haley wrote: The way you do not reply to mails replying to your questions doesn't encourage people to help you. Please try harder to answer. I did answer last time but directly to the poster that replied, and forgot to CC the list. Excuse me for that. I suspect that the gcc

Re: How to insert dynamic code? (continued)

2006-07-13 Thread Daniel Jacobowitz
On Thu, Jul 13, 2006 at 05:06:25PM +0200, jacob navia wrote: So, what happens when _Unwind_Find_registered_FDE is called? Does it find the EH data you have registered? Yes but then it stops there instead of going upwards and finding the catch! It is as my insertion left the list of

Re: How to insert dynamic code? (continued)

2006-07-13 Thread jacob navia
Daniel Jacobowitz wrote: On Thu, Jul 13, 2006 at 05:06:25PM +0200, jacob navia wrote: So, what happens when _Unwind_Find_registered_FDE is called? Does it find the EH data you have registered? Yes but then it stops there instead of going upwards and finding the catch! It is as

Re: How to insert dynamic code? (continued)

2006-07-13 Thread Andrew Haley
jacob navia writes: Andrew Haley wrote: I suspect that the gcc unwinder is relying on __dl_iterate_phdr to scan the loaded libraries and isn't using the region that you have registered. But this is odd, becasue when I look at _Unwind_Find_FDE in unwind-dw2-fde-glibc.c, I see:

Re: How to insert dynamic code? (continued)

2006-07-13 Thread Mike Stump
On Jul 13, 2006, at 8:48 AM, jacob navia wrote: 1) I generate exactly the same code now as gcc: You don't want to generate exactly the same code as gcc, unless it is exactly the same case; you want to generate the correct code. Divide and concur. Do simple things work? For example, do:

Re: How to insert dynamic code? (continued)

2006-07-13 Thread Seongbae Park
On 7/13/06, jacob navia [EMAIL PROTECTED] wrote: Daniel Jacobowitz wrote: On Thu, Jul 13, 2006 at 05:06:25PM +0200, jacob navia wrote: So, what happens when _Unwind_Find_registered_FDE is called? Does it find the EH data you have registered? Yes but then it stops there instead of going

Re: How to insert dynamic code? (continued)

2006-07-13 Thread Daniel Jacobowitz
On Thu, Jul 13, 2006 at 11:21:04AM -0700, Seongbae Park wrote: The above code looks incorrect, for various reasons, not the least of which is that you're assuming CIE/FDE are fixed-length. There are various factors that affect FDE/CIE depending on PIC/non-PIC, C or C++, 32bit/64bit, etc -

Re: How to insert dynamic code? (continued)

2006-07-13 Thread jacob navia
Seongbae Park wrote: The above code looks incorrect, for various reasons, not the least of which is that you're assuming CIE/FDE are fixed-length. This is a trivial thing I will add later. There are various factors that affect FDE/CIE depending on PIC/non-PIC, C or C++, 32bit/64bit, etc -