opjitconv.h
Go to the documentation of this file.00001
00017 #ifndef OPJITCONV_H
00018 #define OPJITCONV_H
00019
00020 #define OP_JIT_CONV_OK 0
00021 #define OP_JIT_CONV_FAIL -1
00022 #define OP_JIT_CONV_NO_DUMPFILE 1
00023 #define OP_JIT_CONV_NO_ANON_SAMPLES 2
00024 #define OP_JIT_CONV_NO_MATCHING_ANON_SAMPLES 3
00025 #define OP_JIT_CONV_NO_JIT_RECS_IN_DUMPFILE 4
00026 #define OP_JIT_CONV_ALREADY_DONE 5
00027 #define OP_JIT_CONV_TMPDIR_NOT_REMOVED 6
00028
00029 #include "config.h"
00030 #include <stddef.h>
00031 #include <bfd.h>
00032 #include <sys/stat.h>
00033
00034 #include "op_list.h"
00035 #include "op_types.h"
00036
00037
00038
00039
00040
00041 struct jitentry {
00042
00043 struct jitentry * next;
00044
00045 unsigned long long vma;
00046
00047 void const * code;
00048
00049 int code_size;
00050
00051
00052 char * symbol_name;
00053
00054 int sym_name_malloced;
00055
00056 unsigned long long life_start;
00057
00058 unsigned long long life_end;
00059
00060
00061 asection * section;
00062 };
00063
00064 struct jitentry_debug_line {
00065 struct jitentry_debug_line * next;
00066 struct jr_code_debug_info const * data;
00067
00068 unsigned long long life_start;
00069
00070 unsigned long long life_end;
00071 void const * end;
00072 };
00073
00074 struct op_jitdump_info
00075 {
00076 void * dmp_file;
00077 struct stat dmp_file_stat;
00078 };
00079
00080 struct pathname
00081 {
00082 char * name;
00083 struct list_head neighbor;
00084 };
00085
00086 struct jitdump_deletion_candidate
00087 {
00088 char * name;
00089 struct list_head neighbor;
00090 };
00091
00092
00093 void create_arrays(void);
00094 int resolve_overlaps(unsigned long long start_time);
00095 void disambiguate_symbol_names(void);
00096
00097
00098 int parse_all(void const * start, void const * end,
00099 unsigned long long end_time);
00100
00101
00102 int op_jit_convert(struct op_jitdump_info file_info, char const * elffile,
00103 unsigned long long start_time, unsigned long long end_time);
00104
00105
00106 bfd * open_elf(char const * filename);
00107 int partition_sections(void);
00108 int fill_sections(void);
00109 asection * create_section(bfd * abfd, char const * section_name,
00110 size_t size, bfd_vma vma, flagword flags);
00111 int fill_section_content(bfd * abfd, asection * section,
00112 void const * b, file_ptr offset, size_t sz);
00113
00114
00115 int init_debug_line_info(bfd * abfd);
00116 int finalize_debug_line_info(bfd * abfd);
00117
00118
00119 extern enum bfd_architecture dump_bfd_arch;
00120 extern int dump_bfd_mach;
00121 extern char const * dump_bfd_target_name;
00122
00123
00124
00125
00126
00127
00128 extern struct jitentry * jitentry_list;
00129
00130 extern u32 entry_count;
00131
00132 extern struct jitentry_debug_line * jitentry_debug_line_list;
00133
00134 extern u32 max_entry_count;
00135
00136 extern struct jitentry ** entries_symbols_ascending;
00137
00138 extern struct jitentry ** entries_address_ascending;
00139
00140 extern asymbol ** syms;
00141
00142 extern bfd * cur_bfd;
00143
00144 extern int debug;
00145
00146
00147 #endif