private String getMemberString(AbstractPdb pdb, AbstractMemberMsType member) {
		RecordNumber r = member.getFieldTypeRecordNumber();
		AbstractMsType t = pdb.getTypeRecord(r);
		boolean isZeroLengthArray =
			t instanceof AbstractArrayMsType a && BigInteger.ZERO.equals(a.getSize());
		return String.format(
			"struct.addMember(\"%s\", %sT, %s, %s, %d, null);",
			member.getName(), getTypeName(pdb, r), isZeroLengthArray,
			getAttsString(member.getAttribute()), member.getOffset().intValue());
	}
Developer script to capture items from Program and PDB for developing tests
Ghidra/Features/PDB/developer_scripts/CaptureHelperScript.java