OpenOCD
arm_disassembler.c File Reference
Include dependency graph for arm_disassembler.c:

Go to the source code of this file.

Functions

int arm_access_size (struct arm_instruction *instruction)
 
int arm_evaluate_opcode (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_add_sp_pc_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_add_sub_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_adjust_stack_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_b_bl (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_b_bl_blx_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_blx_imm (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_breakpoint_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_byterev_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_cb_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_cdp_mcr_mrc (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_cond_branch_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_cps_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_data_proc (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_data_proc_imm_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_data_proc_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_extend (uint32_t opcode, uint32_t address, char *cp)
 
static int evaluate_extend_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_hint_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_ifthen_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_ldc_stc_mcrr_mrrc (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_ldm_stm (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_load_literal_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_load_store (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_load_store_imm_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_load_store_multiple_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_load_store_reg_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_load_store_stack_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_media (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_misc_instr (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_misc_load_store (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_mov_imm (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_mrs_msr (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_mul_and_extra_ld_st (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_p_add_sub (uint32_t opcode, uint32_t address, char *cp)
 
static int evaluate_pld (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_shift_imm_thumb (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_srs (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_swi (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static int evaluate_unknown (uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
 
static uint32_t ror (uint32_t value, int places)
 
static uint32_t thumb_alignpc4 (uint32_t addr)
 
int thumb_evaluate_opcode (uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
 

Variables

static const char * arm_condition_strings []
 

Function Documentation

◆ arm_access_size()

int arm_access_size ( struct arm_instruction instruction)

◆ arm_evaluate_opcode()

◆ evaluate_add_sp_pc_thumb()

◆ evaluate_add_sub_thumb()

◆ evaluate_adjust_stack_thumb()

◆ evaluate_b_bl()

static int evaluate_b_bl ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_b_bl_blx_thumb()

static int evaluate_b_bl_blx_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_blx_imm()

static int evaluate_blx_imm ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_breakpoint_thumb()

static int evaluate_breakpoint_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 2624 of file arm_disassembler.c.

References ARM_BKPT, ERROR_OK, arm_instruction::text, and arm_instruction::type.

Referenced by thumb_evaluate_opcode().

◆ evaluate_byterev_thumb()

static int evaluate_byterev_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 2801 of file arm_disassembler.c.

References ERROR_OK, and arm_instruction::text.

Referenced by thumb_evaluate_opcode().

◆ evaluate_cb_thumb()

static int evaluate_cb_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 2748 of file arm_disassembler.c.

References ERROR_OK, offset, and arm_instruction::text.

Referenced by thumb_evaluate_opcode().

◆ evaluate_cdp_mcr_mrc()

static int evaluate_cdp_mcr_mrc ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_cond_branch_thumb()

static int evaluate_cond_branch_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_cps_thumb()

static int evaluate_cps_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 2780 of file arm_disassembler.c.

References ERROR_OK, and arm_instruction::text.

Referenced by thumb_evaluate_opcode().

◆ evaluate_data_proc()

◆ evaluate_data_proc_imm_thumb()

◆ evaluate_data_proc_thumb()

◆ evaluate_extend()

static int evaluate_extend ( uint32_t  opcode,
uint32_t  address,
char *  cp 
)
static

Definition at line 702 of file arm_disassembler.c.

References ARM_ADD, ARM_MOV, ARM_UNDEFINED_INSTRUCTION, COND, and type.

Referenced by evaluate_media().

◆ evaluate_extend_thumb()

static int evaluate_extend_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 2766 of file arm_disassembler.c.

References ERROR_OK, and arm_instruction::text.

Referenced by thumb_evaluate_opcode().

◆ evaluate_hint_thumb()

static int evaluate_hint_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 2826 of file arm_disassembler.c.

References ERROR_OK, and arm_instruction::text.

Referenced by thumb_evaluate_opcode().

◆ evaluate_ifthen_thumb()

static int evaluate_ifthen_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 2859 of file arm_disassembler.c.

References arm_condition_strings, ERROR_OK, and arm_instruction::text.

Referenced by thumb_evaluate_opcode().

◆ evaluate_ldc_stc_mcrr_mrrc()

static int evaluate_ldc_stc_mcrr_mrrc ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_ldm_stm()

◆ evaluate_load_literal_thumb()

◆ evaluate_load_store()

◆ evaluate_load_store_imm_thumb()

◆ evaluate_load_store_multiple_thumb()

static int evaluate_load_store_multiple_thumb ( uint16_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_load_store_reg_thumb()

◆ evaluate_load_store_stack_thumb()

◆ evaluate_media()

static int evaluate_media ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_misc_instr()

◆ evaluate_misc_load_store()

◆ evaluate_mov_imm()

static int evaluate_mov_imm ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_mrs_msr()

static int evaluate_mrs_msr ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_mul_and_extra_ld_st()

static int evaluate_mul_and_extra_ld_st ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_p_add_sub()

static int evaluate_p_add_sub ( uint32_t  opcode,
uint32_t  address,
char *  cp 
)
static

Definition at line 754 of file arm_disassembler.c.

References ARM_ADD, ARM_SUB, ARM_UNDEFINED_INSTRUCTION, COND, op, and type.

Referenced by evaluate_media().

◆ evaluate_pld()

static int evaluate_pld ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ evaluate_shift_imm_thumb()

◆ evaluate_srs()

static int evaluate_srs ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 244 of file arm_disassembler.c.

References ERROR_OK, evaluate_unknown(), mode, and arm_instruction::text.

Referenced by arm_evaluate_opcode().

◆ evaluate_swi()

static int evaluate_swi ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

Definition at line 288 of file arm_disassembler.c.

References ARM_SWI, ERROR_OK, arm_instruction::text, and arm_instruction::type.

Referenced by arm_evaluate_opcode().

◆ evaluate_unknown()

static int evaluate_unknown ( uint32_t  opcode,
uint32_t  address,
struct arm_instruction instruction 
)
static

◆ ror()

static uint32_t ror ( uint32_t  value,
int  places 
)
static

Definition at line 95 of file arm_disassembler.c.

Referenced by evaluate_data_proc(), and evaluate_mrs_msr().

◆ thumb_alignpc4()

static uint32_t thumb_alignpc4 ( uint32_t  addr)
inlinestatic

Definition at line 2408 of file arm_disassembler.c.

References addr.

Referenced by evaluate_load_literal_thumb().

◆ thumb_evaluate_opcode()

Variable Documentation

◆ arm_condition_strings

const char* arm_condition_strings[]
static
Initial value:
= {
"EQ", "NE", "CS", "CC", "MI", "PL", "VS", "VC", "HI", "LS", "GE", "LT", "GT", "LE", "", "NV"
}

Definition at line 90 of file arm_disassembler.c.

Referenced by evaluate_cond_branch_thumb(), and evaluate_ifthen_thumb().