C++ (Cpp) DEBUG Examples

C++ (Cpp) DEBUG - 30 examples found. These are the top rated real world C++ (Cpp) examples of DEBUG extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
VOID
EFIAPI
OnSimpleFileSystemInstall (
    IN EFI_EVENT        Event,
    IN VOID             *Context
)
{
    EFI_STATUS                Status;
    UINTN                     HandleSize;
    EFI_HANDLE                Handle;
    EFI_DEVICE_PATH_PROTOCOL  *Device;
    VS_DEV                    *Dev;
    EFI_FILE_PROTOCOL         *File;
    UINTN                     NumBytes;

    Dev = (VS_DEV *) Context;

    if (VAR_FILE_DEVICEPATH (Dev) != NULL &&
            !EFI_ERROR (CheckStoreExists (VAR_FILE_DEVICEPATH (Dev)))
       ) {
        DEBUG ((EFI_D_ERROR, "FileStorage: Already mapped!\n"));
        return ;
    }

    while (TRUE) {
        HandleSize = sizeof (EFI_HANDLE);
        Status = gBS->LocateHandle (
                     ByRegisterNotify,
                     NULL,
                     mSFSRegistration,
                     &HandleSize,
                     &Handle
                 );
        if (EFI_ERROR (Status)) {
            return ;
        }

        Status = CheckStore (Handle, VAR_FILE_VOLUMEID (Dev), &Device);
        if (!EFI_ERROR (Status)) {
            break;
        }
    }

    VAR_FILE_DEVICEPATH (Dev) = Device;
    Status = OpenStore (
                 VAR_FILE_DEVICEPATH (Dev),
                 VAR_FILE_FILEPATH (Dev),
                 EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ | EFI_FILE_MODE_CREATE,
                 &File
             );
    ASSERT_EFI_ERROR (Status);

    NumBytes = Dev->Size;
    Status = File->Write (File, &NumBytes, VAR_DATA_PTR (Dev));
    ASSERT_EFI_ERROR (Status);
    // KEN: bugbug here if closing file, volume handle will be free,
    // and system will be hang when accessing volume handle in future.
    //FileClose (File);
    DEBUG ((EFI_D_ERROR, "FileStorage: Mapped to file!\n"));
}
/**

  This function registers the found memory configuration with the PEI Foundation.

  The usage model is that the PEIM that discovers the permanent memory shall invoke this service.
  This routine will hold discoveried memory information into PeiCore's private data,
  and set SwitchStackSignal flag. After PEIM who discovery memory is dispatched,
  PeiDispatcher will migrate temporary memory to permenement memory.

  @param PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
  @param MemoryBegin        Start of memory address.
  @param MemoryLength       Length of memory.

  @return EFI_SUCCESS Always success.

**/
EFI_STATUS
EFIAPI
PeiInstallPeiMemory (
    IN CONST EFI_PEI_SERVICES  **PeiServices,
    IN EFI_PHYSICAL_ADDRESS    MemoryBegin,
    IN UINT64                  MemoryLength
)
{
    PEI_CORE_INSTANCE                     *PrivateData;

    DEBUG ((EFI_D_INFO, "PeiInstallPeiMemory MemoryBegin 0x%LX, MemoryLength 0x%LX\n", MemoryBegin, MemoryLength));
    PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);

    //
    // PEI_SERVICE.InstallPeiMemory should only be called one time during whole PEI phase.
    // If it is invoked more than one time, ASSERT information is given for developer debugging in debug tip and
    // simply return EFI_SUCESS in release tip to ignore it.
    //
    if (PrivateData->PeiMemoryInstalled) {
        DEBUG ((EFI_D_ERROR, "ERROR: PeiInstallPeiMemory is called more than once!\n"));
        ASSERT (PrivateData->PeiMemoryInstalled);
        return EFI_SUCCESS;
    }

    PrivateData->PhysicalMemoryBegin   = MemoryBegin;
    PrivateData->PhysicalMemoryLength  = MemoryLength;
    PrivateData->FreePhysicalMemoryTop = MemoryBegin + MemoryLength;

    PrivateData->SwitchStackSignal      = TRUE;

    return EFI_SUCCESS;
}
Example #3
0
ng_sixlowpan_ctx_t *ng_sixlowpan_ctx_lookup_addr(const ng_ipv6_addr_t *addr)
{
    uint8_t best = 0;
    ng_sixlowpan_ctx_t *res = NULL;

    mutex_lock(&_ctx_mutex);

    for (unsigned int id = 0; id < NG_SIXLOWPAN_CTX_SIZE; id++) {
        if (_still_valid(id)) {
            uint8_t match = ng_ipv6_addr_match_prefix(&_ctxs[id].prefix, addr);

            if ((_ctxs[id].prefix_len <= match) && (match > best)) {
                best = match;
                res = &(_ctxs[id]);
            }
        }
    }

    mutex_unlock(&_ctx_mutex);

#if ENABLE_DEBUG
    if (res != NULL) {
        DEBUG("6lo ctx: found context (%u, %s/%" PRIu8 ") ", res->id,
              ng_ipv6_addr_to_str(ipv6str, &res->prefix, sizeof(ipv6str)),
              res->prefix_len);
        DEBUG("for address %s\n", ng_ipv6_addr_to_str(ipv6str, addr, sizeof(ipv6str)));
    }
#endif

    return res;
}
void
empathy_dispatch_operation_approve (EmpathyDispatchOperation *operation)
{
    EmpathyDispatchOperationPriv *priv;

    g_return_if_fail (EMPATHY_IS_DISPATCH_OPERATION (operation));

    priv = GET_PRIV (operation);

    if (priv->status == EMPATHY_DISPATCHER_OPERATION_STATE_APPROVING)
    {
        DEBUG ("Approving operation %s",
               empathy_dispatch_operation_get_object_path (operation));

        empathy_dispatch_operation_set_status (operation,
                                               EMPATHY_DISPATCHER_OPERATION_STATE_DISPATCHING);

        g_signal_emit (operation, signals[APPROVED], 0);
    }
    else if (priv->status < EMPATHY_DISPATCHER_OPERATION_STATE_APPROVING)
    {
        DEBUG ("Pre-approving operation %s",
               empathy_dispatch_operation_get_object_path (operation));
        priv->approved = TRUE;
    }
    else
    {
        DEBUG (
            "Ignoring approval for %s as it's already past the approval stage",
            empathy_dispatch_operation_get_object_path (operation));
    }
}
Example #5
0
static BOOL push_message(ubi_slList *list_head, char *buf, int msg_len)
{
    pending_message_list *msg = (pending_message_list *)
                                malloc(sizeof(pending_message_list));

    if(msg == NULL)
    {
        DEBUG(0,("push_message: malloc fail (1)\n"));
        return False;
    }

    msg->msg_buf = (char *)malloc(msg_len);
    if(msg->msg_buf == NULL)
    {
        DEBUG(0,("push_message: malloc fail (2)\n"));
        free((char *)msg);
        return False;
    }

    memcpy(msg->msg_buf, buf, msg_len);
    msg->msg_len = msg_len;

    ubi_slAddTail( list_head, msg);

    return True;
}
Example #6
0
void FH2Server::MsgLogout(QueueMessage & msg, FH2RemoteClient & client)
{
    std::string str, err;

    msg.Pop(err);

    // send message
    msg.Reset();
    msg.SetID(MSG_MESSAGE);
    str = "logout player: " + client.name;
    if(err.size())
    {
        str.append("\n");
        str.append(err);
    }
    msg.Push(str);

    DEBUG(DBG_NETWORK, DBG_INFO, str);
    DEBUG(DBG_NETWORK, DBG_INFO, "size: " << std::dec << msg.DtSz() << " bytes");

    clients.Send2All(msg, client.id);

    if(client.Modes(ST_ADMIN)) clients.SetNewAdmin(client.id);

    client.SetModes(ST_SHUTDOWN);

    DELAY(100);

    // send players
    UpdateColors();
    SendUpdatePlayers(msg, client.id);

    // FIXME: logout
    // if(Modes(ST_INGAME)) world.GetKingdom(player_color).SetControl(CONTROL_AI); // FIXME: MSGLOGOUT: INGAME AND CURRENT TURN?
}