@@ -6421,10 +6421,16 @@ linux_qxfer_libraries_svr4 (const char *annex, unsigned char *readbuf,
{
if (linux_read_memory (priv->r_debug + lmo->r_version_offset,
(unsigned char *) &r_version,
- sizeof (r_version)) != 0
- || r_version != 1)
+ sizeof (r_version)) != 0)
+ warning ("error reading r_debug version from memory");
+ else if (r_version != 1)
{
- warning ("unexpected r_debug version %d", r_version);
+ /* If the version is incorrect, it probably means that
+ r_debug hasn't been initialized yet. Just silently
+ return an error. We will try again in a subsequent
+ pass through here, e.g. at the next library load
+ event. */
+ return -1;
}
else if (read_one_ptr (priv->r_debug + lmo->r_map_offset,
&lm_addr, ptr_size) != 0)