X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gdb%2Fsymfile.c;h=371db0dbc538b56b0f1a713f8581723017550b16;hb=569b05a56052fbdf2fa18ac7b3f4f210257f6eee;hp=babe9cf578f0b1e998b455950428e0f4387a5b24;hpb=51d7d80300853eac20339390e1ae05de71e7e1e3;p=binutils-gdb.git diff --git a/gdb/symfile.c b/gdb/symfile.c index babe9cf578f..371db0dbc53 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1374,15 +1374,13 @@ find_separate_debug_file_by_debuglink (struct objfile *objfile) dir = xstrdup (objfile->name); /* Strip off the final filename part, leaving the directory name, - followed by a slash. Objfile names should always be absolute and - tilde-expanded, so there should always be a slash in there - somewhere. */ + followed by a slash. The directory can be relative or absolute. */ for (i = strlen(dir) - 1; i >= 0; i--) { if (IS_DIR_SEPARATOR (dir[i])) break; } - gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i])); + /* If I is -1 then no directory is present there and DIR will be "". */ dir[i+1] = '\0'; /* Set I to max (strlen (canon_name), strlen (dir)). */