QString gprComment(const Register& reg)
{
	QString regString;
	int stringLength;
	QString comment;
	if(edb::v1::get_ascii_string_at_address(reg.valueAsAddress(), regString, edb::v1::config().min_string_length, 256, stringLength))
		comment=QString("ASCII \"%1\"").arg(regString);
	else if(edb::v1::get_utf16_string_at_address(reg.valueAsAddress(), regString, edb::v1::config().min_string_length, 256, stringLength))
		comment=QString("UTF16 \"%1\"").arg(regString);
	return comment;
}
void updateSegRegs(RegisterViewModel& model, const State& state) {
	static const QString sregs[]={"es","cs","ss","ds","fs","gs"};
    for(std::size_t i=0;i<sizeof(sregs)/sizeof(sregs[0]);++i) {
        QString sreg(sregs[i]);
        const auto sregValue=state[sreg].value<edb::seg_reg_t>();
		const Register base=state[sregs[i]+"_base"];
		QString comment;
		if(edb::v1::debuggeeIs32Bit() || i>=FS) {
			if(base)
				comment=QString("(%1)").arg(base.valueAsAddress().toHexString());
			else if(edb::v1::debuggeeIs32Bit() && sregValue==0)
				comment="NULL";
			else
				comment="(?)";
		}
		model.updateSegReg(i,sregValue,comment);
	}
}