Don't close thread handles provided by WaitForDebugEvent
[deliverable/binutils-gdb.git] / gdb / annotate.c
index cf9e88cee512add96fdff06e33d4fec22f3a961d..0a4e2f27cac0cb8579cc263f034fd51fe79bd783 100644 (file)
@@ -435,7 +435,7 @@ annotate_source (const char *filename, int line, int character, int mid,
 
 /* See annotate.h.  */
 
-void
+bool
 annotate_source_line (struct symtab *s, int line, int mid_statement,
                      CORE_ADDR pc)
 {
@@ -443,16 +443,25 @@ annotate_source_line (struct symtab *s, int line, int mid_statement,
     {
       const std::vector<off_t> *offsets;
       if (!g_source_cache.get_line_charpos (s, &offsets))
-       return;
-
-      /* Don't index off the end of the line_charpos array.  */
+       return false;
       if (line > offsets->size ())
-       return;
+       return false;
 
       annotate_source (s->fullname, line, (int) (*offsets)[line - 1],
-                      mid_statement, get_objfile_arch (SYMTAB_OBJFILE (s)),
+                      mid_statement, SYMTAB_OBJFILE (s)->arch (),
                       pc);
+
+      /* Update the current symtab and line.  */
+      symtab_and_line sal;
+      sal.pspace = SYMTAB_PSPACE (s);
+      sal.symtab = s;
+      sal.line = line;
+      set_current_source_symtab_and_line (sal);
+
+      return true;
     }
+
+  return false;
 }
 
 
This page took 0.024524 seconds and 4 git commands to generate.