An inverse problem involving the Titchmarsh–Weyl m-function