public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-tromey-ambiguous-linespec: use VEC_empty in a few spots
@ 2011-10-13 20:49 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2011-10-13 20:49 UTC (permalink / raw)
  To: archer-commits

The branch, archer-tromey-ambiguous-linespec has been updated
       via  64337da142291d342d79e2004681759c88756296 (commit)
       via  0d0fafeba297c6c7531d62af313407d92efb8609 (commit)
       via  bd9b7dec5078a3e9f269f0c1339b2b940c8aab83 (commit)
      from  ff828e7bf22579b143cb46f068a0cd3da3d4610d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 64337da142291d342d79e2004681759c88756296
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Oct 13 14:49:20 2011 -0600

    use VEC_empty in a few spots

commit 0d0fafeba297c6c7531d62af313407d92efb8609
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Oct 13 14:33:50 2011 -0600

    do not check type of minsym when adding it

commit bd9b7dec5078a3e9f269f0c1339b2b940c8aab83
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Oct 13 14:20:18 2011 -0600

    some regression fixes

-----------------------------------------------------------------------

Summary of changes:
 gdb/linespec.c |   23 +++++++++++++++--------
 gdb/symtab.c   |    8 ++++++--
 2 files changed, 21 insertions(+), 10 deletions(-)

First 500 lines of diff:
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 16091ce..b9f4fdc 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1637,7 +1637,7 @@ decode_compound (struct linespec_state *self,
 
   /* If a class has been found, then we're in case 1 above.  So we
      look up "fun" as a method of those classes.  */
-  if (sym_classes)
+  if (!VEC_empty (symbolp, sym_classes))
     {
       /* Arg token is not digits => try it as a function name.
 	 Find the next token (everything up to end or next
@@ -2062,7 +2062,7 @@ hash_symtab (const void *a)
   char *fullname;
 
   fullname = symtab_to_fullname (s);
-  return htab_hash_string (fullname);
+  return htab_hash_string (fullname ? fullname : s->filename);
 }
 
 /* Equality function for a symtab.  */
@@ -2075,7 +2075,7 @@ eq_symtab (const void *a, const void *b)
   char *fa = symtab_to_fullname (sa);
   char *fb = symtab_to_fullname (sb);
 
-  return strcmp (fa, fb) == 0;
+  return strcmp (fa ? fa : sa->filename, fb ? fb : sb->filename) == 0;
 }
 
 /* Callback for iterate_over_symtabs.  */
@@ -2328,6 +2328,16 @@ decode_all_digits (struct linespec_state *self,
       VEC_free (CORE_ADDR, pcs);
     }
 
+  if (values.nelts == 0)
+    {
+      if (self->user_filename)
+	throw_error (NOT_FOUND_ERROR, _("No line %d in file named %s."),
+		     val.line, self->user_filename);
+      else
+	throw_error (NOT_FOUND_ERROR, _("No line %d in the current file."),
+		     val.line);
+    }
+
   return values;
 }
 
@@ -2571,11 +2581,8 @@ check_minsym (struct minimal_symbol *minsym, void *d)
 {
   struct collect_info *info = d;
 
-  if ((MSYMBOL_TYPE (minsym) == mst_file_text
-       || MSYMBOL_TYPE (minsym) == mst_file_data
-       || MSYMBOL_TYPE (minsym) == mst_file_bss)
-      && maybe_add_address (info->state->addr_set, info->objfile->pspace,
-			    SYMBOL_VALUE_ADDRESS (minsym)))
+  if (maybe_add_address (info->state->addr_set, info->objfile->pspace,
+			 SYMBOL_VALUE_ADDRESS (minsym)))
     minsym_found (info->state, info->objfile, minsym, &info->result);
 }
 
diff --git a/gdb/symtab.c b/gdb/symtab.c
index f4ffe38..81a9de1 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2373,13 +2373,17 @@ find_pcs_for_symtab_line (struct symtab *symtab, int line)
 
       idx = find_line_common (LINETABLE (symtab), line, &was_exact, start);
       if (!was_exact)
-	break;
+	{
+	  if (VEC_empty (CORE_ADDR, result))
+	    VEC_safe_push (CORE_ADDR, result, LINETABLE (symtab)->item[idx].pc);
+	  break;
+	}
 
       VEC_safe_push (CORE_ADDR, result, LINETABLE (symtab)->item[idx].pc);
       start = idx + 1;
     }
 
-  if (result == NULL)
+  if (VEC_empty (CORE_ADDR, result))
     return result;
 
   qsort (VEC_address (CORE_ADDR, result), VEC_length (CORE_ADDR, result),


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-13 20:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-13 20:49 [SCM] archer-tromey-ambiguous-linespec: use VEC_empty in a few spots tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).