This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to implement a "conditional breakpoint with expression" in AGDI

I'm trying to implementing a plug-in using AGDI with JTAG interface. But I can't get correct result of the expression in breakpoint when target program stopped.

There's difficulty in dealing with break-point which has expression to caculate.

Keil packages the breakpoint content in struct

struct AG_Bps  {
  struct AG_Bps *next;
  struct AG_Bps *prev;

  UL32       type : 4;      // ABREAK, CBREAK, WBREAK
  UL32    enabled : 1;      // 1:=enabled, 0:=disabled
  UL32     ReCalc : 1;      // recalc expr flag
  UL32     BytObj : 1;      // WatchBrk: 0:=Bytes, 1:=Objects

  UL32            Adr;      // Address (or Range)
  UL32         mSpace;      // memory-space
  void            *pV;      // used on VTR-access breakpoints

  UL32          tsize;      // WatchBrk: size of one object
  UL32           many;      // WatchBrk: many objects or bytes
  U16             acc;      // WatchBrk: 1:=Read, 2:=Write, 3:=ReadWrite
  U16          BitPos;      // currently not used
  UL32         number;      // BreakPoint-Number
  I32          rcount;      // Break is taken when rcount = 1

  I32          ocount;      // Original Count
  void            *ep;      // conditional-Expression
  char           *cmd;      // Exec-Command
  char          *Line;      // Breakpoint-Expression Line for Display
  char            *pF;      // module file name
  UL32          nLine;      // line number
  UC8          Opc[8];      // Opcode-Save Area for Monitors
};
typedef struct AG_Bps AG_BP;
I guess that "void * ep" should be the pointer to the expression. So I call
UINT n = pCbFunc(AG_CB_TRUEXPR, pB->ep);
to caculate the expression. pCbFunc is Keil's call back functions, and AG_CB_TRUEXPR is found in AGDI.h. But it always return 0 whether the expression is TRUE or FALSE.

This function does work when invoked as:
pCbFunc (AG_CB_EXECCMD, "U $\n");
pCbFunc (AG_CB_PROGRESS, &ProgressBar);


Would you master give me any suggestion?

0