* valops.c (value_assign): Respect parent offset when
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 33a210497bcf09dd4c7b38a3d2c2f8d8a37b7f12..7cb016ddfed55dc1796cb644cc2b78340921dff1 100644 (file)
@@ -1384,6 +1384,7 @@ read_dbx_symtab (struct objfile *objfile)
                  pst = (struct partial_symtab *) 0;
                  includes_used = 0;
                  dependencies_used = 0;
+                 has_line_numbers = 0;
                }
              else
                past_first_source_file = 1;
@@ -1508,6 +1509,7 @@ read_dbx_symtab (struct objfile *objfile)
                    pst = (struct partial_symtab *) 0;
                    includes_used = 0;
                    dependencies_used = 0;
+                   has_line_numbers = 0;
                  }
              }
 
@@ -1687,7 +1689,7 @@ pos %d"),
          sym_name = NULL;      /* pacify "gcc -Werror" */
          if (psymtab_language == language_cplus)
            {
-             char *new_name, *name = alloca (p - namestring + 1);
+             char *new_name, *name = xmalloc (p - namestring + 1);
              memcpy (name, namestring, p - namestring);
              name[p - namestring] = '\0';
              new_name = cp_canonicalize_string (name);
@@ -1698,6 +1700,7 @@ pos %d"),
                                           &objfile->objfile_obstack);
                  xfree (new_name);
                }
+              xfree (name);
            }
 
          if (sym_len == 0)
@@ -2107,6 +2110,7 @@ pos %d"),
              pst = (struct partial_symtab *) 0;
              includes_used = 0;
              dependencies_used = 0;
+             has_line_numbers = 0;
            }
          continue;
 
@@ -2790,7 +2794,11 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
             which may have an N_FUN stabs at the end of the function,
             but no N_SLINE stabs.  */
          if (sline_found_in_function)
-           record_line (current_subfile, 0, last_function_start + valu);
+           {
+             CORE_ADDR addr = last_function_start + valu;
+             record_line (current_subfile, 0,
+                          gdbarch_addr_bits_remove (gdbarch, addr));
+           }
 
          within_function = 0;
          new = pop_context ();
@@ -3006,14 +3014,15 @@ no enclosing block"));
 
       if (within_function && sline_found_in_function == 0)
        {
-         if (processing_gcc_compilation == 2)
-           record_line (current_subfile, desc, last_function_start);
-         else
-           record_line (current_subfile, desc, valu);
+         CORE_ADDR addr = processing_gcc_compilation == 2 ?
+                          last_function_start : valu;
+         record_line (current_subfile, desc,
+                      gdbarch_addr_bits_remove (gdbarch, addr));
          sline_found_in_function = 1;
        }
       else
-       record_line (current_subfile, desc, valu);
+       record_line (current_subfile, desc,
+                    gdbarch_addr_bits_remove (gdbarch, valu));
       break;
 
     case N_BCOMM:
This page took 0.02448 seconds and 4 git commands to generate.