public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Have 'thread|frame apply' style their output.
Date: Sun, 28 Apr 2019 01:28:00 -0000	[thread overview]
Message-ID: <8a522c6cab56bd55f1454638786f999f6f636354@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 8a522c6cab56bd55f1454638786f999f6f636354 ***

Author: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Branch: master
Commit: 8a522c6cab56bd55f1454638786f999f6f636354

Have 'thread|frame apply' style their output.

'thread|frame apply CMD' launches CMD so that CMD output goes to a string_file.
This patch ensures that string_file for such CMD output contains
style escape sequences that 'thread|frame apply' will later on
output on the real terminal, so as to have CMD output properly styled.

The idea is to have the class ui_file having overridable methods
to indicate that the output to this ui_file should be done using
'terminal' behaviour such as styling.
Then these methods are overriden in string_file so that a specially
constructed string_file will get output with style escape sequences.

After this patch, the output of CMD by thread|frame apply CMD is styled
similarly as when CMD is launched directly.
Note that string_file (term_out true) could also support wrapping,
but this is not done (yet?).

Tested on debian/amd64.

gdb/ChangeLog
2019-04-27  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	Support style in 'frame|thread apply'

	* gdbcmd.h (execute_command_to_string): New term_out parameter.
	* record.c (record_start, record_stop): Update callers of
	execute_command_to_string with false.
	* ui-file.h (class ui_file): New term_out and can_emit_style_escape
	methods.
	(class string_file): New constructor with term_out parameter.
	Override methods term_out and can_emit_style_escape.  New member
	term_out.
	(class stdio_file): Override can_emit_style_escape.
	(class tee_file): Override term_out and can_emit_style_escape.
	* utils.h (can_emit_style_escape): Remove.
	* utils.c (can_emit_style_escape): Likewise.
	Update all callers of can_emit_style_escape (SOMESTREAM) to
	SOMESTREAM->can_emit_style_escape.
	* source-cache.c (source_cache::get_source_lines): Likewise.
	* stack.c (frame_apply_command_count): Call execute_command_to_string
	passing the term_out characteristic of the current gdb_stdout.
	* thread.c (thr_try_catch_cmd): Likewise.
	* top.c (execute_command_to_string): pass term_out parameter
	to construct the string_file for the command output.
	* ui-file.c (term_cli_styling): New function (most code moved
	from utils.c can_emit_style_escape).
	(string_file::string_file, string_file::can_emit_style_escape,
	stdio_file::can_emit_style_escape, tee_file::term_out,
	tee_file::can_emit_style_escape): New functions.


             reply	other threads:[~2019-04-28  1:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28  1:28 sergiodj+buildbot [this message]
2019-04-28  2:03 ` Failures on Debian-s390x-native-extended-gdbserver-m64, branch master sergiodj+buildbot
2019-04-28  2:22 ` Failures on Debian-s390x-native-gdbserver-m64, " sergiodj+buildbot
2019-04-28  2:36 ` Failures on Debian-s390x-m64, " sergiodj+buildbot
2019-05-02  5:35 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master *** BREAKAGE *** sergiodj+buildbot
2019-05-02  5:39 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2019-05-02  5:41 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2019-05-02  5:46 ` Failures on Fedora-i686, branch master sergiodj+buildbot
2019-05-02  5:52 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-m64, branch master *** BREAKAGE *** sergiodj+buildbot
2019-05-02 10:50 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2019-05-04  8:57 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2019-05-05  5:57 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-m32, " sergiodj+buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a522c6cab56bd55f1454638786f999f6f636354@gdb-build \
    --to=sergiodj+buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).