private void getVxTables(Map<Address, NameAndBytes> info, String pattern) {
		SymbolIterator iter = symbolManager.getSymbolIterator(pattern, true);
		while (iter.hasNext()) {
			Symbol symbol = iter.next();
			Address addr = symbol.getAddress();
			Symbol any;
			Address anyAddr = progMaxAddr;
			SymbolIterator anyIter = symbolManager.getSymbolIterator(addr, true);
			while (anyIter.hasNext()) {
				any = anyIter.next();
				anyAddr = any.getAddress();
				if (anyAddr.compareTo(addr) > 0) {
					break;
				}
			}
			Long length = anyAddr.getUnsignedOffset() - addr.getUnsignedOffset();
			String name = symbol.getName();
			byte[] bytes = new byte[length.intValue()];
			try {
				memory.getBytes(addr, bytes);
			}
			catch (MemoryAccessException e) {
				Msg.warn(this, "Memory access error");
			}
			info.put(addr, new NameAndBytes(name, bytes));
		}
	}
Developer script to capture items from Program and PDB for developing tests
Ghidra/Features/PDB/developer_scripts/CaptureHelperScript.java