This is the mail archive of the gcc@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]

Questions regarding __register_frame_info


Hi

I have now everything in place for dynamically register the
debug frame information that my JIT (Just in time compiler)
generates.

I generate a CIE (Common information block), followed by
a series of FDE (Frame Description Entries) describing
each stack frame. The binary code is the same as gcc uses,
the contents of my stuff are identical to the contents of
the .eh_frame information.

There are several of those functions defined in unwind-dw2-fde.c:

__register_frame_info
__register_frame_info_bases
__register_frame_info_table_bases

If I use the
__register_frame_info
stuff, nothing happens and the program aborts.
Using __register_frame_jnfo_table_bases seems to
work better since it crashes a little bit further with a
hard crash.

Questions:

What is the procedure for registering the frame info?
I use following:

memset(&ob,0,sizeof(ob));
ob.pc_begin = (void *)-1;
ob.tbase = Parms.codebuf; // Machine instructions
ob.dbase = Parms.codebuf+myLccParms.text_size; // data of the program
ob.s.i = 0;
ob.s.b.encoding = 0xff; //DW_EH_PE_omit;
__register_frame_info_table_bases(Parms.pUnwindTables,&ob,ob.tbase,ob.dbase);


"ob" is an object defined as follows:
----------------------------------------------------------------------------------------
struct object {
         void *pc_begin;
          void *tbase;
          void *dbase;
          union {
           const struct dwarf_fde *single;
              struct dwarf_fde **array;
           struct fde_vector *sort;
             } u;

        union {
            struct {
                  unsigned long sorted : 1;
                 unsigned long from_array : 1;
               unsigned long mixed_encoding : 1;
             unsigned long encoding : 8;
                unsigned long count : 21;
    } b;
    size_t i;
   } s;
#ifdef DWARF2_OBJECT_END_PTR_EXTENSION
   char *fde_end;
#endif
    struct object *next;
};
------------------------------------------------------------------------------------------------
From the code of register_frame_info (in file unwind-dw2-fde.c)
that function just inserts the new data into a linked list, but it
does not do anything more. That is why probably it will never
work.

Could someone here explain me or tell me what to do exactly to register
the frame information?

This will be useful for all people that write JITs, for instance the Java people,
and many others.


Thanks in advance for your help, and thanks for the help this group
has provided me already

jacob



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