The Swift satellite allows us to use gamma-ray bursts (GRBs) to peer through the hearts of star forming galaxies through cosmic time. Our open collaboration, representing most of the active European researchers in this field, builds a public legacy sample of GRB X-shooter spectroscopy while Swift continues to fly. To date, our spectroscopy of more than 100 GRB afterglows covers a redshift range from 0.059 to about 8 (Tanvir et al. 2009, Nature 461, 1254), with more than 20 robust afterglow-based metallicity measurements (over a redshift range from 1.7 to 5.9). With afterglow spectroscopy (throughout the electromagnetic spectrum from X-rays to the sub-mm) we can hence characterize the properties of star-forming galaxies over cosmic history in terms of redshift, metallicity, molecular content, ISM temperature, UV-flux density, etc.. These observations provide key information on the final evolution of the most massive stars collapsing into black holes, with the potential of probing the epoch of the formation of the first (very massive) stars.
VLT/X-shooter (Vernet et al. 2011, A&A 536, A105) is in many ways the ideal GRB follow-up instrument and indeed GRB follow-up was one of the primary science cases behind the instrument design and implementation. Due to the wide wavelength coverage of X-shooter, in the same observation one can detect molecular H2 absorption near the atmospheric cut-off and many strong emission lines from the host galaxy in the near-infrared (e.g., Friis et al. 2015, MNRAS 451, 167). For example, we have measured a metallicity of 0.1 Z⊙ for GRB 100219A at z = 4.67 (Thöne et al. 2013, MNRAS 428, 3590), 0.02 Z⊙ for GRB 111008A at z = 4.99 (Sparre et al. 2014, ApJ 785, 150) and 0.05 Z⊙ for GRB 130606A at z = 5.91 (Hartoog et al. 2015, A&A 580, 139). In the latter, the very high value of [Al/Fe]=2.40 ± 0.78 might be due to a proton capture process and may be a signature of a previous generation of massive (perhaps even the first) stars. Reconciling the abundance patterns of GRB absorbers, other types of absorbers (in particular QSO DLAs), and old stars in the Local Group is an important long-term goal of this program (see Sparre et al. 2014, ApJ 785, 150). Metallicities are also measured from host emission lines (Krühler et al. 2015, A&A 581, A125). GRB spectroscopy also allows us to determine the dust content of their environments, both through analysis of the depletion pattern and the measurement of the associated extinction (Japelj et al. 2015, A&A 451, 2050). This way one can quantify the dust-to-metals ratio and its evolution with redshift. The detection of GRBs at z > 6 shows that GRBs have become competitive as a tool to identifying galaxies at the highest redshifts and unsurpassed in providing detailed abundance information via absorption line spectroscopy.