Remove dwarf2_per_cu_data::text_offset
[deliverable/binutils-gdb.git] / gdb / stack.c
index f67a151aeee96f45bdebeae6f9e96c1def4d58c9..265e764dc242dca48dda56da9ef5ea69fbf11d79 100644 (file)
@@ -1126,10 +1126,25 @@ print_frame_info (const frame_print_options &fp_opts,
     {
       int mid_statement = ((print_what == SRC_LINE)
                           && frame_show_address (frame, sal));
-      annotate_source_line (sal.symtab, sal.line, mid_statement,
-                           get_frame_pc (frame));
-
-      if (deprecated_print_frame_info_listing_hook)
+      if (annotation_level > 0
+         && annotate_source_line (sal.symtab, sal.line, mid_statement,
+                                  get_frame_pc (frame)))
+       {
+         /* The call to ANNOTATE_SOURCE_LINE already printed the
+            annotation for this source line, so we avoid the two cases
+            below and do not print the actual source line.  The
+            documentation for annotations makes it clear that the source
+            line annotation is printed __instead__ of printing the source
+            line, not as well as.
+
+            However, if we fail to print the source line, which usually
+            means either the source file is missing, or the requested
+            line is out of range of the file, then we don't print the
+            source annotation, and will pass through the "normal" print
+            source line code below, the expectation is that this code
+            will print an appropriate error.  */
+       }
+      else if (deprecated_print_frame_info_listing_hook)
        deprecated_print_frame_info_listing_hook (sal.symtab, sal.line,
                                                  sal.line + 1, 0);
       else
@@ -3485,7 +3500,7 @@ With a negative COUNT, print outermost -COUNT frames."),
 
   add_com_alias ("bt", "backtrace", class_stack, 0);
 
-  add_com_alias ("where", "backtrace", class_alias, 0);
+  add_com_alias ("where", "backtrace", class_stack, 0);
   add_info ("stack", backtrace_command,
            _("Backtrace of the stack, or innermost COUNT frames."));
   add_info_alias ("s", "stack", 1);
This page took 0.028333 seconds and 4 git commands to generate.