S=1/2 antiferromagnetic chains and dimers on hole-doped edge-sharing CuO2 chains