123 #endif |
123 #endif |
124 decode_instructions(void* start_pv, void* end_pv, |
124 decode_instructions(void* start_pv, void* end_pv, |
125 event_callback_t event_callback_arg, void* event_stream_arg, |
125 event_callback_t event_callback_arg, void* event_stream_arg, |
126 printf_callback_t printf_callback_arg, void* printf_stream_arg, |
126 printf_callback_t printf_callback_arg, void* printf_stream_arg, |
127 const char* options) { |
127 const char* options) { |
128 decode_instructions_virtual((uintptr_t)start_pv, |
128 return decode_instructions_virtual((uintptr_t)start_pv, |
129 (uintptr_t)end_pv, |
129 (uintptr_t)end_pv, |
130 (unsigned char*)start_pv, |
130 (unsigned char*)start_pv, |
131 (uintptr_t)end_pv - (uintptr_t)start_pv, |
131 (uintptr_t)end_pv - (uintptr_t)start_pv, |
132 event_callback_arg, |
132 event_callback_arg, |
133 event_stream_arg, |
133 event_stream_arg, |
134 printf_callback_arg, |
134 printf_callback_arg, |
135 printf_stream_arg, |
135 printf_stream_arg, |
136 options, false); |
136 options, false); |
137 } |
137 } |
138 |
138 |
139 static void* decode(struct hsdis_app_data* app_data, const char* options) { |
139 static void* decode(struct hsdis_app_data* app_data, const char* options) { |
140 setup_app_data(app_data, options); |
140 setup_app_data(app_data, options); |
141 char buf[128]; |
141 char buf[128]; |
210 case dis_condbranch: type = "condbranch"; break; |
210 case dis_condbranch: type = "condbranch"; break; |
211 case dis_jsr: type = "jsr"; break; |
211 case dis_jsr: type = "jsr"; break; |
212 case dis_condjsr: type = "condjsr"; break; |
212 case dis_condjsr: type = "condjsr"; break; |
213 case dis_dref: type = "dref"; break; |
213 case dis_dref: type = "dref"; break; |
214 case dis_dref2: type = "dref2"; break; |
214 case dis_dref2: type = "dref2"; break; |
|
215 case dis_noninsn: type = "noninsn"; break; |
215 } |
216 } |
216 |
217 |
217 strcpy(buf, close); |
218 strcpy(buf, close); |
218 char* p = buf; |
219 char* p = buf; |
219 if (type) sprintf(p += strlen(p), " type='%s'", type); |
220 if (type) sprintf(p += strlen(p), " type='%s'", type); |