public int getPositionInParent() {
		DWARFProgram dprog = getProgram();
		int parentIndex = dprog.getParentIndex(dieIndex);
		if (parentIndex < 0) {
			return -1;
		}
		IntArrayList childIndexes = dprog.getDIEChildIndexes(parentIndex);
		for (int i = 0; i < childIndexes.size(); i++) {
			if (childIndexes.get(i) == dieIndex) {
				return i;
			}
		}
		// only way to get here is if our in-memory indexes are corrupt / incorrect
		throw new RuntimeException("DWARF DIE index failure.");
	}
Returns the ordinal position of this DIE record in its parent's list of children.

@return index of ourself in our parent, or -1 if root DIE
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DebugInfoEntry.java