revision 1092:7c4ffe27e7b5
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1092:7c4ffe27e7b5 |
parent | 1091:186558374345 |
child | 1093:34faf227070e |
author | nkeynes |
date | Sun Dec 20 21:01:03 2009 +1000 (14 years ago) |
Fix 64-bit x86 disassembly
Add crash-report hook to SIGILL and SIGBUS
Add crash-report hook to SIGILL and SIGBUS
src/sh4/sh4x86.in | view | annotate | diff | log | ||
src/util.c | view | annotate | diff | log | ||
src/x86dasm/dis-buf.c | view | annotate | diff | log | ||
src/x86dasm/x86dasm.c | view | annotate | diff | log |
1.1 --- a/src/sh4/sh4x86.in Tue Dec 15 08:46:37 2009 +10001.2 +++ b/src/sh4/sh4x86.in Sun Dec 20 21:01:03 2009 +10001.3 @@ -163,13 +163,17 @@1.4 uint32_t source_pc = source_start;1.5 uint32_t source_end = source_pc;1.6 xlat_recovery_record_t source_recov_table = XLAT_RECOVERY_TABLE(code);1.7 - xlat_recovery_record_t source_recov_end = source_recov_table + XLAT_BLOCK_FOR_CODE(code)->recover_table_size;1.8 + xlat_recovery_record_t source_recov_end = source_recov_table + XLAT_BLOCK_FOR_CODE(code)->recover_table_size - 1;1.10 for( target_pc = target_start; target_pc < target_end; ) {1.11 uintptr_t pc2 = x86_disasm_instruction( target_pc, buf, sizeof(buf), op );1.12 - fprintf( out, "%c%08X: %-20s %-40s", (target_pc == (uintptr_t)native_pc ? '*' : ' '),1.13 - (unsigned int)target_pc, op, buf );1.14 -1.15 +#if SIZEOF_VOID_P == 81.16 + fprintf( out, "%c%016lx: %-30s %-40s", (target_pc == (uintptr_t)native_pc ? '*' : ' '),1.17 + target_pc, op, buf );1.18 +#else1.19 + fprintf( out, "%c%08x: %-30s %-40s", (target_pc == (uintptr_t)native_pc ? '*' : ' '),1.20 + target_pc, op, buf );1.21 +#endif1.22 if( source_recov_table < source_recov_end &&1.23 target_pc >= (target_start + source_recov_table->xlat_offset) ) {1.24 source_recov_table++;
2.1 --- a/src/util.c Tue Dec 15 08:46:37 2009 +10002.2 +++ b/src/util.c Sun Dec 20 21:01:03 2009 +10002.3 @@ -58,6 +58,8 @@2.4 sigemptyset(&sa.sa_mask);2.5 sa.sa_flags = SA_RESETHAND|SA_SIGINFO;2.6 sigaction( SIGSEGV, &sa, NULL );2.7 + sigaction( SIGILL, &sa, NULL );2.8 + sigaction( SIGBUS, &sa, NULL );2.9 }
3.1 --- a/src/x86dasm/dis-buf.c Tue Dec 15 08:46:37 2009 +10003.2 +++ b/src/x86dasm/dis-buf.c Sun Dec 20 21:01:03 2009 +10003.3 @@ -31,14 +31,8 @@3.4 struct disassemble_info *info;3.5 {3.6 unsigned int opb = info->octets_per_byte;3.7 - unsigned int end_addr_offset = length / opb;3.8 - unsigned int max_addr_offset = info->buffer_length / opb;3.9 - unsigned int octets = (memaddr - info->buffer_vma) * opb;3.10 + uintptr_t octets = memaddr * opb;3.12 - if (memaddr < info->buffer_vma3.13 - || memaddr - info->buffer_vma + end_addr_offset > max_addr_offset)3.14 - /* Out of bounds. Use EIO because GDB uses it. */3.15 - return EIO;3.16 memcpy (myaddr, info->buffer + octets, length);3.18 return 0;
4.1 --- a/src/x86dasm/x86dasm.c Tue Dec 15 08:46:37 2009 +10004.2 +++ b/src/x86dasm/x86dasm.c Sun Dec 20 21:01:03 2009 +10004.3 @@ -76,8 +76,6 @@4.4 #endif4.5 x86_disasm_info.endian = BFD_ENDIAN_LITTLE;4.6 x86_disasm_info.buffer = 0;4.7 - x86_disasm_info.buffer_vma = 0;4.8 - x86_disasm_info.buffer_length = -1;4.9 x86_disasm_info.print_address_func = x86_print_address;4.10 }
.