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

Access Breakpoint of AGDI driver using C51

I am using AGDI drivers for developing C51 Emulators. I have question about access breakpoint that check the Read and Write checkboxes and click Define.
But it always show error message: Breakpoint definition error. See Command Window for detailed error information.
The Command Window show:*** error 73: unsupported breakpoint type.

What parameters or callback functions should I set in AGDI driver? let uVision support Read and Write of Access breakpoint.

I want to implement function in AGDI.cpp as follow, but the process never into switch-case AG_WBREAK block whatever I set breakpoint dialog.

int SaCBreaks(DWORD set, DWORD nA) { // 1:=set, 0:=clear
    AG_BP* pB;
    int nR;

    abreaks = 0; // clear number of address Bp's
    cbreaks = 0; // clear number of conditional Bp's
    wbreaks = 0; // clear number of access Bp's

    for (pB = *pBhead; pB; pB = pB->next) {
        if (!pB->enabled) continue;
        switch (pB->type) {
            case AG_ABREAK: ++abreaks; break; // increase Nr. of AddressBreaks
            case AG_CBREAK: ++cbreaks; break; // increase Nr. of CondBreaks
            case AG_WBREAK: ++wbreaks; break; // increase Nr. of WatchBreaks
    }
}

if (s
return (nR);
}

  • Hi thank you for asking a question in the Arm Community. Please may you look at the list of Support Forums that we have and let me know where your question is best suited to? https://community.arm.com/support-forums/ 
    Many thanks.

  • Hi Derek,

    I think the reason is very simple why µVision rejects access breakpoints. Your AGDI driver receives a Bp-accept query and your driver will most likely answer with 'NULL'. Please see the following code which will be similar to yours:

    _EXPO_ AG_BP *AG_BreakFunc (U16 nCode, U16 n1, GADR *pA, AG_BP *pBp)  {
      U16         *pB;
    
      if (PlayDead) return (NULL);       // driver is disconnected
    
      if (nCode != 5)  {                 // not BpAccept function
        pB = MGetAttr (pA->Adr);         // get attribute location
        if (!pB) return (NULL);          // invalid, cancel
      }
    
      switch (nCode)  {
        case 2:                          // Notification: 'pB' will be unlinked
          *pB &= ~(AG_ATR_BREAK | AG_ATR_BPDIS);
          break;
        case 3:                          // not used.
        case 6:                          // not used.
        case 7:                          // not used.
        case 8:                          // not used.
          break;
        case 1:                          // Notification: 'pB' will be linked
        case 4:                          // 'pB->enabled' may have changed
          if (pBp->enabled)  {
            *pB = (*pB & ~AG_ATR_BPDIS) | AG_ATR_BREAK; // enable it
          }
          else  {
            *pB = (*pB & ~AG_ATR_BREAK) | AG_ATR_BPDIS; // disable it
          }
          break;
    
        case 5:                          // Bp-accept function
          if (pBp->type == AG_WBREAK)  { // read/write access Bp's are not supported here.
            return (NULL);
          }
          break;
      }
    
    

    See 'case 5'. With a call to 'AG_BreakFunc' with nCode=5, µVision checks if a specific breakpoint type is supported with your debug adapter, or not. When this function returns a NULL, the breakpoint is not supported. If you comment or modify the code in 'case 5' so that this function does not return NULL, the breakpoint will be added to the list of breakpoints.

    I hope this solves your problem.