gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / buildsym.c
index 84cb44277a4a4a9984cefcd6386d0fc9218eb4f8..33bf6523e905bb2a9f54ab3e7e007c9795fba18c 100644 (file)
@@ -213,7 +213,7 @@ buildsym_compunit::finish_block_internal
      CORE_ADDR start, CORE_ADDR end,
      int is_global, int expandable)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (m_objfile);
+  struct gdbarch *gdbarch = m_objfile->arch ();
   struct pending *next, *next1;
   struct block *block;
   struct pending_block *pblock;
@@ -254,7 +254,7 @@ buildsym_compunit::finish_block_internal
       SYMBOL_BLOCK_VALUE (symbol) = block;
       BLOCK_FUNCTION (block) = symbol;
 
-      if (TYPE_NFIELDS (ftype) <= 0)
+      if (ftype->num_fields () <= 0)
        {
          /* No parameter type information is recorded with the
             function's type.  Set that from the type of the
@@ -271,9 +271,10 @@ buildsym_compunit::finish_block_internal
            }
          if (nparams > 0)
            {
-             TYPE_NFIELDS (ftype) = nparams;
-             TYPE_FIELDS (ftype) = (struct field *)
-               TYPE_ALLOC (ftype, nparams * sizeof (struct field));
+             ftype->set_num_fields (nparams);
+             ftype->set_fields
+               ((struct field *)
+                TYPE_ALLOC (ftype, nparams * sizeof (struct field)));
 
              iparams = 0;
              /* Here we want to directly access the dictionary, because
@@ -666,7 +667,7 @@ buildsym_compunit::pop_subfile ()
 
 void
 buildsym_compunit::record_line (struct subfile *subfile, int line,
-                               CORE_ADDR pc)
+                               CORE_ADDR pc, bool is_stmt)
 {
   struct linetable_entry *e;
 
@@ -681,7 +682,7 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
       m_have_line_numbers = true;
     }
 
-  if (subfile->line_vector->nitems + 1 >= subfile->line_vector_length)
+  if (subfile->line_vector->nitems >= subfile->line_vector_length)
     {
       subfile->line_vector_length *= 2;
       subfile->line_vector = (struct linetable *)
@@ -704,18 +705,20 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
      end of sequence markers.  All we lose is the ability to set
      breakpoints at some lines which contain no instructions
      anyway.  */
-  if (line == 0 && subfile->line_vector->nitems > 0)
+  if (line == 0)
     {
-      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
-      while (subfile->line_vector->nitems > 0 && e->pc == pc)
+      while (subfile->line_vector->nitems > 0)
        {
-         e--;
+         e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
+         if (e->pc != pc)
+           break;
          subfile->line_vector->nitems--;
        }
     }
 
   e = subfile->line_vector->item + subfile->line_vector->nitems++;
   e->line = line;
+  e->is_stmt = is_stmt ? 1 : 0;
   e->pc = pc;
 }
 
This page took 0.028821 seconds and 4 git commands to generate.