Beispiel #1
0
	virtual bool GetValueAt(int32 rowIndex, int32 columnIndex, BVariant& value)
	{
		UserBreakpoint* breakpoint = fBreakpoints.ItemAt(rowIndex);
		if (breakpoint == NULL)
			return false;
		const UserBreakpointLocation& location = breakpoint->Location();

		switch (columnIndex) {
			case 0:
				value.SetTo((int32)breakpoint->IsEnabled());
				return true;
			case 1:
				value.SetTo(location.GetFunctionID()->FunctionName(),
					B_VARIANT_DONT_COPY_DATA);
				return true;
			case 2:
				if (LocatableFile* sourceFile = location.SourceFile()) {
					value.SetTo(sourceFile->Name(), B_VARIANT_DONT_COPY_DATA);
					return true;
				}
				return false;
			case 3:
				if (location.SourceFile() != NULL) {
					value.SetTo(location.GetSourceLocation().Line() + 1);
					return true;
				}
				return false;
			case 4:
				if (location.SourceFile() == NULL) {
					AutoLocker<Team> teamLocker(fTeam);
					if (UserBreakpointInstance* instance
							= breakpoint->InstanceAt(0)) {
						value.SetTo(instance->Address());
						return true;
					}
				}
				return false;
			default:
				return false;
		}
	}