aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-06-14 23:43:00 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-06-15 21:39:06 +0100
commitec8e2b6d3051f0b4b2a8eee9917898e95046c62f (patch)
tree6954251f1ea7259a107f40632c8147beb231d3c7 /gdb/stack.c
parent0d3abd8cc936360f8c46502135edd2e646473438 (diff)
downloadfsf-binutils-gdb-ec8e2b6d3051f0b4b2a8eee9917898e95046c62f.zip
fsf-binutils-gdb-ec8e2b6d3051f0b4b2a8eee9917898e95046c62f.tar.gz
fsf-binutils-gdb-ec8e2b6d3051f0b4b2a8eee9917898e95046c62f.tar.bz2
gdb: Don't allow annotations to influence what else GDB prints
The annotations should be additional information printed by GDB to be consumed by users (GUIs), but GDB shouldn't reduce what it prints based on whether annotations are on or not. However, this is what happens for annotate_source_line. This commit makes annotate_source_line a void function that simply outputs the annotation information, GDB will then print the contents of the source line to the terminal in the normal way. Some tests needed to be updated after this commit. gdb/ChangeLog: * annotate.c (annotate_source_line): Change return type to void, update implementation to match. * annotate.h (annotate_source_line): Change return type to void, update header comment. * stack.c (print_frame_info): Don't change what frame information is printed based on whether annotations are on or not. gdb/testsuite/ChangeLog: * gdb.base/annota1.exp: Update expected results. * gdb.cp/annota2.exp: Likewise. * gdb.cp/annota3.exp: Likewise.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index f471efe..b3d113d 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -965,45 +965,41 @@ print_frame_info (const frame_print_options &fp_opts,
{
int mid_statement = ((print_what == SRC_LINE)
&& frame_show_address (frame, sal));
- bool done = annotate_source_line (sal.symtab, sal.line, mid_statement,
- get_frame_pc (frame));
+ annotate_source_line (sal.symtab, sal.line, mid_statement,
+ get_frame_pc (frame));
- if (!done)
+ if (deprecated_print_frame_info_listing_hook)
+ deprecated_print_frame_info_listing_hook (sal.symtab, sal.line,
+ sal.line + 1, 0);
+ else
{
- if (deprecated_print_frame_info_listing_hook)
- deprecated_print_frame_info_listing_hook (sal.symtab,
- sal.line,
- sal.line + 1, 0);
- else
- {
- struct value_print_options opts;
-
- get_user_print_options (&opts);
- /* We used to do this earlier, but that is clearly
- wrong. This function is used by many different
- parts of gdb, including normal_stop in infrun.c,
- which uses this to print out the current PC
- when we stepi/nexti into the middle of a source
- line. Only the command line really wants this
- behavior. Other UIs probably would like the
- ability to decide for themselves if it is desired. */
- if (opts.addressprint && mid_statement)
- {
- uiout->field_core_addr ("addr",
- gdbarch, get_frame_pc (frame));
- uiout->text ("\t");
- }
+ struct value_print_options opts;
- print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
+ get_user_print_options (&opts);
+ /* We used to do this earlier, but that is clearly
+ wrong. This function is used by many different
+ parts of gdb, including normal_stop in infrun.c,
+ which uses this to print out the current PC
+ when we stepi/nexti into the middle of a source
+ line. Only the command line really wants this
+ behavior. Other UIs probably would like the
+ ability to decide for themselves if it is desired. */
+ if (opts.addressprint && mid_statement)
+ {
+ uiout->field_core_addr ("addr",
+ gdbarch, get_frame_pc (frame));
+ uiout->text ("\t");
}
- }
- /* If disassemble-next-line is set to on and there is line debug
- messages, output assembly codes for next line. */
- if (disassemble_next_line == AUTO_BOOLEAN_TRUE)
- do_gdb_disassembly (get_frame_arch (frame), -1, sal.pc, sal.end);
+ print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
+ }
}
+ /* If disassemble-next-line is set to on and there is line debug
+ messages, output assembly codes for next line. */
+ if (disassemble_next_line == AUTO_BOOLEAN_TRUE)
+ do_gdb_disassembly (get_frame_arch (frame), -1, sal.pc, sal.end);
+
if (set_current_sal)
{
CORE_ADDR pc;