* exec.c: #include "arch-utils.h"
[deliverable/binutils-gdb.git] / gdb / linespec.c
index a00cffe46132447828e9aae6f3e3de6088ff9ea3..b3a46b46a2313130a310bb15e161275572de0eac 100644 (file)
@@ -1,14 +1,14 @@
 /* Parser for linespec for the GNU debugger, GDB.
 
    Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -17,9 +17,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -965,6 +963,7 @@ decode_indirect (char **argptr)
   values.sals[0] = find_pc_line (pc, 0);
   values.sals[0].pc = pc;
   values.sals[0].section = find_pc_overlay (pc);
+  values.sals[0].explicit_pc = 1;
 
   return values;
 }
@@ -1105,7 +1104,7 @@ decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab,
   if (i1 > 0)
     {
       sym_arr = (struct symbol **) alloca ((i1 + 1) * sizeof (struct symbol *));
-      sym_arr[i1] = 0;
+      sym_arr[i1] = NULL;
 
       copy = find_imps (file_symtab, block, *argptr, sym_arr, &i1, &i2); 
       *argptr = copy;
@@ -1145,7 +1144,7 @@ decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab,
       else
        {
          /* The only match was a non-debuggable symbol.  */
-         values.sals[0].symtab = 0;
+         values.sals[0].symtab = NULL;
          values.sals[0].line = 0;
          values.sals[0].end = 0;
          values.sals[0].pc = SYMBOL_VALUE_ADDRESS (sym_arr[0]);
@@ -1411,7 +1410,7 @@ find_method (int funfirstline, char ***canonical, char *saved_arg,
             char *copy, struct type *t, struct symbol *sym_class)
 {
   struct symtabs_and_lines values;
-  struct symbol *sym = 0;
+  struct symbol *sym = NULL;
   int i1;      /*  Counter for the symbol array.  */
   struct symbol **sym_arr =  alloca (total_number_of_methods (t)
                                     * sizeof (struct symbol *));
@@ -1573,7 +1572,7 @@ decode_all_digits (char **argptr, struct symtab *default_symtab,
   sign = none;
 
   /* We might need a canonical line spec if no file was specified.  */
-  int need_canonical = (file_symtab == 0) ? 1 : 0;
+  int need_canonical = (file_symtab == NULL) ? 1 : 0;
 
   init_sal (&val);
 
@@ -1635,6 +1634,7 @@ decode_all_digits (char **argptr, struct symtab *default_symtab,
   values.nelts = 1;
   if (need_canonical)
     build_canonical_line_spec (values.sals, NULL, canonical);
+  values.sals[0].explicit_line = 1;
   return values;
 }
 
@@ -1675,7 +1675,7 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab,
 
       /* Look up entire name as a symbol first.  */
       sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab);
-      file_symtab = (struct symtab *) 0;
+      file_symtab = (struct symtab *) NULL;
       need_canonical = 1;
       /* Symbol was found --> jump to normal symbol processing.  */
       if (sym)
@@ -1689,7 +1689,6 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab,
        return minsym_found (funfirstline, msymbol);
 
       /* Not a user variable or function -- must be convenience variable.  */
-      need_canonical = (file_symtab == 0) ? 1 : 0;
       valx = value_of_internalvar (lookup_internalvar (copy + 1));
       if (TYPE_CODE (value_type (valx)) != TYPE_CODE_INT)
        error (_("Convenience variables used in line specs must have integer values."));
This page took 0.025706 seconds and 4 git commands to generate.