Clean up source file error reporting
authorTom Tromey <tromey@adacore.com>
Mon, 22 Jul 2019 21:20:24 +0000 (15:20 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 6 Aug 2019 14:04:33 +0000 (08:04 -0600)
commitb08b16c8391bbcd706a4aaa4b09509e7c2b8c676
tree29164c2b0b5dff2ac4b43a22044b1c6abcf2d97d
parentcb44333d99548bbbf7be06387a31877ee9322ab4
Clean up source file error reporting

print_source_lines_base reopens the source file every time that a
source line is to be printed.  However, there's no need to do this so
frequently -- it's enough to do it when switching source files, and
otherwise rely on the cache.

The code seems to try to avoid these multiple opens; at a guess I'd
say something just got confused along the way.

This patch fixes the problem by reorganizing the code both to make it
more clear, and to ensure that reopens only occur when the "last
source visited" changes.

gdb/ChangeLog
2019-08-06  Tom Tromey  <tromey@adacore.com>

* source.c (last_source_error): Now bool.
(print_source_lines_base): Make "noprint" bool.  Only open
source file when last_source_visited changes.
gdb/ChangeLog
gdb/source.c
This page took 0.024564 seconds and 4 git commands to generate.