KizarmProbe.
 Vše Třídy Soubory Funkce Proměnné Výčty Hodnoty výčtu Definice maker Skupiny Stránky
cortexmx.h
Zobrazit dokumentaci tohoto souboru.
1 #ifndef CORTEXMX_H
2 #define CORTEXMX_H
3 
7 #include "target.h"
8 #include "command.h"
9 #include "commandset.h"
10 
11 #define CORTEXM_MAX_WATCHPOINTS 4
12 #define CORTEXM_MAX_BREAKPOINTS 6
13 struct cortexm_priv {
15  bool stepping;
16  bool on_bkpt;
18  struct wp_unit_s {
19  uint32_t addr;
20  uint8_t type;
21  uint8_t size;
22  } hw_watchpoint[CORTEXM_MAX_WATCHPOINTS];
23  unsigned hw_watchpoint_max;
25  uint32_t hw_breakpoint[CORTEXM_MAX_BREAKPOINTS];
26  unsigned hw_breakpoint_max;
28  uint32_t demcr;
30  uint32_t syscall;
31  uint32_t errno;
32  uint32_t byte_count;
33 };
34 
45 class CortexMx : public Target, public CommandSet {
46 
47  public:
54  CortexMx (GdbServer * s, const char* name);
56  virtual bool probe (void);
58  void remove (void);
60  const char* getName (void);
62  bool vector_catch (int argc, const char *argv[]);
64  bool attach (void);
66  void detach (void);
68  int regs_read (void *data);
70  int regs_write (const void *data);
72  int pc_write (const uint32_t val);
74  uint32_t pc_read (void);
76  void reset (void);
78  void halt_resume (bool step);
80  int halt_wait (void);
82  void halt_request (void);
84  int fault_unwind (void);
86  int set_hw_bp (uint32_t addr);
88  int clear_hw_bp (uint32_t addr);
90  int set_hw_wp (uint8_t type, uint32_t addr, uint8_t len);
92  int clear_hw_wp (uint8_t type, uint32_t addr, uint8_t len);
94  int check_hw_wp (uint32_t *addr);
96  int hostio_request (void);
98  void hostio_reply (int32_t retcode, uint32_t errcode);
100  virtual int Handler (int argc, const char* argv[]);
101  private:
103  Command cCatch;
105  cortexm_priv priv;
106 };
107 
108 #endif // CORTEXMX_H
bool vector_catch(int argc, const char *argv[])
převzato z black magic
int check_hw_wp(uint32_t *addr)
zjisti stav
int regs_write(const void *data)
zapiš zpět registry targetu
Zpracování příkazů Monitoru (gdb "monitor")
Části targetu společné pro všechny Cortex-M procesory. Dědí jednak Target a jeho metody (většinou pur...
Definition: cortexmx.h:45
void halt_resume(bool step)
pokračuj ve vykonávání programu (příp. po instrukcích)
#define CORTEXM_MAX_WATCHPOINTS
architecture says up to 15, no implementation has > 4
Definition: cortexmx.h:11
uint32_t val
DATA.
Definition: swdp.h:164
Definition: target.h:7
uint32_t demcr
Copy of DEMCR for vector-catch.
Definition: cortexmx.h:28
CortexMx(GdbServer *s, const char *name)
Konstruktor. I zde je potřeba zpětný přístup na GdbServer.
uint32_t syscall
Semihosting state.
Definition: cortexmx.h:30
Zapouzdření skupiny příkazů
int pc_write(const uint32_t val)
zapiš program counter do targetu
int hostio_request(void)
hostio_request
void detach(void)
Odpoj target od gdb.
uint32_t pc_read(void)
přečti program counter z targetu
bool attach(void)
Připoj target ke gdb.
virtual bool probe(void)
Test, zda je jádro připojeno - jen na začátku (monitor scan)
int halt_wait(void)
target stojí ? (funkce nečeká, jen se ptá)
int set_hw_wp(uint8_t type, uint32_t addr, uint8_t len)
nastav wathpoint
#define CORTEXM_MAX_BREAKPOINTS
Definition: cortexmx.h:12
void reset(void)
zrezetuj target
Zapouzdření skupiny příkazů I původní řešení mělo něco podobného. Zde je to oboustranně vázaný spojov...
Definition: commandset.h:17
int clear_hw_bp(uint32_t addr)
zruš breakpoint
int clear_hw_wp(uint8_t type, uint32_t addr, uint8_t len)
zruš wathpoint
int regs_read(void *data)
načti registry targetu
int set_hw_bp(uint32_t addr)
nastav breakpoint
virtual int Handler(int argc, const char *argv[])
handler pro příkaz
int fault_unwind(void)
Jakási obnova ???
Watchpoint unit status.
Definition: cortexmx.h:18
Tohle je celé z Black Magic, blíže nekomentuji.
Definition: cortexmx.h:14
void halt_request(void)
příkaz zastav target
Zpracování příkazů Monitoru (gdb "monitor") Původní C-čkový přístup byl jiný, možná jednodušší...
Definition: command.h:16
void hostio_reply(int32_t retcode, uint32_t errcode)
hostio_reply
const char * getName(void)
Vrátí privátní jméno jádra.
Vlastní obsluha gdb paketů. Nejpodstatnější část celého programu. Vše se děje v přerušení od USB...
Definition: gdbserver.h:28