Difference between revisions of "QEMU"

From MILEDROPEDIA
Jump to: navigation, search
m
m (added example gdb session)
Line 97: Line 97:
 
set debug arm on
 
set debug arm on
 
set debug arch 1
 
set debug arch 1
 +
</pre>
 +
 +
Here you can see example of my session:
 +
<pre>
 +
(gdb) show architecture
 +
The target architecture is set automatically (currently i386)
 +
(gdb) target remote localhost:1234
 +
Remote debugging using localhost:1234
 +
gdbarch_find_by_info: info.bfd_arch_info i386
 +
gdbarch_find_by_info: info.byte_order 1 (little)
 +
gdbarch_find_by_info: info.osabi 5 (GNU/Linux)
 +
gdbarch_find_by_info: info.abfd 0x0
 +
gdbarch_find_by_info: info.tdep_info 0x0
 +
gdbarch_find_by_info: Target rejected architecture
 +
gdbarch_update_p: Architecture not found
 +
warning: Architecture rejected target-supplied description
 +
0x00000000 in ?? ()
 +
1: x/4i $pc
 +
=> 0x0: add    BYTE PTR [eax],al
 +
  0x2: add    BYTE PTR [eax],al
 +
  0x4: add    BYTE PTR [eax],al
 +
  0x6: add    BYTE PTR [eax],al
 +
(gdb) show architecture
 +
The target architecture is set automatically (currently i386)
 +
(gdb) set architecture arm
 +
gdbarch_find_by_info: info.bfd_arch_info arm
 +
gdbarch_find_by_info: info.byte_order 1 (little)
 +
gdbarch_find_by_info: info.osabi 5 (GNU/Linux)
 +
gdbarch_find_by_info: info.abfd 0x0
 +
gdbarch_find_by_info: info.tdep_info 0x0
 +
gdbarch_find_by_info: New architecture 0x1ab8f880 (arm) selected
 +
gdbarch_dump: GDB_NM_FILE = config/nm-linux.h
 +
gdbarch_dump: addr_bit = 32
 +
gdbarch_dump: addr_bits_remove = <0x19972610>
 +
gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = 0
 +
gdbarch_dump: address_class_name_to_type_flags = <0x0>
 +
gdbarch_dump: gdbarch_address_class_type_flags_p() = 0
 +
gdbarch_dump: address_class_type_flags = <0x0>
 +
gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = 0
 +
gdbarch_dump: address_class_type_flags_to_name = <0x0>
 +
gdbarch_dump: address_to_pointer = <0x19b3c470>
 +
gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = 1
 +
gdbarch_dump: adjust_breakpoint_address = <0x1997b3f0>
 +
gdbarch_dump: auto_charset = <0x19b42300>
 +
gdbarch_dump: auto_wide_charset = <0x19b42340>
 +
gdbarch_dump: believe_pcc_promotion = 0
 +
gdbarch_dump: bfd_arch_info = arm
 +
gdbarch_dump: bits_big_endian = 0
 +
gdbarch_dump: breakpoint_from_pc = <0x1997b950>
 +
gdbarch_dump: byte_order = 1
 +
gdbarch_dump: byte_order_for_code = 1
 +
gdbarch_dump: call_dummy_location = 4
 +
gdbarch_dump: cannot_fetch_register = <0x19bbc3d0>
 +
gdbarch_dump: cannot_step_breakpoint = 0
 +
gdbarch_dump: cannot_store_register = <0x19bbc3d0>
 +
gdbarch_dump: char_signed = 0
 +
gdbarch_dump: coff_make_msymbol_special = <0x19972970>
 +
gdbarch_dump: convert_from_func_ptr_addr = <0x19bbc310>
 +
gdbarch_dump: convert_register_p = <0x19bbc500>
 +
gdbarch_dump: gdbarch_core_pid_to_str_p() = 0
 +
gdbarch_dump: core_pid_to_str = <0x0>
 +
gdbarch_dump: gdbarch_core_read_description_p() = 0
 +
gdbarch_dump: core_read_description = <0x0>
 +
gdbarch_dump: core_reg_section_encodes_pid = 0
 +
gdbarch_dump: core_regset_sections = 0x0
 +
gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = 0
 +
gdbarch_dump: core_xfer_shared_libraries = <0x0>
 +
gdbarch_dump: decr_pc_after_break = 0x0
 +
gdbarch_dump: deprecated_fp_regnum = 11
 +
gdbarch_dump: deprecated_function_start_offset = 0x0
 +
gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = 1
 +
gdbarch_dump: displaced_step_copy_insn = <0x19970c40>
 +
gdbarch_dump: gdbarch_displaced_step_fixup_p() = 1
 +
gdbarch_dump: displaced_step_fixup = <0x19980ee0>
 +
