* linespec.c (convert_linespec_to_sal): Don't add
authorKeith Seitz <keiths@redhat.com>
Mon, 23 Jul 2012 20:40:07 +0000 (20:40 +0000)
committerKeith Seitz <keiths@redhat.com>
Mon, 23 Jul 2012 20:40:07 +0000 (20:40 +0000)
any symbols to the result vector if symbol_to_sal
returns zero.

gdb/ChangeLog
gdb/linespec.c

index 3449cc6e04df2ee1fac2b472c29f4ccff23dee0e..4f756ad611e74782a0890e2ea3e7132f6f74660c 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-23  Keith Seitz  <keiths@redhat.com>
 
        * linespec.c (decode_objc): Record the function name
index 9bc2dbe47d5aa4302ef94c2bd7f986f34579a2bc..e85be681a1bdae517c5b7114d900415a7dba9bce 100644 (file)
@@ -1860,9 +1860,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), 0);
+         if (symbol_to_sal (&sal, state->funfirstline, sym))
+           add_sal_to_sals (state, &sals, &sal,
+                            SYMBOL_NATURAL_NAME (sym), 0);
        }
     }
   else if (ls->function_symbols != NULL || ls->minimal_symbols != NULL)
@@ -1886,8 +1886,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), 0);
            }