aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-12-26 20:56:01 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-01-06 21:16:28 +0000
commit153d79c451fd852e97cdfecf2205781e3a13dd55 (patch)
treefbc51135a3b0f8851b917905085247e88cc30d11 /gdb/stack.c
parent66182876b46d40163e81504f7fa4f206268cb83c (diff)
downloadgdb-153d79c451fd852e97cdfecf2205781e3a13dd55.zip
gdb-153d79c451fd852e97cdfecf2205781e3a13dd55.tar.gz
gdb-153d79c451fd852e97cdfecf2205781e3a13dd55.tar.bz2
gdb: Fix backtrace with disassemble-next-line on
In this commit: commit ec8e2b6d3051f0b4b2a8eee9917898e95046c62f Date: Fri Jun 14 23:43:00 2019 +0100 gdb: Don't allow annotations to influence what else GDB prints A change was accidentally made that moved a call to do_gdb_disassembly out of an if block guarded by 'if (source_print && sal.symtab)'. The result was that if a user has 'set disassemble-next-line on' then the backtrace would now include some disassembly of a few instructions in each frame. This change was not intentional, but was not spotted by any tests. This commit restores the old behaviour and adds a test to ensure this doesn't break again in the future. gdb/ChangeLog: * stack.c (print_frame_info): Move disassemble_next_line code inside source_print block. gdb/testsuite/ChangeLog: * gdb.base/backtrace.c: New file. * gdb.base/backtrace.exp: New file. Change-Id: I47c52a202fa74be138382646b695827940178689
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index a90120a..92784c9 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1153,12 +1153,12 @@ print_frame_info (const frame_print_options &fp_opts,
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 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)
{