]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* linespec.c (convert_linespec_to_sal): Don't add
authorKeith Seitz <keiths@redhat.com>
Mon, 23 Jul 2012 21:12:34 +0000 (21:12 +0000)
committerKeith Seitz <keiths@redhat.com>
Mon, 23 Jul 2012 21:12:34 +0000 (21:12 +0000)
any symbols to the result vector if symbol_to_sal
returns zero.

gdb/ChangeLog
gdb/linespec.c

index 660bb5769bef87a4a75488fd954207fb51600d1a..3e99445c8ba3fa629b94983cbbb9754d0be86026 100644 (file)
@@ -1,3 +1,9 @@
+2012-07-23  Keith Seitz  <keiths@redhat.com>
+
+       * linespec.c (convert_linespec_to_sal): Don't add
+       any symbols to the result vector if symbol_to_sal
+       returns zero.
+
 2012-07-20  Doug Evans  <dje@google.com>
 
        * NEWS: Document new options "set/show use-deprecated-index-sections",
index 4156694bc4fb23f7871d2afc454252be308c6645..c8388b85c618b796de46258c0bde5dd0641e6c0b 100644 (file)
@@ -1854,9 +1854,9 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
 
       for (i = 0; VEC_iterate (symbolp, ls->labels.label_symbols, i, sym); ++i)
        {
-         symbol_to_sal (&sal, state->funfirstline, sym);
-         add_sal_to_sals (state, &sals, &sal,
-                          SYMBOL_NATURAL_NAME (sym));
+         if (symbol_to_sal (&sal, state->funfirstline, sym))
+           add_sal_to_sals (state, &sals, &sal,
+                            SYMBOL_NATURAL_NAME (sym));
        }
     }
   else if (ls->function_symbols != NULL || ls->minimal_symbols != NULL)
@@ -1880,8 +1880,8 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
            {
              pspace = SYMTAB_PSPACE (SYMBOL_SYMTAB (sym));
              set_current_program_space (pspace);
-             symbol_to_sal (&sal, state->funfirstline, sym);
-             if (maybe_add_address (state->addr_set, pspace, sal.pc))
+             if (symbol_to_sal (&sal, state->funfirstline, sym)
+                 && maybe_add_address (state->addr_set, pspace, sal.pc))
                add_sal_to_sals (state, &sals, &sal, SYMBOL_NATURAL_NAME (sym));
            }
        }