Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way I can set the registers manually? #166

Open
lzr1264823628 opened this issue Dec 29, 2023 · 0 comments
Open

Is there any way I can set the registers manually? #166

lzr1264823628 opened this issue Dec 29, 2023 · 0 comments

Comments

@lzr1264823628
Copy link

crash 8.0.4++
Is there any way I can set the registers manually?
I want to use gdb to look at the local variables in the stack (although it can be manually restored but this is too cumbersome), gdb says I need a pc register, and I failed to manually set the cpu register using gdb.

crash> i r
x0             <unavailable>
x1             <unavailable>
x2             <unavailable>
x3             <unavailable>
x4             <unavailable>
x5             <unavailable>
x6             <unavailable>
x7             <unavailable>
x8             <unavailable>
x9             <unavailable>
x10            <unavailable>
x11            <unavailable>
x12            <unavailable>
x13            <unavailable>
x14            <unavailable>
x15            <unavailable>
x16            <unavailable>
x17            <unavailable>
x18            <unavailable>
x19            <unavailable>
x20            <unavailable>
x21            <unavailable>
x22            <unavailable>
x23            <unavailable>
x24            <unavailable>
x25            <unavailable>
x26            <unavailable>
x27            <unavailable>
x28            <unavailable>
crash> i locals
PC unavailable, cannot determine locals.
crash> i local
PC unavailable, cannot determine locals.
crash> gdb set $pc=0
gdb: gdb request failed: set $pc=0
crash> runq -m
 CPU 0: [1 05:16:52.896]  PID: 0      TASK: ffffffda0558bf80  COMMAND: "swapper/0"
 CPU 1: [0 00:00:00.000]  PID: 2512   TASK: ffffff805ddbca00  COMMAND: "[email protected]"
 CPU 2: [0 00:00:00.000]  PID: 23863  TASK: ffffff88402ddc80  COMMAND: "clientSocketRec"
 CPU 3: [1 05:16:52.899]  PID: 0      TASK: ffffff8020489280  COMMAND: "swapper/3"
 CPU 4: [1 05:16:52.898]  PID: 0      TASK: ffffff8020488000  COMMAND: "swapper/4"
 CPU 5: [1 05:16:52.896]  PID: 0      TASK: ffffff802048a500  COMMAND: "swapper/5"
 CPU 6: [1 05:16:52.895]  PID: 0      TASK: ffffff802048b780  COMMAND: "swapper/6"
 CPU 7: [1 05:16:52.863]  PID: 0      TASK: ffffff80204d4a00  COMMAND: "swapper/7"
crash> bt
PID: 2512     TASK: ffffff805ddbca00  CPU: 1    COMMAND: "[email protected]"
bt: WARNING: cannot determine starting stack frame for task ffffff805ddbca00
crash> bt -S ffffffc0171ab9f8
PID: 2512     TASK: ffffff805ddbca00  CPU: 1    COMMAND: "[email protected]"
bt: WARNING: cannot determine starting stack frame for task ffffff805ddbca00
 #0 [ffffffc0171aba50] usb_gadget_giveback_request at ffffffda03ce8bd4
 #1 [ffffffc0171abaa0] dwc3_remove_requests at ffffffda03c667b4
 #2 [ffffffc0171abb20] dwc3_ep0_out_start at ffffffda03c7269c
 #3 [ffffffc0171abb70] __dwc3_gadget_start at ffffffda03c708e8
 #4 [ffffffc0171abba0] __typeid__ZTSFvvE_global_addr at ffffffda046388b4
 #5 [ffffffc0171abbf0] __typeid__ZTSFvvE_global_addr at ffffffda046388b4
 #6 [ffffffc0171abc30] udc_bind_to_driver at ffffffda03ce7f80
 #7 [ffffffc0171abc60] usb_gadget_probe_driver at ffffffda03ce8854
 #8 [ffffffc0171abc90] gadget_dev_desc_UDC_store at ffffffda03ce54b8
 #9 [ffffffc0171abcd0] configfs_write_file at ffffffda0348bcdc
#10 [ffffffc0171abda0] vfs_write at ffffffda033446b4
#11 [ffffffc0171abdf0] ksys_write at ffffffda03344540
#12 [ffffffc0171abe30] __arm64_sys_write at ffffffda033444b4
#13 [ffffffc0171abe50] el0_svc_common at ffffffda02e93c50
#14 [ffffffc0171abe90] el0_svc at ffffffda045633b8
#15 [ffffffc0171abea0] el0_sync_handler at ffffffda0456332c
#16 [ffffffc0171abfe0] el0_sync at ffffffda02e120b0
     PC: 000000731a54398c   LR: 00000073216d28b0   SP: 0000007fe961cf80
    X29: 0000007fe961cf80  X28: 0000007321aa0010  X27: 0000007fe961d170
    X26: 0000000000000200  X25: 0000000000000000  X24: 0000007fe961d171
    X23: 0000007321aa0010  X22: 0000000000000009  X21: 0000007fe961d079
    X20: 0000000000000009  X19: 000000000000000c  X18: 00000073222bc000
    X17: 000000731a543980  X16: 000000731a567ef0  X15: 000000731a4c37a2
    X14: 0000000000000000  X13: 0000007fe961cf30  X12: ffffff80ffffffd0
    X11: 0000007fe961cf00  X10: 000000000000000c   X9: 0000000000000000
     X8: 0000000000000040   X7: 65676461675f6273   X6: b40000704a4aaad9
     X5: 0000000000008000   X4: ffffffffffffffff   X3: ffffffffffffffff
     X2: 000000000000000c   X1: 0000007fe961d079   X0: 0000000000000009
    ORIG_X0: 0000000000000009  SYSCALLNO: 40  PSTATE: 00001000
