Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mrnuke-adaptrum/265eaa5126486bfd5b82b7a0ff6dfb8a to your computer and use it in GitHub Desktop.
Save mrnuke-adaptrum/265eaa5126486bfd5b82b7a0ff6dfb8a to your computer and use it in GitHub Desktop.
GDB commands (after loading kernel elf file):
(gdb) break instr_service
Breakpoint 18 at 0x8034e92c: file arch/arc/kernel/entry.S, line 72.
(gdb) cont
Continuing.
Breakpoint 18, instr_service () at arch/arc/kernel/entry.S:72
72 EXCEPTION_PROLOGUE
(gdb) x/5i $pc
=> 0x8034e92c <instr_service>: brk
0x8034e930 <instr_service+4>: ld_s r3,[r0,0x10]
0x8034e932 <instr_service+6>: ldw_s.x r12,[r13,0]
0x8034e934 <instr_service+8>: lr r9,[1026]
0x8034e938 <instr_service+12>: bbit1 r9,0x7,0x8034e944 <instr_service+24>
(gdb)
openocd vervose log:
Debug: 4652 164695 gdb_server.c:2812 gdb_input_inner(): received packet: 'm8034e900,40'
Debug: 4653 164695 gdb_server.c:1386 gdb_read_memory_packet(): addr: 0x8034e900, len: 0x00000040
Debug: 4654 164695 target.c:2097 target_read_buffer(): reading buffer of 64 byte at 0x8034e900
Debug: 4655 164695 arc_mem.c:186 arc_mem_read(): Read memory: addr=0x8034e900, size=4, count=16
Debug: 4656 164695 arc_mem.c:54 arc_mem_read_block(): Read memory: addr=0x8034e900, size=4, count=16
Debug: 4657 164695 arc_jtag.c:596 arc_jtag_read_memory(): Reading memory: addr=0x8034e900;count=16;slow=Y
Debug: 4658 164697 gdb_server.c:2812 gdb_input_inner(): received packet: 'm8034e92c,4'
Debug: 4659 164697 gdb_server.c:1386 gdb_read_memory_packet(): addr: 0x8034e92c, len: 0x00000004
Debug: 4660 164697 target.c:2097 target_read_buffer(): reading buffer of 4 byte at 0x8034e92c
Debug: 4661 164697 arc_mem.c:186 arc_mem_read(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4662 164697 arc_mem.c:54 arc_mem_read_block(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4663 164697 arc_jtag.c:596 arc_jtag_read_memory(): Reading memory: addr=0x8034e92c;count=1;slow=Y
Debug: 4664 167860 gdb_server.c:2812 gdb_input_inner(): received packet: 'Z0,8034e92c,4'
Debug: 4665 167860 gdb_server.c:1585 gdb_breakpoint_watchpoint_packet(): -
Debug: 4666 167860 arc_dbg.c:108 arc_dbg_set_breakpoint(): bpid: 0
Debug: 4667 167860 target.c:2097 target_read_buffer(): reading buffer of 4 byte at 0x8034e92c
Debug: 4668 167860 arc_mem.c:186 arc_mem_read(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4669 167860 arc_mem.c:54 arc_mem_read_block(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4670 167860 arc_jtag.c:596 arc_jtag_read_memory(): Reading memory: addr=0x8034e92c;count=1;slow=Y
Debug: 4671 167860 arc32.c:577 arc32_write_instruction_u32(): Address: 0x8034e92c, value: 0x256f003f
Debug: 4672 167860 target.c:2036 target_write_buffer(): writing buffer of 4 byte at 0x8034e92c
Debug: 4673 167860 arc_mem.c:263 arc_mem_write(): address: 0x8034e92c, size: 4, count: 1
Debug: 4674 167860 arc_mem.c:74 arc_mem_write_block32(): Write 4-byte memory block: addr=0x8034e92c, count=1
Debug: 4675 167860 arc_jtag.c:528 arc_jtag_write_memory(): Writing to memory: addr=0x8034e92c;count=1;buffer[0]=0x003f256f
Debug: 4676 167860 target.c:2097 target_read_buffer(): reading buffer of 4 byte at 0x8034e92c
Debug: 4677 167860 arc_mem.c:186 arc_mem_read(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4678 167860 arc_mem.c:54 arc_mem_read_block(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4679 167860 arc_jtag.c:596 arc_jtag_read_memory(): Reading memory: addr=0x8034e92c;count=1;slow=Y
Debug: 4680 167861 arc32.c:612 arc32_read_instruction_u32(): Address: 0x8034e92c, value: 0x256f003f
Debug: 4681 167861 breakpoints.c:104 breakpoint_add_internal(): added software breakpoint at 0x8034e92c of length 0x00000004, (BPID: 0)
Debug: 4682 167861 gdb_server.c:2812 gdb_input_inner(): received packet: 'c'
Debug: 4683 167861 target.c:1523 target_call_event_callbacks(): target event 5 (gdb-start)
Debug: 4684 167861 gdb_server.c:1553 gdb_step_continue_packet(): -
Debug: 4685 167861 gdb_server.c:1562 gdb_step_continue_packet(): continue
Debug: 4686 167861 target.c:1523 target_call_event_callbacks(): target event 3 (resume-start)
Debug: 4687 167861 arc_dbg.c:562 arc_dbg_resume(): current:1, address:0x00000000, handle_breakpoints:0, debug_execution:0
Debug: 4688 167861 arc_dbg.c:571 arc_dbg_resume(): we are in debug execution mode
Debug: 4689 167861 target.c:1905 target_free_all_working_areas_restore(): freeing all working areas
Debug: 4690 167861 arc32.c:261 arc32_restore_context(): -
Debug: 4691 167861 arc32.c:289 arc32_restore_context(): Will write regnum=0
Debug: 4692 167861 arc32.c:289 arc32_restore_context(): Will write regnum=2
Debug: 4693 167861 arc32.c:300 arc32_restore_context(): Will write regnum=64
Debug: 4694 167861 arc_jtag.c:224 arc_jtag_write_registers(): Writing to core registers: addr[0]=0x0;count=2;buffer[0]=0x00000002
Debug: 4695 167861 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x6;count=1;buffer[0]=0x80336000
Debug: 4696 167861 arc_dbg.c:594 arc_dbg_resume(): Target resumes from PC=0x80336000, pc.dirty=1, pc.valid=1
Debug: 4697 167861 arc_dbg.c:600 arc_dbg_resume(): resume Core (when start-core) with PC @:0x80336000
Debug: 4698 167861 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x6;count=1;buffer[0]=0x80336000
Debug: 4699 167861 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x40c;count=1;buffer[0]=0xffffffff
Debug: 4700 167861 arc32.c:341 arc32_enable_interrupts(): interrupts enabled
Debug: 4701 167861 arc_jtag.c:298 arc_jtag_read_registers(): Reading aux registers: addr[0]=0x5;count=1
Debug: 4702 167862 arc_jtag.c:341 arc_jtag_read_registers(): Read from register: buf[0]=0x400000
Debug: 4703 167862 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x5;count=1;buffer[0]=0x00400002
Debug: 4704 167863 arc_jtag.c:298 arc_jtag_read_registers(): Reading aux registers: addr[0]=0xa;count=1
Debug: 4705 167863 arc_jtag.c:341 arc_jtag_read_registers(): Read from register: buf[0]=0x801
Debug: 4706 167863 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0xa;count=1;buffer[0]=0x00000800
Debug: 4707 167864 arc32.c:363 arc32_start_core(): Core started to run
Debug: 4708 167864 target.c:1523 target_call_event_callbacks(): target event 2 (resumed)
Debug: 4709 167864 arc_dbg.c:633 arc_dbg_resume(): target resumed at 0x80336000
Debug: 4710 167864 target.c:1523 target_call_event_callbacks(): target event 4 (resume-end)
Debug: 4711 182144 arc_ocd.c:68 arc_ocd_poll(): ARC core is halted or in reset.
Debug: 4712 182144 arc_jtag.c:298 arc_jtag_read_registers(): Reading aux registers: addr[0]=0x6;count=1
Debug: 4713 182144 arc_jtag.c:341 arc_jtag_read_registers(): Read from register: buf[0]=0x8034e92c
Debug: 4714 182144 arc32.c:139 arc32_save_context(): -
Debug: 4715 182144 arc_jtag.c:298 arc_jtag_read_registers(): Reading core registers: addr[0]=0x0;count=34
Debug: 4716 182146 arc_jtag.c:341 arc_jtag_read_registers(): Read from register: buf[0]=0x0
Debug: 4717 182146 arc_jtag.c:298 arc_jtag_read_registers(): Reading aux registers: addr[0]=0x6;count=4
Debug: 4718 182147 arc_jtag.c:341 arc_jtag_read_registers(): Read from register: buf[0]=0x8034e92c
Debug: 4719 182147 arc32.c:216 arc32_save_context(): Get core register regnum=0, name=r0, value=0x00000000
Debug: 4720 182147 arc32.c:216 arc32_save_context(): Get core register regnum=1, name=r1, value=0x00000001
Debug: 4721 182147 arc32.c:216 arc32_save_context(): Get core register regnum=2, name=r2, value=0x2006d88c
Debug: 4722 182147 arc32.c:216 arc32_save_context(): Get core register regnum=3, name=r3, value=0x00000000
Debug: 4723 182147 arc32.c:216 arc32_save_context(): Get core register regnum=4, name=r4, value=0x00000000
Debug: 4724 182147 arc32.c:216 arc32_save_context(): Get core register regnum=5, name=r5, value=0x00000000
Debug: 4725 182147 arc32.c:216 arc32_save_context(): Get core register regnum=6, name=r6, value=0x2000a6a0
Debug: 4726 182147 arc32.c:216 arc32_save_context(): Get core register regnum=7, name=r7, value=0x00000002
Debug: 4727 182147 arc32.c:216 arc32_save_context(): Get core register regnum=8, name=r8, value=0x000000a3
Debug: 4728 182147 arc32.c:216 arc32_save_context(): Get core register regnum=9, name=r9, value=0x2000b490
Debug: 4729 182147 arc32.c:216 arc32_save_context(): Get core register regnum=10, name=r10, value=0x20003d2c
Debug: 4730 182147 arc32.c:216 arc32_save_context(): Get core register regnum=11, name=r11, value=0x2000a3cc
Debug: 4731 182147 arc32.c:216 arc32_save_context(): Get core register regnum=12, name=r12, value=0x0000000c
Debug: 4732 182147 arc32.c:216 arc32_save_context(): Get core register regnum=13, name=r13, value=0x20008088
Debug: 4733 182147 arc32.c:216 arc32_save_context(): Get core register regnum=14, name=r14, value=0x2007ce50
Debug: 4734 182147 arc32.c:216 arc32_save_context(): Get core register regnum=15, name=r15, value=0x00000000
Debug: 4735 182147 arc32.c:216 arc32_save_context(): Get core register regnum=16, name=r16, value=0x2006d88c
Debug: 4736 182147 arc32.c:216 arc32_save_context(): Get core register regnum=17, name=r17, value=0x00000000
Debug: 4737 182147 arc32.c:216 arc32_save_context(): Get core register regnum=18, name=r18, value=0x00000000
Debug: 4738 182147 arc32.c:216 arc32_save_context(): Get core register regnum=19, name=r19, value=0x20008068
Debug: 4739 182147 arc32.c:216 arc32_save_context(): Get core register regnum=20, name=r20, value=0x5f825ee8
Debug: 4740 182147 arc32.c:216 arc32_save_context(): Get core register regnum=21, name=r21, value=0x00000000
Debug: 4741 182147 arc32.c:216 arc32_save_context(): Get core register regnum=22, name=r22, value=0x20008064
Debug: 4742 182147 arc32.c:216 arc32_save_context(): Get core register regnum=23, name=r23, value=0x00000014
Debug: 4743 182147 arc32.c:216 arc32_save_context(): Get core register regnum=24, name=r24, value=0x00000014
Debug: 4744 182147 arc32.c:216 arc32_save_context(): Get core register regnum=25, name=r25, value=0x2000adf0
Debug: 4745 182147 arc32.c:216 arc32_save_context(): Get core register regnum=26, name=gp, value=0x00000000
Debug: 4746 182147 arc32.c:216 arc32_save_context(): Get core register regnum=27, name=fp, value=0x5f825cf8
Debug: 4747 182147 arc32.c:216 arc32_save_context(): Get core register regnum=28, name=sp, value=0x5f825b38
Debug: 4748 182147 arc32.c:216 arc32_save_context(): Get core register regnum=29, name=ilink1, value=0x80350e5a
Debug: 4749 182147 arc32.c:216 arc32_save_context(): Get core register regnum=30, name=ilink2, value=0x00000000
Debug: 4750 182147 arc32.c:216 arc32_save_context(): Get core register regnum=31, name=blink, value=0x2005ea0c
Debug: 4751 182147 arc32.c:216 arc32_save_context(): Get core register regnum=60, name=lp_count, value=0x00000000
Debug: 4752 182147 arc32.c:216 arc32_save_context(): Get core register regnum=63, name=pcl, value=0x8034e92c
Debug: 4753 182147 arc32.c:236 arc32_save_context(): Get aux register regnum=64, name=pc, value=0x8034e92c
Debug: 4754 182147 arc32.c:236 arc32_save_context(): Get aux register regnum=65, name=lp_start, value=0x2000201a
Debug: 4755 182147 arc32.c:236 arc32_save_context(): Get aux register regnum=66, name=lp_end, value=0x2000202a
Debug: 4756 182147 arc32.c:236 arc32_save_context(): Get aux register regnum=67, name=status32, value=0x00001221
Debug: 4757 182147 arc32.c:553 arc32_reset_caches_states(): Resetting internal variables of caches states
Debug: 4758 182147 arc32.c:1019 arc32_get_register_field(): getting register field (reg_name=debug, field_name=bh)
Debug: 4759 182147 arc_jtag.c:298 arc_jtag_read_registers(): Reading aux registers: addr[0]=0x5;count=1
Debug: 4760 182147 arc_jtag.c:341 arc_jtag_read_registers(): Read from register: buf[0]=0x20400000
Debug: 4761 182147 arc_regs.c:84 arc_regs_get_core_reg(): Get register gdb_num=69, name=debug, value=0x20400000
Debug: 4762 182147 arc32.c:1061 arc32_get_register_field(): return (value=0x1)
Debug: 4763 182147 target.c:1523 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 4764 182147 target.c:1523 target_call_event_callbacks(): target event 1 (halted)
Debug: 4765 182147 target.c:1523 target_call_event_callbacks(): target event 6 (gdb-end)
Debug: 4766 182148 gdb_server.c:2812 gdb_input_inner(): received packet: 'g'
Debug: 4767 182148 arc_regs.c:173 arc_regs_get_gdb_reg_list(): REG_CLASS_GENERAL: number of regs=38
Debug: 4768 182148 gdb_server.c:2812 gdb_input_inner(): received packet: 'qXfer:threads:read::0,fff'
Debug: 4769 182148 gdb_server.c:2812 gdb_input_inner(): received packet: 'z0,8034e92c,4'
Debug: 4770 182148 gdb_server.c:1585 gdb_breakpoint_watchpoint_packet(): -
Debug: 4771 182148 arc_dbg.c:188 arc_dbg_unset_breakpoint(): bpid: 0
Debug: 4772 182148 target.c:2097 target_read_buffer(): reading buffer of 4 byte at 0x8034e92c
Debug: 4773 182148 arc_mem.c:186 arc_mem_read(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4774 182148 arc_mem.c:54 arc_mem_read_block(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4775 182148 arc32.c:471 arc32_dcache_flush(): Flushing D$.
Debug: 4776 182148 arc_jtag.c:298 arc_jtag_read_registers(): Reading aux registers: addr[0]=0x48;count=1
Debug: 4777 182149 arc_jtag.c:341 arc_jtag_read_registers(): Read from register: buf[0]=0x82
Debug: 4778 182149 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x48;count=1;buffer[0]=0x000000c2
Debug: 4779 182149 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x47;count=1;buffer[0]=0x00000001
Debug: 4780 182149 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x48;count=1;buffer[0]=0x00000082
Debug: 4781 182149 arc_jtag.c:596 arc_jtag_read_memory(): Reading memory: addr=0x8034e92c;count=1;slow=Y
Debug: 4782 182149 arc32.c:612 arc32_read_instruction_u32(): Address: 0x8034e92c, value: 0x00010000
Debug: 4783 182149 target.c:2097 target_read_buffer(): reading buffer of 4 byte at 0x8034e92c
Debug: 4784 182149 arc_mem.c:186 arc_mem_read(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4785 182149 arc_mem.c:54 arc_mem_read_block(): Read memory: addr=0x8034e92c, size=4, count=1
Debug: 4786 182149 arc_jtag.c:596 arc_jtag_read_memory(): Reading memory: addr=0x8034e92c;count=1;slow=Y
Debug: 4787 182150 arc32.c:612 arc32_read_instruction_u32(): Address: 0x8034e92c, value: 0x00010000
Warn : 4788 182150 arc_dbg.c:208 arc_dbg_unset_breakpoint(): Software breakpoint @0x8034e92c has been overwritten outside of debugger.Expected: 0x256f003f, got: 0x00010000
Debug: 4789 182150 arc32.c:433 arc32_cache_invalidate(): Invalidating I$ & D$.
Debug: 4790 182150 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x10;count=1;buffer[0]=0xffffffff
Debug: 4791 182150 arc_jtag.c:298 arc_jtag_read_registers(): Reading aux registers: addr[0]=0x48;count=1
Debug: 4792 182150 arc_jtag.c:341 arc_jtag_read_registers(): Read from register: buf[0]=0x1
Debug: 4793 182150 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x48;count=1;buffer[0]=0x00000001
Debug: 4794 182150 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x47;count=1;buffer[0]=0x00000001
Debug: 4795 182150 arc_jtag.c:224 arc_jtag_write_registers(): Writing to aux registers: addr[0]=0x48;count=1;buffer[0]=0x00000001
Debug: 4796 182150 breakpoints.c:307 breakpoint_free(): free BPID: 0 --> 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment