我的程序c ++在freebsd clang中构建。但功能下是程序崩溃。请帮帮我。
Program block;
bool CHARACTER::DragonSoul_ActivateDeck(int deck_idx)
{
if (deck_idx < DRAGON_SOUL_DECK_0 || deck_idx >= DRAGON_SOUL_DECK_MAX_NUM)
{
return false;
}
if (DragonSoul_GetActiveDeck() == deck_idx)
return true;
DragonSoul_DeactivateAll();
if (!DragonSoul_IsQualified())
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¿ëÈ¥¼® »óÀÚ°¡ È°¼ºÈµÇÁö ¾Ê¾Ò½À´Ï´Ù."));
return false;
}
AddAffect(AFFECT_DRAGON_SOUL_DECK_0 + deck_idx, APPLY_NONE, 0, 0, INFINITE_AFFECT_DURATION, 0, false);
m_pointsInstant.iDragonSoulActiveDeck = deck_idx;
for (int i = DRAGON_SOUL_EQUIP_SLOT_START + DS_SLOT_MAX * deck_idx;
i < DRAGON_SOUL_EQUIP_SLOT_START + DS_SLOT_MAX * (deck_idx + 1); i++)
{
LPITEM pItem = GetInventoryItem(i);
if (NULL != pItem)
DSManager::instance().ActivateDragonSoul(pItem);
}
}
lldb debug;
* thread #1: tid = 100852, 0x081086b4 game`CHARACTER::DragonSoul_ActivateDeck(this=0x31bbd000, deck_idx=0) + 388 at char_dragonsoul.cpp:90, stop reason = signal SIGILL: privileged instruction
frame #0: 0x081086b4 game`CHARACTER::DragonSoul_ActivateDeck(this=0x31bbd000, deck_idx=0) + 388 at char_dragonsoul.cpp:90
87 LPITEM pItem = GetInventoryItem(i);
88 if (NULL != pItem)
89 DSManager::instance().ActivateDragonSoul(pItem);
-> 90 }
91 }
92
93 void CHARACTER::DragonSoul_DeactivateAll()
答案 0 :(得分:0)
使用调试器运行它(即gdb / your / program / executable,然后使用“run”)。然后做“解除”;它会告诉你导致崩溃的指令。可能是,clang发出的CPU模型的代码比你拥有的代码更新。