#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <setjmp.h>
#include <errno.h>
#include <poll.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <ctype.h>
#include "dbg_msg.h"
#include "jt_instr.h"
#include "jt_arm.h"
#include "jt_cortex.h"
#include "jt_mmu.h"
#include "jt_flash.h"
#include "jt_tap.h"
#include "arm_emu.h"
#include "arm_gdbstub.h"
#include "arm_gdbstub_callback.h"
#include "arm_memory_mmap.h"
#include "arm_gdbstub_break.h"
#include "arm_sfa_cmdseq.h"
#include "convert.h"
#define MAX_READ_RETRY 24 |
Referenced by getDebugChar().
#define NUM_REGS (16 /*std regs*/ + 8 /*fp regs*/ + 1 /*fp stat reg*/ + 1 /*prog stat reg*/) |
Referenced by gdb_handle_exception().
#define NUM_X_REGS (5 /*r8..r12 @ fiq*/ + 1 /*saved sp*/ + 1 /*saved lr*/ + 1 /*save prog stat reg*/ + 2 /*cortex has tow more*/) |
Referenced by gdb_handle_exception().
#define GDBFREADSIZE 16 |
#define PSEUDO_FREAD_ADDR 0xab0fE1F0 |
Referenced by gdb_handle_console_io(), gdb_read_data_from_console(), and gdb_write_data_to_console().
enum Action |
int gdb_main_loop | ( | int | fd | ) |
Task of the gdb main loop:
fd | e.g: TCP/IP socket descriptor to GDB |
0 | OK - Terminate | |
1 | OK - Detach (try again) |
References SymbolInfo::addr, allocateGdbSprintfBuf(), commonVar::allow_intr_in_step_mode, arm_sfa_StartTarget(), arm_sfa_StopTarget(), SymbolInfo::breakIsActive, BUFMAX, CALLBACK_EXSIST, CB_ACTION_NON, reg_set::CPSR, CPU, CPU_CPSR_FLAG_CARRY, CPU_CPSR_FLAG_FAKE_CORTEX_M3, CPU_CPSR_FLAG_FIQ_DISABEL, CPU_CPSR_FLAG_IRQ_DISABEL, CPU_CPSR_FLAG_JAZELLE, CPU_CPSR_FLAG_NEGATIVE, CPU_CPSR_FLAG_OVERFLOW, CPU_CPSR_FLAG_Q_STICKY_OVERFLOW, CPU_CPSR_FLAG_THUMB, CPU_CPSR_FLAG_ZERO, CPU_CPSR_MODE_FLAGS, DBG_LEVEL_GDB_ARM_INFO, dbgPrintf(), commonVar::debugComChan, commonVar::debugComGdbReadEnable, doCallback(), stubVar::enableStepHistory, error_exit_code, reg_set::ext, stubVar::fd, gdb_action_continue(), gdb_action_step(), gdb_handle_console_io(), gdb_handle_exception(), gdb_read_data_from_console(), gdb_restart(), gdb_stepHist_add(), gdb_stepHist_clean(), gdb_stepHist_loopDetect(), gdb_write_data_to_console(), stubVar::gdbComm, gdbPrintf(), getpacket(), isAddrOnBreakpointList(), SymbolInfo::isThumb, jtag_arm_ClearAnyBreakPoint(), jtag_arm_DumpCPUregs(), jtag_arm_FinalExitDebug(), jtag_arm_mmu_check_high_vectors(), jtag_arm_mmu_save_and_disable(), jtag_arm_mmu_virt2phys(), jtag_arm_PollDbgState(), jtag_arm_PrepareEnterDebug(), jtag_arm_PrepareExitDebug(), jtag_arm_ReadCpuRegs(), jtag_arm_ShowAllIceRT_Regs(), keeppacket(), stubVar::noAckMode, stubVar::noAckModeRequest, reg_set::Regs::r, stubVar::rcmdPktSize, RCMDPKTSIZE, stubVar::receiveBuffer, stubVar::receiveBufferCount, reg_set::regs, RemoveAllBreakpoints(), RemoveBreakpoint(), reg_set::RegExt::RegV4Ext::SPSR, SymbolInfo::state, SYM_PRESENT, symbolMain, TARGET_ACTION_CONTINUE, TARGET_ACTION_DETACH, TARGET_ACTION_ENTER_DBGSTATE, TARGET_ACTION_KILL, TARGET_ACTION_SKIP_DBGPOLL, TARGET_ACTION_STEP, undoAfterBlStep(), reg_set::RegExt::v4, reg_set::RegExt::v7m, and reg_set::RegExt::RegV7mExt::xPSR.
Referenced by main().
static int gdbstub_write_hexmem | ( | char * | ptr, | |
int | addr, | |||
int | length | |||
) | [static] |
write "hex" encoded byte string to target memory map
ptr | pointer to source (ASCII-HEX) | |
addr | target address (will be cached in MemMap) | |
length | number of bytes |
1 | success | |
0 | failure |
References gdb_write_mem(), and hex2mem().
Referenced by gdb_handle_exception().
static int putDebugChar | ( | int | fd, | |
int | c | |||
) | [static] |
write a single character (into socket)
fd | e.g: TCP/IP socket descriptor to GDB | |
c | charater to write |
1 | - data written | |
-1 | - nothing written (disconnect) |
References CALLBACK_EXSIST, doCallback(), and error_exit_code.
Referenced by getpacket().
static int getDebugChar | ( | int | fd | ) | [static] |
read and return a single char (from socket)
fd | e.g: TCP/IP socket descriptor to GDB |
>=0 | read charater from FIFO | |
-1 | nothing read (disconnect) |
References BUFMAX, CALLBACK_EXSIST, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO_LOW, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), debugCharReadCache, debugCharReadCacheLen, debugCharReadCachePos, doCallback(), error_exit_code, and MAX_READ_RETRY.
Referenced by getpacket(), and putpacket().
static int clearDebugChar | ( | int | fd | ) | [static] |
read out any debug chars (from socket) and kick them away
fd | e.g: TCP/IP socket descriptor to GDB |
0 | read charater from FIFO | |
-1 | nothing to read (disconnect) |
References BUFMAX, debugCharReadCache, debugCharReadCacheLen, and debugCharReadCachePos.
Referenced by putpacket().
static int hex | ( | char | ch | ) | [static] |
convert single hexadecimal encoded ASCII char Nibble to its integer value
ch | ASCII nibbel e.g. 'b' |
>=0 | is value of nibble e.g 11 | |
-1 | if not possible to convert |
Referenced by gdb_handle_exception(), getpacket(), hex2mem(), and hexToInt().
static void keeppacket | ( | char * | buffer | ) | [static] |
Save a packet gathered by getpacket().
The next call of getpacket() will deliver this packet then.
buffer | Pointer to receive string buffer |
References BUFMAX, and oldDebugPacked.
Referenced by gdb_main_loop(), and gdb_read_data_from_console().
static void getpacket | ( | char * | buffer | ) | [static] |
collect DebugChars from GDB socket and scan for the sequence $<data>#<checksum>
e.g.
$m0,10#2a
if checksum is valid then data will be hold in buffer
(including a terminating ZERO)
and an ACK char '+' is send back to GDB
if checksum is invalid send a NAK char '-' and wait for an other sequence
buffer | Pointer to receive string buffer |
References BUFMAX, DBG_LEVEL_GDB_ARM_ERROR, dbgPrintf(), stubVar::fd, getDebugChar(), hex(), stubVar::noAckMode, oldDebugPacked, putDebugChar(), stubVar::receiveBuffer, and stubVar::receiveBufferCount.
Referenced by gdb_handle_exception(), gdb_main_loop(), and gdb_write_data_to_console().
static void putpacket | ( | char * | buffer | ) | [static] |
send the packet in buffer to GDB until receiving ACK.
add escape char for $,#,* or }
try doing RLE compression if possible
buffer | Pointer to send buffer |
References BUFMAX, CALLBACK_EXSIST, clearDebugChar(), doCallback(), error_exit_code, stubVar::fd, getDebugChar(), stubVar::noAckMode, and stubVar::noAckModeRequest.
Referenced by gdb_handle_console_io(), gdb_handle_exception(), gdb_rcmd_console_output(), gdb_read_data_from_console(), gdb_reply_exception(), and gdb_write_data_to_console().
char* mem2hex | ( | char * | mem, | |
char * | buf, | |||
int | count | |||
) |
convert the memory pointed to by mem into hex, placing result in buf
mem | pointer to source memory (binary) | |
buf | pointer to destination (ASCII-HEX) | |
count | of dest. memory will be written |
Referenced by gdb_handle_exception(), gdb_query_rcmd(), gdb_query_symbol(), gdb_query_threadExtraInfo(), gdb_reply_exception(), and gdb_write_data_to_console().
char* hex2mem | ( | char * | buf, | |
char * | mem, | |||
int | count | |||
) |
convert the hex array pointed to by buf into binary to be placed in mem
buf | pointer to source (ASCII-HEX) | |
mem | pointer to destination memory (binary) | |
count | of dest. memory will be written |
Referenced by gdb_handle_exception(), gdb_query_rcmd(), gdb_query_symbol(), and gdbstub_write_hexmem().
static char* bin2mem | ( | char * | buf, | |
char * | mem, | |||
int | count | |||
) | [static] |
copy count bytes of memory from buf to mem.
buf | pointer to source memory (binary) | |
mem | pointer to destination memory (binary) | |
count | of dest. memory will be written |
Referenced by gdb_read_data_from_console(), gdb_write_data_to_console(), and gdbstub_write_binmem().
int hexToInt | ( | char ** | ptr, | |
int * | intValue | |||
) |
While we find nice hex chars, build an integer Return number of chars processed.
ptr | pointer of pointer to ASCII-HEX-Int source (org pointer changed to next ASCII-HEX source) | |
intValue | pointer to integer |
References hex().
Referenced by gdb_handle_exception(), gdb_query_getTLSAddr(), gdb_query_ReadFeatures(), gdb_query_ReadMemoryMap(), gdb_query_symbol(), gdb_query_threadExtraInfo(), gdb_read_data_from_console(), gdb_vquery(), and gdb_write_data_to_console().
int gdbstub_write_binmem | ( | char * | ptr, | |
int | addr, | |||
int | length | |||
) |
write "bin" encoded byte string to target memory map
ptr | pointer to source (binary) | |
addr | target address (will be cached in MemMap) | |
length | number of bytes |
1 | success | |
0 | failure |
References bin2mem(), and gdb_write_mem().
Referenced by gdb_handle_exception(), and gdb_vquery().
static int computeSignal | ( | int | exceptionVector | ) | [static] |
this function takes the exception vector and attempts to translate this number into a unix compatible signal value. (Well, but we don't have an exception vector so we do something similar.)
exceptionVector | pseudo vector number (or type of exception) |
References TARGET_SIGNAL_0, TARGET_SIGNAL_ABRT, TARGET_SIGNAL_BUS, TARGET_SIGNAL_EMT, TARGET_SIGNAL_FPE, TARGET_SIGNAL_ILL, TARGET_SIGNAL_INT, TARGET_SIGNAL_KILL, TARGET_SIGNAL_QUIT, TARGET_SIGNAL_SEGV, TARGET_SIGNAL_STOP, TARGET_SIGNAL_TRAP, and TARGET_SIGNAL_TSTP.
Referenced by gdb_handle_exception(), and gdb_reply_exception().
static int gdb_reply_exception | ( | struct reg_set * | raw_regs, | |
int | type | |||
) | [static] |
reply to host that an exception has occurred
raw_regs | copy of all current CPU registers | |
type | pseudo vector number (or type of exception) |
References BUFMAX, computeSignal(), reg_set::CPSR, stubVar::currTid, GDB_REG_POS_ARM_FP, GDB_REG_POS_LR, GDB_REG_POS_PC, GDB_REG_POS_PS, GDB_REG_POS_SP, GDB_REG_POS_THUMB_FP, mem2hex(), putpacket(), reg_set::Regs::r, and reg_set::regs.
Referenced by gdb_handle_exception(), and gdb_handle_fake_continue().
void gdb_rcmd_console_output | ( | const char * | mem | ) |
send a message to the console while doing a rcmd. (this will be send in one or more packets)
mem | pointer to message string memory (ZERO terminated) |
References BUFMAX, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_INFO_LOW, dbgPrintf(), stubVar::fd, stubVar::gdbComm, putpacket(), and RCMDPKTSIZE.
Referenced by doCmdSequence(), and gdb_monitor_Rcmd().
static void gdb_handle_console_io | ( | struct gdbFreadRequest * | freadRequest | ) | [static] |
Exchange data between gdb and target, while target is running
freadRequest | pointer to console Read request struct |
References allocateGdbSprintfBuf(), gdbFreadRequest::buffer, BUFMAX, CB_ACTION_NON, gdbFreadRequest::data_len, commonVar::debugComChan, commonVar::debugComGdbReadEnable, gdbPrintf(), ICESTATE_DCC_BUFFER_DEQUEUE, ICESTATE_DCC_BUFFER_INQUEUE, ICESTATE_DCC_BUFFER_IS_EMPTY, ICESTATE_DCC_BUFFER_IS_FULL, inQueueGdbSprintfBuf(), gdbFreadRequest::length, gdbFreadRequest::pending, PSEUDO_FREAD_ADDR, and putpacket().
Referenced by gdb_main_loop().
static int gdb_read_data_from_console | ( | char * | inBuffer, | |
struct gdbFreadRequest * | freadRequest | |||
) | [static] |
Read data from GDB's console
inBuffer | ||
freadRequest | pointer to console Read request struct |
0 | OK nothing more to do | |
1 | received Interrupt signal |
References bin2mem(), gdbFreadRequest::buffer, gdbFreadRequest::data_len, DBG_LEVEL_GDB_ARM_ERROR, dbgPrintf(), hexToInt(), keeppacket(), gdbFreadRequest::length, gdbFreadRequest::pending, PSEUDO_FREAD_ADDR, and putpacket().
Referenced by gdb_main_loop().
static int gdb_write_data_to_console | ( | struct gdbFreadRequest * | freadRequest | ) | [static] |
Write data to GDB's console
If we are performing a STEP or CONTINUING for GDB.
We are able to write data to GDB's console (using F-calls)
This only make sense if there is still a pending callback action
or if we have an non empty gdbSprintfBuf in our queue
freadRequest | pointer to console Read request struct |
0 | OK nothing more to send | |
1 | received Interrupt signal | |
-1 | lost connection |
References bin2mem(), gdbFreadRequest::buffer, BUFMAX, CB_ACTION_INPROCESS, CB_ACTION_PROGRAM_FAIL, gdbFreadRequest::data_len, DBG_LEVEL_GDB_ARM_ERROR, dbgPrintf(), deQueueGdbSprintfBuf(), doCallback(), error_exit_code, freeGdbSprintfBuf(), getpacket(), hexToInt(), gdbSprintfBuf::len, gdbFreadRequest::length, mem2hex(), packGdbSprintBuf(), gdbFreadRequest::pending, PSEUDO_FREAD_ADDR, putpacket(), removeAllCallbacks(), and gdbSprintfBuf::string.
Referenced by gdb_action_continue(), gdb_flash_auto_programming(), gdb_handle_fake_continue(), and gdb_main_loop().
static int gdb_flash_auto_programming | ( | void | ) | [static] |
Try to program all pages of all known flashes that are no longer consistent.
0 | -> OK | |
1 | -> Interrupt | |
-1 | -> lost connection (or ERROR) |
References memMap::MemBufferType::Flash::algo, allocateCmdCallbackEntry(), allocateGdbSprintfBuf(), memMap::baseAddr, CB_ACTION_NON, CB_ACTION_PROGRAM_FAIL, CB_ACTION_PROGRAM_INPROCESS, CB_ACTION_PROGRAM_SUCCEED, CB_ACTION_VERIFY_DIFF, CB_ACTION_VERIFY_EQUAL, CB_ACTION_VERIFY_INPROCESS, checkFlashCB_read_sector(), convertDiffTimeToMsec, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, dbgPrintf(), commonVar::fake_continue_mode, memMapHead::firstMapEntry, memMap::MemBufferType::Flash, FLASH_ALGORITHEM_NOSUPPORT, gdb_write_data_to_console(), gdbPrintf(), getWorkSpace(), INFO_VERBOSE, inQueueCmdCallbackEntry(), flashCBContext::lastSectorId, memMap::memBufferType, MMAP_T_FLASH, memMap::nextMap, memMapHead::numberOfEntrys, memMap::MemBufferType::Flash::numberOfSectors, programFlashCB_write_sector(), flashCBContext::quiet_cnt, RCMDPKTSIZE, memMap::type, verbose, flashCBContext::verbose, and flashCBContext::whichMemMap.
Referenced by gdb_handle_exception().
static int gdb_handle_fake_continue | ( | struct reg_set * | raw_regs, | |
int | type | |||
) | [static] |
Do fake continue to Write data to GDB's console -- this is only possible if we are performing a continue request. -- but we don't like to do this at the real target. -- so this is a fake.
raw_regs | ||
type | current type of exception |
References DBG_LEVEL_GDB_ARM_INFO, dbgPrintf(), gdb_reply_exception(), and gdb_write_data_to_console().
Referenced by gdb_handle_exception().
static enum Action gdb_handle_exception | ( | struct reg_set * | raw_regs, | |
int | type, | |||
int * | wrongbreakpoint | |||
) | [static] |
This function does all command processing for interfacing with gdb. The following gdb commands are supported:
command function respose message ! Enable extended mode. OK ? What was the last sigval ? SNN (signal NN)
g return the value of the CPU registers hex data or ENN G set the value of the CPU registers OK or ENN pN..N Read the value of register N..N hex data or ENN PN..N=D..D Write register N..N with value D..D OK or ENN
mA..A,LLLL Read LLLL bytes at address A..A hex data or ENN MA..A,LLLL:DD Write LLLL hex data bytes at address A..A OK or ENN XA..A,LLLL:XX... OK or ENN write mem (binary) A..A is address, LLLL is number of bytes, XX... is binary data. The characters $, #, and 0x7d are escaped using 0x7d.
c Resume at current address SNN ( signal NN) cA..A Continue at address A..A SNN Cnn;A..A continue at address A..A with signal nn SNN
s Step one instruction SNN sA..A Step one instruction from A..A SNN Snn;A..A step with signal SNN
k kill
D detach OK
qc..c query command c..c (e.g. Rcmd) hex data or ENN or nothing vC..c vquery command c..c (e.g Flash..) hex data or ENN or nothing
z0,A..A,LLLL remove memory breakpoint OK or ENN or nothing Z0,A..A,LLLL insert memory breakpoint OK or ENN or nothing z1,A..A,LLLL remove hardware breakpoint OK or ENN or nothing Z1,A..A,LLLL insert hardware breakpoint OK or ENN or nothing z2,A..A,LLLL remove write watchpoint OK or ENN or nothing Z2,A..A,LLLL insert write watchpoint OK or ENN or nothing z3,A..A,LLLL remove read watchpoint OK or ENN or nothing Z3,A..A,LLLL insert read watchpoint OK or ENN or nothing z4,A..A,LLLL remove read/write watchpoint OK or ENN or nothing Z4,A..A,LLLL insert read/write watchpoint OK or ENN or nothing
raw_regs | ||
type | current type of exception | |
[out] | wrongbreakpoint | indicate if nothing happened due to a wrong beakpoint (or too many breakpoints) |
-2 | indicates to exit this program (kill) - the target program stops | |
-1 | indicates to leave this program (detach) - the target program still running | |
0 | indicates to continue target procedure | |
1 | indicates a single step operation |
References SymbolInfo::addr, breakpointContainer::allow_auto_step, SymbolInfo::breakIsActive, breakpointList, BUFMAX, CB_ACTION_ERASE_INPROCESS, CB_ACTION_PROGRAM_FAIL, commonVar::check_flash_if_auto_programming, computeSignal(), reg_set::CPSR, stubVar::currTid, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, dbgPrintf(), DONT_HAVE_BL_UNDO, commonVar::enable_program_flash_on_go, commonVar::enable_virt2phys, commonVar::fake_continue_mode, gdb_flash_auto_programming(), gdb_handle_fake_continue(), gdb_osabi_get_saved_register_set(), gdb_osabi_thead_alive(), gdb_osabi_thread_id_setup(), gdb_Q_query(), gdb_query(), gdb_read_mem(), GDB_REG_POS_BFAR, GDB_REG_POS_FIRST_FLOAT, GDB_REG_POS_FLOAT_STATUS, GDB_REG_POS_LAST_FLOAT, GDB_REG_POS_MMAR, GDB_REG_POS_PC, GDB_REG_POS_PS, GDB_REG_POS_SLR, GDB_REG_POS_SPS, GDB_REG_POS_SR10, GDB_REG_POS_SR11, GDB_REG_POS_SR12, GDB_REG_POS_SR8, GDB_REG_POS_SR9, GDB_REG_POS_SSP, gdb_reply_exception(), gdb_vquery(), gdb_writeback_Ram(), gdbLookupArmInstr(), gdbLookupThumbInstr(), stubVar::gdbSelTid, gdbstub_write_binmem(), gdbstub_write_hexmem(), getpacket(), hex(), hex2mem(), hexToInt(), InsertBreakpoint(), is_arm_bl_instr(), isBreakpointListEmpty(), SymbolInfo::isThumb, jt_arm_instr_modifys_PC(), jt_thumb_instr_modifys_PC(), jtag_arm_mmu_virt2phys(), mem2hex(), NUM_REGS, NUM_X_REGS, preparePossibleActionNext(), putpacket(), removeAllCallbacks(), RemoveBreakpoint(), SymbolInfo::state, SYM_PRESENT, symbolMain, TARGET_ACTION_CONTINUE, TARGET_ACTION_DETACH, TARGET_ACTION_KILL, TARGET_ACTION_STEP, THUMB_BL_FIRST_PART, and THUMB_BL_MSK.
Referenced by gdb_main_loop().
static void gdb_check_endian_at_reset_vector | ( | void | ) | [static] |
doing a READ-check at the RESET Vector to test if this ARM-machine is running in little or big endian mode
- |
References error_exit_code, jtag_arm_ReadByte(), jtag_arm_ReadWord(), and jtag_cortex_core_ApplicationInterruptResetControl_ReadRegister().
Referenced by gdb_restart().
static void gdb_check_thumb_support | ( | void | ) | [static] |
Dose this ARM-machine supports the THUMB instruction set.
- |
References ARM_BX_R0, reg_set::CPSR, CPU, CPU_CPSR_FLAG_FIQ_DISABEL, CPU_CPSR_FLAG_IRQ_DISABEL, CPU_CPSR_FLAG_JAZELLE, CPU_CPSR_FLAG_THUMB, CPU_CPSR_MODE_ABORT, CPU_CPSR_MODE_FIQ, CPU_CPSR_MODE_FLAGS, CPU_CPSR_MODE_IRQ, CPU_CPSR_MODE_SVC, CPU_CPSR_MODE_SYSTEM, CPU_CPSR_MODE_UNDEF_INSTR, jtag_arm_PollDbgState(), jtag_arm_ReadCpuRegs(), jtag_arm_Step(), reg_set::Regs::r, and reg_set::regs.
Referenced by gdb_restart().
static void gdb_load_configfile | ( | void | ) | [static] |
Load a predefined MEMORY-MAP from configfile. This is loaded after connection with GDB and just before sending the "target" connect response back to GDB.
- |
References BUFMAX, stubVar::cfgPathname, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_INFO_LOW, dbgPrintf(), gdb_monitor_Rcmd(), and stubVar::gdbComm.
Referenced by gdb_restart().
int gdb_restart | ( | void | ) |
Try to Start (or Restart) the ARM-core
- |
References stubVar::enableStepHistory, error_exit_code, gdb_check_endian_at_reset_vector(), gdb_check_thumb_support(), gdb_load_configfile(), gdb_stepHist_clean(), stubVar::gdbComm, jtag_arm_IceRT_version(), jtag_arm_identify(), jtag_arm_mmu_disable(), jtag_arm_PollDbgState(), jtag_arm_PrepareEnterDebug(), jtag_arm_ReadCP15Info(), jtag_arm_ReadCpuRegs(), jtag_cortex_core_restart(), jtag_cortex_dwt_setup_watch(), jtag_cortex_fpb_setup_break(), jtag_eos(), jtag_hard_reset(), jtag_reset(), jtag_start(), NON, and scan_chain.
Referenced by gdb_main_loop(), and gdb_monitor_Rcmd().
static enum Action gdb_action_continue | ( | int * | autoStepPtr | ) | [static] |
handle gdb's action request 'continue' or 'next'
autoStepPtr | pointer to local variable autoStep of gdb_main_loop |
TARGET_ACTION_CONTINUE | signal that core is running | |
TARGET_ACTION_SKIP_DBGPOLL | signal to continue without polling the 'debug state' again | |
TARGET_ACTION_DETACH | signal lost connection to gdb | |
TARGET_ACTION_STEP | signal to do 'step' instead |
References arm_sfa_StartTarget(), checkActionNext(), CPU, DBG_LEVEL_GDB_ARM_INFO, dbgPrintf(), stubVar::enableStepHistory, gdb_clearLookupCache(), gdb_invalidate_Ram_Buffer(), gdb_stepHist_clean(), gdb_write_data_to_console(), gdbSetupJtagTarget_Breakpoint(), gdbWriteSoftwareBreakToRAM(), isAddrOnBreakpointList(), jtag_arm_FinalExitDebug(), jtag_arm_mmu_restore(), jtag_arm_PrepareExitDebug(), reg_set::Regs::r, reg_set::regs, TARGET_ACTION_CONTINUE, TARGET_ACTION_DETACH, TARGET_ACTION_SKIP_DBGPOLL, and TARGET_ACTION_STEP.
Referenced by gdb_main_loop().
static enum Action gdb_action_step | ( | int * | autoStepPtr, | |
int * | typePtr | |||
) | [static] |
handle gdb's action request 'step'
autoStepPtr | pointer to local variable autoStep of gdb_main_loop | |
typePtr | pointer to local variable type of gdb_main_loop |
TARGET_ACTION_STEP | signal that core is running step | |
TARGET_ACTION_SKIP_DBGPOLL | signal to continue without polling the 'debug state' again | |
TARGET_ACTION_DETACH | signal lost connection to gdb |
References commonVar::allow_intr_in_step_mode, arm_sfa_StartTarget(), arm_step_emu(), CAN_BL_UNDO_ARM, CAN_BL_UNDO_THUMB, cancelActionNext(), reg_set::CPSR, CPU, CPU_CPSR_FLAG_FIQ_DISABEL, CPU_CPSR_FLAG_IRQ_DISABEL, CPU_CPSR_FLAG_THUMB, CPU_CPSR_MODE_FLAGS, CPU_CPSR_MODE_SYSTEM, CPU_CPSR_MODE_USER, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_INFO_LOW, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), commonVar::enable_step_emulation, error_exit_code, stubVar::fd, gdb_clearLookupCache(), gdb_invalidate_Ram_Buffer(), gdbLookupArmInstr(), gdbLookupThumbInstr(), is_arm_bl_instr(), is_arm_store_instr(), is_thumb_store_instr(), isAddrOnBreakpointList(), jt_arm_instr_bx_workaround(), jt_arm_instr_modifys_PC(), jt_thumb_instr_bx_workaround(), jt_thumb_instr_modifys_PC(), jtag_arm_IceRT_enable_Intr(), jtag_arm_mmu_restore(), jtag_arm_mmu_virt2phys(), jtag_arm_Step(), jtag_cortex_core_disable_Intr(), preparePossibleActionNext(), reg_set::Regs::r, reg_set::regs, TARGET_ACTION_DETACH, TARGET_ACTION_SKIP_DBGPOLL, TARGET_ACTION_STEP, THUMB_BL_FIRST_PART, THUMB_BL_MSK, THUMB_BL_OFFSET_MSK, THUMB_BL_SECOND_PART, THUMB_BLX_MSK, THUMB_BLX_SECOND_PART, and thumb_step_emu().
Referenced by gdb_main_loop().
struct gdbFreadRequest gdbFreadRequest [static] |
char debugCharReadCache[BUFMAX+2+2+1] [static] |
Referenced by clearDebugChar(), and getDebugChar().
int debugCharReadCachePos = 0 [static] |
Referenced by clearDebugChar(), and getDebugChar().
int debugCharReadCacheLen = 0 [static] |
Referenced by clearDebugChar(), and getDebugChar().
char oldDebugPacked[BUFMAX] [static] |
Referenced by getpacket(), and keeppacket().
const char hexchars[] = "0123456789abcdef" [static] |
simple method to convert a Hex-Nibble to its ASCII char value