gdbarch_dump: displaced_step_free_closure = <0x19bbbf90>
 +
gdbarch_dump: displaced_step_hw_singlestep = <0x19bbbfe0>
 +
gdbarch_dump: displaced_step_location = <0x19bbc030>
 +
gdbarch_dump: double_bit = 64
 +
gdbarch_dump: double_format = floatformat_ieee_double_big
 +
gdbarch_dump: gdbarch_dummy_id_p() = 1
 +
gdbarch_dump: dummy_id = <0x199750c0>
 +
gdbarch_dump: dwarf2_reg_to_regnum = <0x199768a0>
 +
gdbarch_dump: ecoff_reg_to_regnum = <0x19bbc340>
 +
gdbarch_dump: elf_make_msymbol_special = <0x19972930>
 +
gdbarch_dump: fast_tracepoint_valid_at = <0x19bbd670>
 +
gdbarch_dump: gdbarch_fetch_pointer_argument_p() = 0
 +
gdbarch_dump: fetch_pointer_argument = <0x0>
 +
gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = 1
 +
gdbarch_dump: fetch_tls_load_module_address = <0x19a617c0>
 +
gdbarch_dump: float_bit = 32
 +
gdbarch_dump: float_format = floatformat_ieee_single_big
 +
gdbarch_dump: fp0_regnum = -1
 +
gdbarch_dump: gdbarch_frame_align_p() = 1
 +
gdbarch_dump: frame_align = <0x19972720>
 +
gdbarch_dump: frame_args_skip = 0x0
 +
gdbarch_dump: gdbarch_frame_num_args_p() = 0
 +
gdbarch_dump: frame_num_args = <0x0>
 +
gdbarch_dump: frame_red_zone_size = 0
 +
gdbarch_dump: gdbarch_gcore_bfd_target_p() = 0
 +
gdbarch_dump: gcore_bfd_target = (null)
 +
gdbarch_dump: gdbarch_get_longjmp_target_p() = 1
 +
gdbarch_dump: get_longjmp_target = <0x199770c0>
 +
gdbarch_dump: gdbarch_get_siginfo_type_p() = 1
 +
gdbarch_dump: get_siginfo_type = <0x199b56d0>
 +
gdbarch_dump: gdbarch_get_syscall_number_p() = 0
 +
gdbarch_dump: get_syscall_number = <0x0>
 +
gdbarch_dump: half_bit = 16
 +
gdbarch_dump: half_format = floatformat_ieee_half_big
 +
gdbarch_dump: has_dos_based_file_system = 0
 +
gdbarch_dump: has_global_breakpoints = 0
 +
gdbarch_dump: has_global_solist = 0
 +
gdbarch_dump: has_shared_address_space = <0x19bbd640>
 +
gdbarch_dump: have_nonsteppable_watchpoint = 0
 +
gdbarch_dump: in_function_epilogue_p = <0x19bbc210>
 +
gdbarch_dump: in_solib_return_trampoline = <0x19bbc1e0>
 +
gdbarch_dump: inner_than = <0x19bbc240>
 +
gdbarch_dump: int_bit = 32
 +
gdbarch_dump: gdbarch_integer_to_address_p() = 0
 +
gdbarch_dump: integer_to_address = <0x0>
 +
gdbarch_dump: long_bit = 32
 +
gdbarch_dump: long_double_bit = 64
 +
gdbarch_dump: long_double_format = floatformat_ieee_double_big
 +
gdbarch_dump: long_long_bit = 64
 +
gdbarch_dump: gdbarch_max_insn_length_p() = 1
 +
gdbarch_dump: max_insn_length = 32
 +
gdbarch_dump: memory_insert_breakpoint = <0x19bca210>
 +
gdbarch_dump: memory_remove_breakpoint = <0x19bca2e0>
 +
gdbarch_dump: num_pseudo_regs = 32
 +
gdbarch_dump: num_regs = 110
 +
gdbarch_dump: osabi = 5
 +
gdbarch_dump: gdbarch_overlay_update_p() = 0
 +
gdbarch_dump: overlay_update = <0x0>
 +
gdbarch_dump: pc_regnum = 15
 +
gdbarch_dump: pointer_to_address = <0x19b3c390>
 +
gdbarch_dump: gdbarch_print_float_info_p() = 0
 +
gdbarch_dump: print_float_info = <0x0>
 +
gdbarch_dump: print_insn = <0x1997b840>
 +
gdbarch_dump: print_registers_info = <0x19b88400>
 +
gdbarch_dump: gdbarch_print_vector_info_p() = 0
 +
gdbarch_dump: print_vector_info = <0x0>
 +
gdbarch_dump: gdbarch_process_record_p() = 0
 +
gdbarch_dump: process_record = <0x0>
 +
