Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ ARM assembler instruction debugging method     - Java garbage collection and heap memory layout (Programming)

- fcntl file locking function add (Programming)

- Calling Qt libraries to implement functional processes of some summary (Programming)

- Linux security configuration (Linux)

- How to convert images, audio and video formats on Ubuntu (Linux)

- On the PC goes heavy security watch your startup items (Linux)

- XtraBackup achieve non-stop use of master-slave synchronization service (Database)

- CentOS 6 adds disk quota limit (Linux)

- Linux Getting Started tutorial: Experience Xen Virtual Machine chapter (Linux)

- Build Python3.4 + PyQt5.5.1 + Eric6.1.1 development platform under Mac OS X 10.11.1 (Server)

- Ten SCP transfer command example (Linux)

- Linux character device - automatically creates the device nodes and devices (Linux)

- Linux operating system buffer overflow attacks Countermeasures (Linux)

- Use ldap implement Windows Remote Desktop Ubuntu Linux (Linux)

- CentOS 6.x systems installation + NIC driver installation (Realtek PCIe GBE Family Controller for Linux) (Linux)

- Android custom ViewPager create kaleidoscopic image transition effects (Programming)

- Linux basic introductory tutorial ---- regex basis (Linux)

- Ubuntu users install the Download Manager software Xdman 5.0 (Linux)

- How to use secure FTP file transfer (Server)

- 20 Linux commands interview questions and answers (Linux)

  ARM assembler instruction debugging method
  Add Date : 2018-11-21      
  Learning ARM assembly time, and ultimately, for debugging ARM assembly instructions. As a multi-language debugger, gdb nature is a better choice. The debugger work, generally by modifying the contents of the code segment structure trap soft interrupt instruction, and implement procedures to suspend the monitor program execution state. To execute ARM instruction on the x86 platform, you can use qemu emulator executing ARM assembly instructions.

First, prepare ARM assembler

First, we construct a simple piece of ARM assembler program as a test code main.s.

.globl _start
mov R0, # 0
swi 0x00900001
Above assembly instructions to complete the exit system call 0 calls. mov instruction system calls incoming register R0, then use 0x00900001 into soft interrupt system calls.

To run the ARM assembly code, you need to use a cross compiler arm-linux-gcc compiler for ARM assembly code. After downloading cross compiler installed on ARM assembly code to compile.

arm-linux-gcc main.s -o main -nostdlib
Compile option "-nostdlib" said they did not use any run-time library files, compiled executable file can only be run on the main system ARM architecture.

Second, compile and install qemu emulator

To run the ARM architecture executable within an x86 Linux system, you need to install qemu emulator.

First, download the source code qemu, and then ensure that the system has been installed flex and bison.

Compile and install qemu.

./configure --prefix = / usr
sudo make && make install
Then use the qemu emulator for ARM ARM program execution.

qemu ./main
Third, compile and install arm-gdb

To debug ARM program, you need to use the source code to compile gdb generation arm-gdb.

First, download the gdb source code, compile and install.

./configure --target = arm-linux --prefix = / usr / local
sudo make && make install
In order to avoid conflicts and gdb system, we will install gdb installation directory to / usr / local, and then create a soft link.

ln -s / usr / bin / arm-gdb / usr / local / gdb / gdb
Then you can use arm-gdb debugger command ARM program.

Fourth, the program debugging ARM

The first to use qemu turn on remote debugging port.

qemu-arm -g 1024 ./main
And then export the environment variable QEMU_GDB.

export QEMU_GDB = / usr / local / gdb
Finally, enter the gdb debugger.

arm-gdb ./main
After entering arm-gdb, first connect remote debugging port.

(Gdb) target remote localhost: 1024
Then use the usual gdb debugging commands to debug code.

(Gdb) disassemble // View Disassembly
(Gdb) x / 8xw 0x0000808e // Check memory
(Gdb) info register // View register
(Gdb) continue // continue
(Gdb) stepi // assembly-level process by
(Gdb) nexti // assembly-level statements by
- NET Developers need to know some Linux commands (Linux)
- Graphical interface for the CentOS 6.4 installed and connected by remote VNC (Linux)
- Git commands (Linux)
- Java programmers talk about those advanced knowledge and direction (Programming)
- MySQL partition table Comments (Database)
- Oracle 11g Export guide problem not an empty table (Database)
- Nine artifact control disk partition under Linux (Linux)
- Use FirewallD build dynamic firewall (Linux)
- The script Linux command (Linux)
- Java thread pool: ExecutorService, Executors (Programming)
- MongoDB3.0.x version of the user authorization profile (stand-alone environment) (Database)
- CentOS 6.5 can not connect to the network under VMware (Linux)
- Linux LVM - File system extension (Linux)
- Json data with double backslashes to a single backslash Json data processing (Programming)
- C language Bubble Sort - integer sort (Programming)
- How to create a secure and easy to remember password (Linux)
- Linux Getting Started Tutorial: How to set up a static MAC address on VMware ESXi virtual machine (Mobile)
- Windows Ubuntu dual system a key Ghost, grub rescue prompt solution (Linux)
- How to implement Linux host Telnet SSH password Free (Server)
- Getting Started with Linux system to learn: how to configure a static IP address for CentOS7 (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.