crash> help -m
               flags: 104036d1 (KSYMS_START|VM_L3_4K|VMEMMAP|IRQ_STACKS|UNW_4_14|MACHDEP_BT_TEXT|NEW_VMEMMAP|FLIPPED_VM|ARM64_MTE)
              kvbase: ffffff8000000000
   identity_map_base: ffffff8000000000
            pagesize: 4096
           pageshift: 12
            pagemask: fffffffffffff000
          pageoffset: fff
           stacksize: 16384
                  hz: 250
                 mhz: 0
             memsize: 12717129728 (0x2f6000000)
                bits: 64
             nr_irqs: 426
       eframe_search: arm64_eframe_search()
          back_trace: arm64_back_trace_cmd() (default: original method)
  in_alternate_stack: arm64_in_alternate_stack()
     processor_speed: arm64_processor_speed()
               uvtop: arm64_uvtop()->arm64_vtop_3level_4k()
               kvtop: arm64_kvtop()->arm64_vtop_3level_4k()
        get_task_pgd: arm64_get_task_pgd()
            dump_irq: generic_dump_irq()
     get_stack_frame: arm64_get_stack_frame()
       get_stackbase: generic_get_stackbase()
        get_stacktop: generic_get_stacktop()
       translate_pte: arm64_translate_pte()
         memory_size: generic_memory_size()
       vmalloc_start: arm64_vmalloc_start()
   get_kvaddr_ranges: arm64_get_kvaddr_ranges()
        is_task_addr: arm64_is_task_addr()
       verify_symbol: arm64_verify_symbol()
          dis_filter: arm64_dis_filter()
            cmd_mach: arm64_cmd_mach()
        get_smp_cpus: arm64_get_smp_cpus()
           is_kvaddr: arm64_is_kvaddr()
           is_uvaddr: arm64_is_uvaddr()
     value_to_symbol: generic_machdep_value_to_symbol()
     init_kernel_pgd: arm64_init_kernel_pgd
        verify_paddr: generic_verify_paddr()
     show_interrupts: generic_show_interrupts()
    get_irq_affinity: generic_get_irq_affinity()
       dumpfile_init: (not used)
   process_elf_notes: process_elf64_notes()
  verify_line_number: (not used)
  xendump_p2m_create: (n/a)
xen_kdump_p2m_create: (n/a)
  xendump_panic_task: (n/a)
    get_xendump_regs: (n/a)
   line_number_hooks: (not used)
       last_pgd_read: ffffffda05265000
       last_pud_read: (not used)
       last_pmd_read: ffffff806d9a6000
      last_ptbl_read: ffffff80510b3000
 clear_machdep_cache: arm64_clear_machdep_cache()
                 pgd: 55d8f20bc9a0
                 pud: 0
                 pmd: 55d8f20bd9b0
                ptbl: 55d8f20be9c0
        ptrs_per_pgd: 512
   section_size_bits: 30
    max_physmem_bits: 48
   sections_per_root: 128
     cmdline_args[0]: vabits_actual=39
     cmdline_args[1]: (unused)
     cmdline_args[2]: (unused)
     cmdline_args[3]: (unused)
     cmdline_args[4]: (unused)
            machspec: 55d8ef3baea0
      struct_page_size: 0
               VA_BITS: 39
  CONFIG_ARM64_VA_BITS: 39
              VA_START: ffffffc000000000
        VA_BITS_ACTUAL: 39
CONFIG_ARM64_KERNELPACMASK: (unused)
         userspace_top: 0000008000000000
           page_offset: ffffff8000000000
    vmalloc_start_addr: ffffffc008000000
           vmalloc_end: fffffffebffeffff
         modules_vaddr: ffffffc000000000
           modules_end: ffffffc007ffffff
         vmemmap_vaddr: fffffffeffe00000
           vmemmap_end: ffffffffffffffff
           kimage_text: ffffffda02e00000
            kimage_end: ffffffda05870000
        kimage_voffset: ffffffd95ae00000
           phys_offset: 80000000
       physvirt_offset: 8080000000
__exception_text_start: 0
  __exception_text_end: 0
 __irqentry_text_start: ffffffda02e10000
   __irqentry_text_end: ffffffda02e10000
      exp_entry1_start: 0
        exp_entry1_end: 0
      exp_entry2_start: 0
        exp_entry2_end: 0
       panic_task_regs: 0
    user_eframe_offset: 336
    kern_eframe_offset: 320
         PTE_PROT_NONE: 400000000000000
              PTE_FILE: (unused)
       __SWP_TYPE_BITS: 6
      __SWP_TYPE_SHIFT: 2
       __SWP_TYPE_MASK: 3f
     __SWP_OFFSET_BITS: 50
    __SWP_OFFSET_SHIFT: 8
     __SWP_OFFSET_MASK: 3ffffffffffff
   machine_kexec_start: 0
     machine_kexec_end: 0
     crash_kexec_start: 0
       crash_kexec_end: 0
  crash_save_cpu_start: 0
    crash_save_cpu_end: 0
          kernel_flags: a
          irq_stackbuf: 0
        irq_stack_size: 16384
         irq_stacks[0]: ffffffc008000000
         irq_stacks[1]: ffffffc008008000
         irq_stacks[2]: ffffffc008010000
         irq_stacks[3]: ffffffc008018000
         irq_stacks[4]: ffffffc008020000
         irq_stacks[5]: ffffffc008028000
         irq_stacks[6]: ffffffc008030000
         irq_stacks[7]: ffffffc008038000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant