コード例 #1
0
inline bool
protocolled (TY val2check)
{
    return contains ( command2::check_.str()
                      , lexical_cast<string> (val2check)
                    );
}
コード例 #2
0
 virtual void
 run (Arg) 
   {
     // Prepare an (test)Index (dummy "session")
     PPIdx testSession (build_testScopes());
     
     ElementQuery queryAPI;
     
     MORef<DummyMO> dummy1 = queryAPI.pick (elementID_contains("MO2"));
     CHECK (dummy1);
     CHECK (dummy1->isValid());
     INFO  (test, "Location in Tree: %s", cStr(ScopePath(dummy1.getPlacement())));
     
     string elementID = dummy1->operator string();
     CHECK (contains (elementID, "MO2"));
     
     string specificID = elementID.substr(10);   // should contain the random int-ID
     MORef<DummyMO> dummy2;
     CHECK (!dummy2);
     dummy2 = queryAPI.pick (elementID_contains(specificID));
     CHECK (dummy2);                         // found the same object again
     CHECK (dummy2->isValid());
     CHECK (dummy2 == dummy1);
     
     
     // put aside a new handle holding onto the MObject
     PDum newPlacement(dummy1.getPlacement());
     CHECK (testSession->contains(dummy1));
     CHECK (!testSession->contains(newPlacement));
     
     // and now remove the placement and all contained elements
     testSession->clear (dummy1);
     CHECK (!testSession->contains(dummy1));
     
     MORef<DummyMO> findAgain = queryAPI.pick (elementID_contains(specificID));
     CHECK (!findAgain);     // empty result because searched element was removed from session...
     
     MORef<DummyMO> otherElm = queryAPI.pick (elementID_contains("MO21"));
     CHECK (otherElm);    // now pick just some other arbitrary element 
     
     testSession->insert(newPlacement, otherElm);
     dummy2 = queryAPI.pick (elementID_contains(specificID));
     CHECK (dummy2);
     CHECK (dummy2 != dummy1);
     CHECK (dummy2 != newPlacement);
     CHECK (isSharedPointee(newPlacement, dummy2.getPlacement()));
     CHECK (Scope::containing (dummy2.getRef()) == Scope (otherElm));
     INFO  (test, "New treelocation: %s", cStr(ScopePath(dummy2.getPlacement())));
   }
コード例 #3
0
void DialogEditGPR::setupEntriesAndLabels()
{
	resetLayout();
	switch(bitSize_)
	{
	case 8:
		hideColumn(GPR8H_COL);
		hideColumn(GPR16_COL);
	case 16:
		hideColumn(GPR32_COL);
	case 32:
		hideColumn(GPR64_COL);
	case 64:
		break;
	default:
		Q_ASSERT("Unsupported bitSize" && 0);
	}

	const QString regName=reg.name().toUpper();
	if(bitSize_==64)
		columnLabel(GPR64_COL)->setText(regName);
	else if(bitSize_==32)
		columnLabel(GPR32_COL)->setText(regName);
	else if(bitSize_==16)
		columnLabel(GPR16_COL)->setText(regName);
	else
		columnLabel(GPR8L_COL)->setText(regName);

	static const auto x86GPRsWithHighBytesAddressable=util::make_array<QString>("EAX","ECX","EDX","EBX","RAX","RCX","RDX","RBX");
	static const auto x86GPRsWithHighBytesNotAddressable=util::make_array<QString>("ESP","EBP","ESI","EDI","RSP","RBP","RSI","RDI");
	static const auto upperGPRs64=util::make_array<QString>("R8","R9","R10","R11","R12","R13","R14","R15");

	bool x86GPR=false, upperGPR64=false;
	using util::contains;
	if(contains(x86GPRsWithHighBytesNotAddressable,regName))
	{
		x86GPR=true;
		hideColumn(GPR8H_COL);
		if(bitSize_==32)
		{
			hideColumn(GPR8L_COL); // In 32 bit mode low bytes also can't be addressed
			hideRow(CHAR_ROW);
		}
	}
	else if(contains(x86GPRsWithHighBytesAddressable,regName))
		x86GPR=true;
	else if(contains(upperGPRs64,regName))
		upperGPR64=true;

	if(x86GPR)
	{
		if(bitSize_==64)
			columnLabel(GPR32_COL)->setText("E"+regName.mid(1));
		columnLabel(GPR16_COL)->setText(regName.mid(1));
		columnLabel(GPR8H_COL)->setText(regName.mid(1,1)+"H");
		if(bitSize_==64 && !contains(x86GPRsWithHighBytesAddressable,regName))
			columnLabel(GPR8L_COL)->setText(regName.mid(1)+"L");
		else
			columnLabel(GPR8L_COL)->setText(regName.mid(1,1)+"L");
	}
	else if(upperGPR64)
	{
		columnLabel(GPR32_COL)->setText(regName+"D");
		columnLabel(GPR16_COL)->setText(regName+"W");
		columnLabel(GPR8L_COL)->setText(regName+"B");
		hideColumn(GPR8H_COL);
	}
	else
	{
		// These have hex only format
		hideColumn(GPR8H_COL);
		if(bitSize_!=8)
			hideColumn(GPR8L_COL);
		if(bitSize_!=16)
			hideColumn(GPR16_COL);
		if(bitSize_!=32)
			hideColumn(GPR32_COL);
		hideRow(SIGNED_ROW);
		hideRow(UNSIGNED_ROW);
		hideRow(CHAR_ROW);
	}
}