private Variable getStackVariable(DBRecord record) {

		int offset = record.getIntValue(OldStackVariableDBAdapter.STACK_VAR_OFFSET_COL);
		long dataTypeId = record.getLongValue(OldStackVariableDBAdapter.STACK_VAR_DATA_TYPE_ID_COL);
		//int dtLength = record.getIntValue(OldStackVariableDBAdapter.STACK_VAR_DT_LENGTH_COL);
		String name = record.getString(OldStackVariableDBAdapter.STACK_VAR_NAME_COL);
		String comment = record.getString(OldStackVariableDBAdapter.STACK_VAR_COMMENT_COL);

		DataType dataType = functionManager.getDataType(dataTypeId);

		Variable var;
		try {
			if (isParameterOffset(offset)) {
				var = new ParameterImpl(name, dataType, offset, functionManager.getProgram());
			}
			else {
				var = new LocalVariableImpl(name, dataType, offset, functionManager.getProgram());
			}
		}
		catch (InvalidInputException e) {
			throw new RuntimeException(e); // unexpected
		}
		catch (AddressOutOfBoundsException e) {
			Msg.error(this, "Invalid stack variable '" + name + "' in function at " +
				function.getEntryPoint() + ": " + e.getMessage());
			try {
				var = new LocalVariableImpl(name, 0, dataType, VariableStorage.BAD_STORAGE,
					functionManager.getProgram());
			}
			catch (InvalidInputException e1) {
				throw new RuntimeException(e); // unexpected
			}
		}
		if (comment != null && comment.length() != 0) {
			var.setComment(comment);
		}
		return var;
	}
Load the stack variables for this frame.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/oldfunction/OldStackFrameDB.java