[gdb/testsuite] Accept new complex print style in mixed-lang-stack.exp
[deliverable/binutils-gdb.git] / gdb / source.c
index 051caf5c57fa13f6bcf0af2d155d5d67d0104ea2..50de93952bb04a2568830b9224129786b6312695 100644 (file)
@@ -1160,7 +1160,7 @@ open_source_file (struct symtab *s)
          std::string srcpath;
          if (IS_ABSOLUTE_PATH (s->filename))
            srcpath = s->filename;
-         else
+         else if (SYMTAB_DIRNAME (s) != nullptr)
            {
              srcpath = SYMTAB_DIRNAME (s);
              srcpath += SLASH_STRING;
@@ -1170,7 +1170,7 @@ open_source_file (struct symtab *s)
          const struct bfd_build_id *build_id = build_id_bfd_get (ofp->obfd);
 
          /* Query debuginfod for the source file.  */
-         if (build_id != nullptr)
+         if (build_id != nullptr && !srcpath.empty ())
            fd = debuginfod_source_query (build_id->data,
                                          build_id->size,
                                          srcpath.c_str (),
This page took 0.02549 seconds and 4 git commands to generate.