크래시 유틸리티를 디버깅할 수 있는 유용한 디버깅 패치다.
100% 내가 만든 것이다.
diff --git a/arm64.c b/arm64.c
--- a/arm64.c
+++ b/arm64.c
@@ -361,6 +361,19 @@ arm64_init(int when)
/* use machdep parameters */
arm64_calc_phys_offset();
+ error(INFO, "[+][%s][%d] at %s\n", __func__, __LINE__, __FILE__);
+ error(INFO, "kimage_voffset: %lx phys_offset: %lx \n",
+ machdep->machspec->kimage_voffset, machdep->machspec->phys_offset);
+
+ error(INFO, "CONFIG_ARM64_VA_BITS: %ld\n", ms->CONFIG_ARM64_VA_BITS);
+ error(INFO, " VA_BITS_ACTUAL: %ld\n", ms->VA_BITS_ACTUAL);
+ error(INFO, "(calculated) VA_BITS: %ld\n", ms->VA_BITS);
+ error(INFO, " PAGE_OFFSET: %lx\n", ARM64_PAGE_OFFSET_ACTUAL);
+ error(INFO, " VA_START: %lx\n", ms->VA_START);
+ error(INFO, " modules: %lx - %lx\n", ms->modules_vaddr, ms->modules_end);
+ error(INFO, " vmalloc: %lx - %lx\n", ms->vmalloc_start_addr, ms->vmalloc_end);
+ error(INFO, "kernel image: %lx - %lx\n", ms->kimage_text, ms->kimage_end);
+ error(INFO, " vmemmap: %lx - %lx\n\n", ms->vmemmap_vaddr, ms->vmemmap_end);
if (CRASHDEBUG(1)) {
if (machdep->flags & NEW_VMEMMAP)
fprintf(fp, "kimage_voffset: %lx\n",
@@ -816,6 +829,11 @@ arm64_parse_cmdline_args(void)
"setting max_physmem_bits to: %ld\n\n",
machdep->max_physmem_bits);
continue;
+ } else if (arm64_parse_machdep_arg_l(arglist[i], "kaddr_offset",
+ &machdep->machspec->kimage_addr_offset)) {
+ error(WARNING, "setting kimage_addr_offset to: 0x%lx\n\n",
+ machdep->machspec->kimage_addr_offset);
+ continue;
}
error(WARNING, "ignoring --machdep option: %s\n",
@@ -1011,6 +1029,12 @@ arm64_kdump_phys_base(ulong *phys_offset)
if ((machdep->flags & NEW_VMEMMAP) &&
machdep->machspec->kimage_voffset &&
(sp = kernel_symbol_search("memstart_addr"))) {
+
+ physaddr_t kimage_offset_addr = machdep->machspec->kimage_addr_offset;
+
+ if (kimage_offset_addr) {
+ machdep->machspec->kimage_voffset -= kimage_offset_addr;
+ }
paddr = sp->value - machdep->machspec->kimage_voffset;
if (READMEM(-1, phys_offset, sizeof(*phys_offset),
sp->value, paddr) > 0)
< '시스템 소프트웨어 개발을 위한 Arm 아키텍처의 구조와 원리' 저자>
'유용한 디버깅 팁 > crash utility and vmcore' 카테고리의 다른 글
[Debugging] crash-utility (11/10/2023) (0) | 2023.11.10 |
---|---|
[crash-utility] 컴파일 에러: curses.h: No such file or directory! (0) | 2023.05.06 |
[리눅스커널][디버깅] Red Hat Crash-Utility(크래시 유틸리티) 설치! (0) | 2023.05.06 |
[crash-utility] crash-utilty 실행 시 디버깅 옵션(-d 6) (0) | 2023.05.05 |
Crash 명령어 (0) | 2023.05.05 |