2 arm-none-linux-gnueabi-objdump -D vmlinux > ../../module/37_debug_err_led/vmlinux.txt
3 root@Lover snow:/home/study/nfs_home/system/linux-2.6.31# cd ../../module/37_debug_err_led/
4
5 root@Lover snow:/home/study/nfs_home/system/linux-2.6.31#vi vmlinux.txt
6
7 Search for c01e8c74 in vmlinux.txt:
8 506554 c01e8c5c
9 506555 c01e8c5c: e52de004 str lr, [sp, #-4]!
10 506556 c01e8c60: e59f0038 ldr r0, [pc, #56] ; c01e8ca0 <.text+0x1bfca0>
11 506557 c01e8c64: e24dd004 sub sp, sp, #4; 0x4
12 506558 c01e8c68: ebf97d89 bl c0048294
13 506559 c01e8c6c: e59f1030 ldr r1, [pc, #48] ; c01e8ca4 <.text+0x1bfca4>
14 506560 c01e8c70: e59f0030 ldr r0, [pc, #48] ; c01e8ca8 <.text+0x1bfca8>
15 506561 c01e8c74: e5113f9f ldr r3, [r1, #-3999]
16 506562 c01e8c78: e3c33007 bic r3, r3, #7; 0x7
17 506563 c01e8c7c: e5013f9f str r3, [r1, #-3999]
18 506564 c01e8c80: e5112f9f ldr r2, [r1, #-3999]
19 506565 c01e8c84: e59f3020 ldr r3, [pc, #32] ; c01e8cac <.text+0x1bfcac>
20 506566 c01e8c88: e3822005 orr r2, r2, #5; 0x5
21 506567 c01e8c8c: e5830000 str r0, [r3]
22 506568 c01e8c90: e3a00000 mov r0, #0 ; 0x0
23 506569 c01e8c94: e5012f9f str r2, [r1, #-3999]
twenty four
25 Then reverse the process based on the assembly code.
5. Summarize the analysis methods
From the above steps, we know that whether the program is in the kernel or dynamically loaded, the analysis method is the same.
①. Analyze the error code to get the address and offset address of PC
② Generally speaking, the error code will give the function where the error occurred, and we can directly check the error in that function.
③If no error function is given, we need to determine whether the driver is in the kernel or a program loaded by insmod based on the value of PC
④ Open linux-2.6.31/System.map and cat /proc/kallsyms to match the PC pointer value. If it is in system.map, it is the kernel driver debugging. If it is in /proc/kallsyms, it is the driver error loaded by insmod.
⑤ If it is debugging the driver loaded by insmod, we will disassemble the .ko file.
arm-none-linux-gnueabi-objdump -D err_led.ko > err_led.txt,
Analyze the assembly file based on the offset address and PC value to deduce the wrong code
⑥ If it is a program debugging in the kernel, disassemble /linux-2.6.31/vmlinux
arm-none-linux-gnueabi-objdump -D vmlinux > vmlinux.txt
Search for the cheap address of PC in the disassembled file, analyze the disassembled file, and find out where the error is.
Previous article:Debug analysis: Analyze errors based on kernel error information stack information
Next article:Debugging and analysis of the implementation of mymsg and myprintk under proc in imx257
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Massive MIMO Definition and Massive MIMO 5G and NR Standards
- TI Embedded Live Month: In-depth exploration of new applications of embedded products in industry and automobiles. The third session will be live at 10:00 today.
- I just learned AD. Where can I find the AD component library and package library of diode 4148 transistor 8050 9012 and other devices?
- 5 - 65 MHz 24-bit Color FPD-Link II to FPD-Link Converter
- How far can the network cable replace the power cable?
- Tesla Model Y will soon release Autopilot or continue to enhance
- Xunwei IMX6 development board AndroidStudio-layout test
- [IOT harmful gas detection device based on STM32F7508-DK] Part 1: touchGFX trial
- Free gifts: Aim TTi current measurement probe, professional signal generator, JD card and other small gifts are waiting for you
- Happy Mid-Autumn Festival and National Day friends!