public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: Handle requests to print source lines backward
@ 2019-01-08 12:49 sergiodj+buildbot
  2019-01-08 12:49 ` Failures on RHEL-s390x-m64, branch master sergiodj+buildbot
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: sergiodj+buildbot @ 2019-01-08 12:49 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT ec98a4ad5bfcba33deb5cb786c023082adbbfb46 ***

Author: Andrew Burgess <andrew.burgess@embecosm.com>
Branch: master
Commit: ec98a4ad5bfcba33deb5cb786c023082adbbfb46

gdb: Handle requests to print source lines backward

...by which I mean from high line number to low, not, actually
backward character by character!

Commit:

  commit 62f29fda90cf1d5a1899f57ef78452471c707fd6
  Date:   Tue Oct 9 22:21:05 2018 -0600

      Highlight source code using GNU Source Highlight

introduced a regression in the test gdb.linespec/explicit.exp, in
which a request is made to GDB to print a reverse sequence of lines,
from +10 to -10 from the current line number.  The expected behaviour
is that GDB prints nothing.  The above commit changed this so that GDB
now prints:

  Line number 32 out of range; /path/to/gdb/testsuite/gdb.linespec/explicit.c has 71 lines.

which is a little confusing.

This commit fixes the regression, and restores the behaviour that GDB
prints nothing.

While I was passing I noticed a call to `back` on a std::string that I
was concerned could be empty if the request for source lines returns
an empty string.  I don't know if it would be possible for a request
for lines to return an empty string, I guess it should be impossible,
in which case, maybe this should be an assertion, but adding a `empty`
check, seems like an easy and cheap safety net.

gdb/ChangeLog:

	* source.c (print_source_lines_base): Handle requests to print
	reverse line number sequences, and guard against empty lines
	string.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-01-08 22:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 12:49 [binutils-gdb] gdb: Handle requests to print source lines backward sergiodj+buildbot
2019-01-08 12:49 ` Failures on RHEL-s390x-m64, branch master sergiodj+buildbot
2019-01-08 15:18 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " sergiodj+buildbot
2019-01-08 15:25 ` Failures on Fedora-i686, " sergiodj+buildbot
2019-01-08 15:49 ` Failures on Debian-s390x-native-gdbserver-m64, " sergiodj+buildbot
2019-01-08 15:51 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2019-01-08 16:06 ` Failures on Debian-s390x-m64, " sergiodj+buildbot
2019-01-08 16:22 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2019-01-08 16:22 ` Failures on Fedora-x86_64-m64, " sergiodj+buildbot
2019-01-08 16:23 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2019-01-08 16:31 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2019-01-08 16:55 ` Failures on Fedora-x86_64-m32, " sergiodj+buildbot
2019-01-08 17:28 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2019-01-08 21:06 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, " sergiodj+buildbot
2019-01-08 22:39 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " sergiodj+buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).