gdbarch_dump: gdbarch_process_record_signal_p() = 0
 +
gdbarch_dump: process_record_signal = <0x0>
 +
gdbarch_dump: ps_regnum = -1
 +
gdbarch_dump: gdbarch_pseudo_register_read_p() = 1
 +
gdbarch_dump: pseudo_register_read = <0x19976db0>
 +
gdbarch_dump: gdbarch_pseudo_register_write_p() = 1
 +
gdbarch_dump: pseudo_register_write = <0x19976a40>
 +
gdbarch_dump: ptr_bit = 32
 +
gdbarch_dump: gdbarch_push_dummy_call_p() = 1
 +
gdbarch_dump: push_dummy_call = <0x1997bed0>
 +
gdbarch_dump: gdbarch_push_dummy_code_p() = 0
 +
gdbarch_dump: push_dummy_code = <0x0>
 +
gdbarch_dump: gdbarch_read_pc_p() = 0
 +
gdbarch_dump: read_pc = <0x0>
 +
gdbarch_dump: gdbarch_record_special_symbol_p() = 1
 +
gdbarch_dump: record_special_symbol = <0x199793a0>
 +
gdbarch_dump: register_name = <0x19c6b3e0>
 +
gdbarch_dump: register_reggroup_p = <0x19c6cd30>
 +
gdbarch_dump: register_sim_regno = <0x19974e10>
 +
gdbarch_dump: register_to_value = <0x0>
 +
gdbarch_dump: gdbarch_register_type_p() = 1
 +
gdbarch_dump: register_type = <0x199782b0>
 +
gdbarch_dump: gdbarch_regset_from_core_section_p() = 1
 +
gdbarch_dump: regset_from_core_section = <0x199713b0>
 +
gdbarch_dump: gdbarch_relocate_instruction_p() = 0
 +
gdbarch_dump: relocate_instruction = <0x0>
 +
gdbarch_dump: remote_breakpoint_from_pc = <0x1997ba60>
 +
gdbarch_dump: remote_register_number = <0x19c6b3a0>
 +
gdbarch_dump: gdbarch_return_value_p() = 1
 +
gdbarch_dump: return_value = <0x19977770>
 +
gdbarch_dump: sdb_reg_to_regnum = <0x19bbc340>
 +
gdbarch_dump: short_bit = 16
 +
gdbarch_dump: gdbarch_single_step_through_delay_p() = 0
 +
gdbarch_dump: single_step_through_delay = <0x0>
 +
gdbarch_dump: gdbarch_skip_main_prologue_p() = 0
 +
gdbarch_dump: skip_main_prologue = <0x0>
 +
gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = 0
 +
gdbarch_dump: skip_permanent_breakpoint = <0x0>
 +
gdbarch_dump: skip_prologue = <0x1997baf0>
 +
gdbarch_dump: skip_solib_resolver = <0x19a59ec0>
 +
gdbarch_dump: skip_trampoline_code = <0x19952840>
 +
gdbarch_dump: smash_text_address = <0x19972670>
 +
gdbarch_dump: gdbarch_software_single_step_p() = 1
 +
gdbarch_dump: software_single_step = <0x199714d0>
 +
gdbarch_dump: sofun_address_maybe_missing = 0
 +
gdbarch_dump: solib_symbols_extension = (null)
 +
gdbarch_dump: sp_regnum = 13
 +
gdbarch_dump: stab_reg_to_regnum = <0x19bbc340>
 +
gdbarch_dump: stabs_argument_has_addr = <0x19bbc530>
 +
gdbarch_dump: gdbarch_static_transform_name_p() = 0
 +
gdbarch_dump: static_transform_name = <0x0>
 +
gdbarch_dump: target_desc = 0x1ab7f178
 +
gdbarch_dump: target_signal_from_host = <0x19bdcb90>
 +
gdbarch_dump: target_signal_to_host = <0x19bdcb60>
 +
gdbarch_dump: gdbarch_unwind_pc_p() = 1
 +
gdbarch_dump: unwind_pc = <0x199751b0>
 +
gdbarch_dump: gdbarch_unwind_sp_p() = 1
 +
gdbarch_dump: unwind_sp = <0x19975160>
 +
gdbarch_dump: value_from_register = <0x19b3c650>
 +
gdbarch_dump: value_to_register = <0x0>
 +
gdbarch_dump: vbit_in_delta = 1
 +
gdbarch_dump: virtual_frame_pointer = <0x19bbc400>
 +
gdbarch_dump: vtable_function_descriptors = 0
 +
gdbarch_dump: gdbarch_write_pc_p() = 1
 +
gdbarch_dump: write_pc = <0x1997be00>
 +
arm_dump_tdep: Lowest pc = 0x8000gdbarch_update_p: New architecture 0x1ab8f880 (arm) selected
 +
The target architecture is assumed to be arm
 +
(gdb) i prog
 +
Debugging a target over a serial line.
 +
Program stopped at 0x0.
 +
It stopped with signal SIGTRAP, Trace/breakpoint trap.
 +
(gdb) si
 +
Prologue scan stopped at 0xfffffff8
 +
Prologue scan stopped at 0xfffffff8
 +
0x400148c0 in ?? ()
 +
1: x/4i $pc
 +
=> 0x400148c0: ldr r0, [pc, #148] ; 0x4001495c
 +
  0x400148c4: ldr r0, [r0]
 +
  0x400148c8: lsr r0, r0, #8
 +
  0x400148cc: and r0, r0, #7
 +
(gdb) si
 +
Prologue scan stopped at 0xfffffff8
 +
0x400148c4 in ?? ()
 +
1: x/4i $pc
 +
=> 0x400148c4: ldr r0, [r0]
 +
  0x400148c8: lsr r0, r0, #8
 +
  0x400148cc: and r0, r0, #7
 +
  0x400148d0: cmp r0, #3
 +
(gdb) i r
 +
r0            0x480022f0 1207968496
 +
r1            0x0 0
 +
r2            0x0 0
 +
r3            0x0 0
 +
r4            0x0 0
 +
r5            0x0 0
 +
r6            0x0 0
 +
r7            0x0 0
 +
r8            0x0 0
 +
r9            0x0 0
 +
r10            0x0 0
 +
r11            0x0 0
 +
r12            0x0 0
 +
sp            0x0 0x0
 +
lr            0x0 0
 +
pc            0x400148c4 0x400148c4
 +
cpsr          0x400001d3 1073742291
 +
(gdb) si
 +
Prologue scan stopped at 0xfffffff8
 +
0x400148c8 in ?? ()
 +
1: x/4i $pc
 +
=> 0x400148c8: lsr r0, r0, #8
 +
  0x400148cc: and r0, r0, #7
 +
  0x400148d0: cmp r0, #3
 +
  0x400148d4: bne 0x400148f0
 +
(gdb) si
 +
Prologue scan stopped at 0xfffffff8
 +
0x400148cc in ?? ()
 +
1: x/4i $pc
 +
=> 0x400148cc: and r0, r0, #7
 +
  0x400148d0: cmp r0, #3
 +
  0x400148d4: bne 0x400148f0
 +
  0x400148d8: ldr r0, [pc, #124] ; 0x4001495c
 +
(gdb) si
 +
Prologue scan stopped at 0xfffffff8
 +
0x400148d0 in ?? ()
 +
1: x/4i $pc
 +
=> 0x400148d0: cmp r0, #3
 +
  0x400148d4: bne 0x400148f0
 +
  0x400148d8: ldr r0, [pc, #124] ; 0x4001495c
 +
  0x400148dc: ldr r0, [r0]
 +
(gdb) si
 +
Prologue scan stopped at 0xfffffff8
 +
0x400148d4 in ?? ()
 +
1: x/4i $pc
 +
=> 0x400148d4: bne 0x400148f0
 +
  0x400148d8: ldr r0, [pc, #124] ; 0x4001495c
 +
  0x400148dc: ldr r0, [r0]
 +
  0x400148e0: mov r6, r0
 +
(gdb) si
 +
Prologue scan stopped at 0xfffffff8
 +
0x400148d8 in ?? ()
 +
1: x/4i $pc
 +
=> 0x400148d8: ldr r0, [pc, #124] ; 0x4001495c
 +
  0x400148dc: ldr r0, [r0]
 +
  0x400148e0: mov r6, r0
 +
  0x400148e4: and r0, r0, #31
 +
(gdb) i r
 +
r0            0x3 3
 +
r1            0x0 0
 +
r2            0x0 0
 +
r3            0x0 0
 +
r4            0x0 0
 +
r5            0x0 0
 +
r6            0x0 0
 +
r7            0x0 0
 +
r8            0x0 0
 +
r9            0x0 0
 +
r10            0x0 0
 +
r11            0x0 0
 +
r12            0x0 0
 +
sp            0x0 0x0
 +
lr            0x0 0
 +
pc            0x400148d8 0x400148d8
 +
cpsr          0x600001d3 1610613203
 +
(gdb)
 
</pre>
 
</pre>

Revision as of 05:17, 17 February 2011

Install

Download sources from (link will be later) Build them : ./configure --target-list=arm;make;make install

Use case

You can use loading your custom bootrom from file by using parameters: -bios and -L dir. They let choose bios (bootrom) name and path Because we need ARM, we need use name "bootrom.bin" as bios name, and it must be valid 32K file

Also, if something goes wrong, for example:

qemu: fatal: Trying to execute code outside RAM or ROM at 0x00014748
 
R00=0001b860 R01=4020fcb0 R02=0000002c R03=00014748
R04=00014000 R05=00000000 R06=0000030f R07=4001b82f
R08=00000000 R09=00000000 R10=4001b840 R11=4001b860
R12=00000000 R13=4020fcac R14=40014724 R15=00014748
PSR=400001d3 -Z-- A svc32

you can enable tracing in qemu by enabling option "-d cpu,exec,in_asm" - it create trace log in /tmp/qemu.log, for example:

----------------
IN: 
0x40014708:  ea000000      b    0x40014710
 
R00=00c51878 R01=00000001 R02=00000000 R03=00000000
R04=00014000 R05=00000000 R06=0000030f R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=4020fcac R14=40014904 R15=40014710
PSR=600001d3 -ZC- A svc32
----------------
IN: 
0x40014710:  e28f0028      add  r0, pc, #40     ; 0x28
0x40014714:  e8900c00      ldm  r0, {sl, fp}
0x40014718:  e08aa000      add  sl, sl, r0
0x4001471c:  e08bb000      add  fp, fp, r0
0x40014720:  e24a7001      sub  r7, sl, #1      ; 0x1
0x40014724:  e15a000b      cmp  sl, fp
0x40014728:  0a000164      beq  0x40014cc0
 
R00=40014740 R01=00000001 R02=00000000 R03=00000000
R04=00014000 R05=00000000 R06=0000030f R07=4001b82f
R08=00000000 R09=00000000 R10=4001b830 R11=4001b860
R12=00000000 R13=4020fcac R14=40014904 R15=4001472c
PSR=800001d3 N--- A svc32
----------------

Such log can help you find the place of error (or in qemu or in running image)

so, for example you can run qemu:

qemu-system-arm -M n900 -m 256 -L . -bios bootrom.bin -mtdblock mbmloader-1.raw -d in_asm,cpu,exec -nographic


Debugging

Also it is possible use qemu for debugging purposes: you need only two options for that: -s and -S

  • -s option run qemu in gdbserver mode at localhost port 1234
  • -S stop execution when debugging start

for example:

qemu-system-arm -M n900 -m 256 -L . -bios bootrom.bin -mtdblock mbmloader-1.raw -d in_asm,cpu,exec -s -S -nographic

And now we can connect with gdb or any its frontend to localhost:1234 and start debuging process:

(gdb) target remote localhost:1234
(gdb) set architecture arm

Useful commands:

  • "x/i $pc" - enable printing each executed instruction
  • "si" - step one machine instruction (enter inside each function)
  • "ni" - step one machine instruction (without entering functions)
  • "c" - continue execution
  • "bt" - backtrace - show stack
  • "i p" - show current state of the program
  • "i r" - show all registers
  • "p $eax" - show content of eax register (can be used with any register/variable)

My ~/.gdbinit file:

python
import sys
sys.path.insert(0, '/home/xvilka/gdb/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
set history save on
set disassembly-flavor intel
display/4i $pc
set debug arm on
set debug arch 1

Here you can see example of my session:

(gdb) show architecture
The target architecture is set automatically (currently i386)
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
gdbarch_find_by_info: info.bfd_arch_info i386
gdbarch_find_by_info: info.byte_order 1 (little)
gdbarch_find_by_info: info.osabi 5 (GNU/Linux)
gdbarch_find_by_info: info.abfd 0x0
gdbarch_find_by_info: info.tdep_info 0x0
gdbarch_find_by_info: Target rejected architecture
gdbarch_update_p: Architecture not found
warning: Architecture rejected target-supplied description
0x00000000 in ?? ()
1: x/4i $pc
=> 0x0:	add    BYTE PTR [eax],al
   0x2:	add    BYTE PTR [eax],al
   0x4:	add    BYTE PTR [eax],al
   0x6:	add    BYTE PTR [eax],al
(gdb) show architecture
The target architecture is set automatically (currently i386)
(gdb) set architecture arm
gdbarch_find_by_info: info.bfd_arch_info arm
gdbarch_find_by_info: info.byte_order 1 (little)
gdbarch_find_by_info: info.osabi 5 (GNU/Linux)
gdbarch_find_by_info: info.abfd 0x0
gdbarch_find_by_info: info.tdep_info 0x0
gdbarch_find_by_info: New architecture 0x1ab8f880 (arm) selected
gdbarch_dump: GDB_NM_FILE = config/nm-linux.h
gdbarch_dump: addr_bit = 32
gdbarch_dump: addr_bits_remove = <0x19972610>
gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = 0
gdbarch_dump: address_class_name_to_type_flags = <0x0>
gdbarch_dump: gdbarch_address_class_type_flags_p() = 0
gdbarch_dump: address_class_type_flags = <0x0>
gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = 0
gdbarch_dump: address_class_type_flags_to_name = <0x0>
gdbarch_dump: address_to_pointer = <0x19b3c470>
gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = 1
gdbarch_dump: adjust_breakpoint_address = <0x1997b3f0>
gdbarch_dump: auto_charset = <0x19b42300>
gdbarch_dump: auto_wide_charset = <0x19b42340>
gdbarch_dump: believe_pcc_promotion = 0
gdbarch_dump: bfd_arch_info = arm
gdbarch_dump: bits_big_endian = 0
gdbarch_dump: breakpoint_from_pc = <0x1997b950>
gdbarch_dump: byte_order = 1
gdbarch_dump: byte_order_for_code = 1
gdbarch_dump: call_dummy_location = 4
gdbarch_dump: cannot_fetch_register = <0x19bbc3d0>
gdbarch_dump: cannot_step_breakpoint = 0
gdbarch_dump: cannot_store_register = <0x19bbc3d0>
gdbarch_dump: char_signed = 0
gdbarch_dump: coff_make_msymbol_special = <0x19972970>
gdbarch_dump: convert_from_func_ptr_addr = <0x19bbc310>
gdbarch_dump: convert_register_p = <0x19bbc500>
gdbarch_dump: gdbarch_core_pid_to_str_p() = 0
gdbarch_dump: core_pid_to_str = <0x0>
gdbarch_dump: gdbarch_core_read_description_p() = 0
gdbarch_dump: core_read_description = <0x0>
gdbarch_dump: core_reg_section_encodes_pid = 0
gdbarch_dump: core_regset_sections = 0x0
gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = 0
gdbarch_dump: core_xfer_shared_libraries = <0x0>
gdbarch_dump: decr_pc_after_break = 0x0
gdbarch_dump: deprecated_fp_regnum = 11
gdbarch_dump: deprecated_function_start_offset = 0x0
gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = 1
gdbarch_dump: displaced_step_copy_insn = <0x19970c40>
gdbarch_dump: gdbarch_displaced_step_fixup_p() = 1
gdbarch_dump: displaced_step_fixup = <0x19980ee0>
gdbarch_dump: displaced_step_free_closure = <0x19bbbf90>
gdbarch_dump: displaced_step_hw_singlestep = <0x19bbbfe0>
gdbarch_dump: displaced_step_location = <0x19bbc030>
gdbarch_dump: double_bit = 64
gdbarch_dump: double_format = floatformat_ieee_double_big
gdbarch_dump: gdbarch_dummy_id_p() = 1
gdbarch_dump: dummy_id = <0x199750c0>
gdbarch_dump: dwarf2_reg_to_regnum = <0x199768a0>
gdbarch_dump: ecoff_reg_to_regnum = <0x19bbc340>
gdbarch_dump: elf_make_msymbol_special = <0x19972930>
gdbarch_dump: fast_tracepoint_valid_at = <0x19bbd670>
gdbarch_dump: gdbarch_fetch_pointer_argument_p() = 0
gdbarch_dump: fetch_pointer_argument = <0x0>
gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = 1
gdbarch_dump: fetch_tls_load_module_address = <0x19a617c0>
gdbarch_dump: float_bit = 32
gdbarch_dump: float_format = floatformat_ieee_single_big
gdbarch_dump: fp0_regnum = -1
gdbarch_dump: gdbarch_frame_align_p() = 1
gdbarch_dump: frame_align = <0x19972720>
gdbarch_dump: frame_args_skip = 0x0
gdbarch_dump: gdbarch_frame_num_args_p() = 0
gdbarch_dump: frame_num_args = <0x0>
gdbarch_dump: frame_red_zone_size = 0
gdbarch_dump: gdbarch_gcore_bfd_target_p() = 0
gdbarch_dump: gcore_bfd_target = (null)
gdbarch_dump: gdbarch_get_longjmp_target_p() = 1
gdbarch_dump: get_longjmp_target = <0x199770c0>
gdbarch_dump: gdbarch_get_siginfo_type_p() = 1
gdbarch_dump: get_siginfo_type = <0x199b56d0>
gdbarch_dump: gdbarch_get_syscall_number_p() = 0
gdbarch_dump: get_syscall_number = <0x0>
gdbarch_dump: half_bit = 16
gdbarch_dump: half_format = floatformat_ieee_half_big
gdbarch_dump: has_dos_based_file_system = 0
gdbarch_dump: has_global_breakpoints = 0
gdbarch_dump: has_global_solist = 0
gdbarch_dump: has_shared_address_space = <0x19bbd640>
gdbarch_dump: have_nonsteppable_watchpoint = 0
gdbarch_dump: in_function_epilogue_p = <0x19bbc210>
gdbarch_dump: in_solib_return_trampoline = <0x19bbc1e0>
gdbarch_dump: inner_than = <0x19bbc240>
gdbarch_dump: int_bit = 32
gdbarch_dump: gdbarch_integer_to_address_p() = 0
gdbarch_dump: integer_to_address = <0x0>
gdbarch_dump: long_bit = 32
gdbarch_dump: long_double_bit = 64
gdbarch_dump: long_double_format = floatformat_ieee_double_big
gdbarch_dump: long_long_bit = 64
gdbarch_dump: gdbarch_max_insn_length_p() = 1
gdbarch_dump: max_insn_length = 32
gdbarch_dump: memory_insert_breakpoint = <0x19bca210>
gdbarch_dump: memory_remove_breakpoint = <0x19bca2e0>
gdbarch_dump: num_pseudo_regs = 32
gdbarch_dump: num_regs = 110
gdbarch_dump: osabi = 5
gdbarch_dump: gdbarch_overlay_update_p() = 0
gdbarch_dump: overlay_update = <0x0>
gdbarch_dump: pc_regnum = 15
gdbarch_dump: pointer_to_address = <0x19b3c390>
gdbarch_dump: gdbarch_print_float_info_p() = 0
gdbarch_dump: print_float_info = <0x0>
gdbarch_dump: print_insn = <0x1997b840>
gdbarch_dump: print_registers_info = <0x19b88400>
gdbarch_dump: gdbarch_print_vector_info_p() = 0
gdbarch_dump: print_vector_info = <0x0>
gdbarch_dump: gdbarch_process_record_p() = 0
gdbarch_dump: process_record = <0x0>
gdbarch_dump: gdbarch_process_record_signal_p() = 0
gdbarch_dump: process_record_signal = <0x0>
gdbarch_dump: ps_regnum = -1
gdbarch_dump: gdbarch_pseudo_register_read_p() = 1
gdbarch_dump: pseudo_register_read = <0x19976db0>
gdbarch_dump: gdbarch_pseudo_register_write_p() = 1
gdbarch_dump: pseudo_register_write = <0x19976a40>
gdbarch_dump: ptr_bit = 32
gdbarch_dump: gdbarch_push_dummy_call_p() = 1
gdbarch_dump: push_dummy_call = <0x1997bed0>
gdbarch_dump: gdbarch_push_dummy_code_p() = 0
gdbarch_dump: push_dummy_code = <0x0>
gdbarch_dump: gdbarch_read_pc_p() = 0
gdbarch_dump: read_pc = <0x0>
gdbarch_dump: gdbarch_record_special_symbol_p() = 1
gdbarch_dump: record_special_symbol = <0x199793a0>
gdbarch_dump: register_name = <0x19c6b3e0>
gdbarch_dump: register_reggroup_p = <0x19c6cd30>
gdbarch_dump: register_sim_regno = <0x19974e10>
gdbarch_dump: register_to_value = <0x0>
gdbarch_dump: gdbarch_register_type_p() = 1
gdbarch_dump: register_type = <0x199782b0>
gdbarch_dump: gdbarch_regset_from_core_section_p() = 1
gdbarch_dump: regset_from_core_section = <0x199713b0>
gdbarch_dump: gdbarch_relocate_instruction_p() = 0
gdbarch_dump: relocate_instruction = <0x0>
gdbarch_dump: remote_breakpoint_from_pc = <0x1997ba60>
gdbarch_dump: remote_register_number = <0x19c6b3a0>
gdbarch_dump: gdbarch_return_value_p() = 1
gdbarch_dump: return_value = <0x19977770>
gdbarch_dump: sdb_reg_to_regnum = <0x19bbc340>
gdbarch_dump: short_bit = 16
gdbarch_dump: gdbarch_single_step_through_delay_p() = 0
gdbarch_dump: single_step_through_delay = <0x0>
gdbarch_dump: gdbarch_skip_main_prologue_p() = 0
gdbarch_dump: skip_main_prologue = <0x0>
gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = 0
gdbarch_dump: skip_permanent_breakpoint = <0x0>
gdbarch_dump: skip_prologue = <0x1997baf0>
gdbarch_dump: skip_solib_resolver = <0x19a59ec0>
gdbarch_dump: skip_trampoline_code = <0x19952840>
gdbarch_dump: smash_text_address = <0x19972670>
gdbarch_dump: gdbarch_software_single_step_p() = 1
gdbarch_dump: software_single_step = <0x199714d0>
gdbarch_dump: sofun_address_maybe_missing = 0
gdbarch_dump: solib_symbols_extension = (null)
gdbarch_dump: sp_regnum = 13
gdbarch_dump: stab_reg_to_regnum = <0x19bbc340>
gdbarch_dump: stabs_argument_has_addr = <0x19bbc530>
gdbarch_dump: gdbarch_static_transform_name_p() = 0
gdbarch_dump: static_transform_name = <0x0>
gdbarch_dump: target_desc = 0x1ab7f178
gdbarch_dump: target_signal_from_host = <0x19bdcb90>
gdbarch_dump: target_signal_to_host = <0x19bdcb60>
gdbarch_dump: gdbarch_unwind_pc_p() = 1
gdbarch_dump: unwind_pc = <0x199751b0>
gdbarch_dump: gdbarch_unwind_sp_p() = 1
gdbarch_dump: unwind_sp = <0x19975160>
gdbarch_dump: value_from_register = <0x19b3c650>
gdbarch_dump: value_to_register = <0x0>
gdbarch_dump: vbit_in_delta = 1
gdbarch_dump: virtual_frame_pointer = <0x19bbc400>
gdbarch_dump: vtable_function_descriptors = 0
gdbarch_dump: gdbarch_write_pc_p() = 1
gdbarch_dump: write_pc = <0x1997be00>
arm_dump_tdep: Lowest pc = 0x8000gdbarch_update_p: New architecture 0x1ab8f880 (arm) selected
The target architecture is assumed to be arm
(gdb) i prog
Debugging a target over a serial line.
Program stopped at 0x0.
It stopped with signal SIGTRAP, Trace/breakpoint trap.
(gdb) si
Prologue scan stopped at 0xfffffff8
Prologue scan stopped at 0xfffffff8
0x400148c0 in ?? ()
1: x/4i $pc
=> 0x400148c0:	ldr	r0, [pc, #148]	; 0x4001495c
   0x400148c4:	ldr	r0, [r0]
   0x400148c8:	lsr	r0, r0, #8
   0x400148cc:	and	r0, r0, #7
(gdb) si
Prologue scan stopped at 0xfffffff8
0x400148c4 in ?? ()
1: x/4i $pc
=> 0x400148c4:	ldr	r0, [r0]
   0x400148c8:	lsr	r0, r0, #8
   0x400148cc:	and	r0, r0, #7
   0x400148d0:	cmp	r0, #3
(gdb) i r
r0             0x480022f0	1207968496
r1             0x0	0
r2             0x0	0
r3             0x0	0
r4             0x0	0
r5             0x0	0
r6             0x0	0
r7             0x0	0
r8             0x0	0
r9             0x0	0
r10            0x0	0
r11            0x0	0
r12            0x0	0
sp             0x0	0x0
lr             0x0	0
pc             0x400148c4	0x400148c4
cpsr           0x400001d3	1073742291
(gdb) si
Prologue scan stopped at 0xfffffff8
0x400148c8 in ?? ()
1: x/4i $pc
=> 0x400148c8:	lsr	r0, r0, #8
   0x400148cc:	and	r0, r0, #7
   0x400148d0:	cmp	r0, #3
   0x400148d4:	bne	0x400148f0
(gdb) si
Prologue scan stopped at 0xfffffff8
0x400148cc in ?? ()
1: x/4i $pc
=> 0x400148cc:	and	r0, r0, #7
   0x400148d0:	cmp	r0, #3
   0x400148d4:	bne	0x400148f0
   0x400148d8:	ldr	r0, [pc, #124]	; 0x4001495c
(gdb) si
Prologue scan stopped at 0xfffffff8
0x400148d0 in ?? ()
1: x/4i $pc
=> 0x400148d0:	cmp	r0, #3
   0x400148d4:	bne	0x400148f0
   0x400148d8:	ldr	r0, [pc, #124]	; 0x4001495c
   0x400148dc:	ldr	r0, [r0]
(gdb) si
Prologue scan stopped at 0xfffffff8
0x400148d4 in ?? ()
1: x/4i $pc
=> 0x400148d4:	bne	0x400148f0
   0x400148d8:	ldr	r0, [pc, #124]	; 0x4001495c
   0x400148dc:	ldr	r0, [r0]
   0x400148e0:	mov	r6, r0
(gdb) si
Prologue scan stopped at 0xfffffff8
0x400148d8 in ?? ()
1: x/4i $pc
=> 0x400148d8:	ldr	r0, [pc, #124]	; 0x4001495c
   0x400148dc:	ldr	r0, [r0]
   0x400148e0:	mov	r6, r0
   0x400148e4:	and	r0, r0, #31
(gdb) i r
r0             0x3	3
r1             0x0	0
r2             0x0	0
r3             0x0	0
r4             0x0	0
r5             0x0	0
r6             0x0	0
r7             0x0	0
r8             0x0	0
r9             0x0	0
r10            0x0	0
r11            0x0	0
r12            0x0	0
sp             0x0	0x0
lr             0x0	0
pc             0x400148d8	0x400148d8
cpsr           0x600001d3	1610613203
(gdb)