public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Markus Metzger <markus.t.metzger@intel.com>
To: dje@google.com
Cc: gdb-patches@sourceware.org, palves@redhat.com
Subject: [PATCH v2 4/4] btrace: add instruction-history /s and fix documentation
Date: Mon, 19 Oct 2015 09:23:00 -0000	[thread overview]
Message-ID: <1445246610-11645-5-git-send-email-markus.t.metzger@intel.com> (raw)
In-Reply-To: <1445246610-11645-1-git-send-email-markus.t.metzger@intel.com>

Add support for the /s modifier of the "record instruction-history" command.  It
behaves exactly like /m and prints disassembled instructions in the order in
which they were recorded with interleaved sources.  We accept /s in addition
to /m to align with the "disassemble" command.

The "record instruction-history" modifiers were not documented.  Document
all of them.

2015-10-19  Markus Metzger <markus.t.metzger@intel.com>

gdb/
	* record.c (get_insn_history_modifiers): Set DISASSEMBLY_SOURCE
	instead of DISASSEMBLY_SOURCE_DEPRECATED.  Also accept /s.
	(_initialize_record): Document the /s modifier.
	* NEWS: Announce record instruction-history's new /s modifier.

doc/
	* gdb.texinfo (Process Record and Replay): Document "record
	instruction-history" modifiers.

2015-10-19  Markus Metzger <markus.t.metzger@intel.com>
---
 gdb/NEWS            |  3 +++
 gdb/doc/gdb.texinfo | 14 ++++++++++++++
 gdb/record.c        |  5 +++--
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/gdb/NEWS b/gdb/NEWS
index b2b1e99..78d1328 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -51,6 +51,9 @@ show remote multiprocess-extensions-packet
   The "/m" option is now considered deprecated: its "source-centric"
   output hasn't proved useful in practice.
 
+* The "record instruction-history" command accepts a new modifier: /s.
+  It behaves exactly like /m and prints mixed source+disassembly.
+
 * The "set scheduler-locking" command supports a new mode "replay".
   It behaves like "off" in record mode and like "on" in replay mode.
 
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 3c1f785..3e49fc7 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -6741,6 +6741,20 @@ default, ten instructions are disassembled.  This can be changed using
 the @code{set record instruction-history-size} command.  Instructions
 are printed in execution order.
 
+It can also print mixed source+disassembly by specifying the @code{/m}
+or @code{/s} modifier and print the raw instructions in hex as well as
+in symbolic form by specifying the @code{/r} modifier.
+
+The current position marker is printed for the instruction at the
+current program counter value.  This instruction can appear multiple
+times in the trace and the current position marker will be printed
+every time.  To omit the current position marker, specify the
+@code{/p} modifier.
+
+To better align the printed instructions when the trace contains
+instructions from more than one function, the function name may be
+omitted by specifying the @code{/f} modifier.
+
 Speculatively executed instructions are prefixed with @samp{?}.  This
 feature is not available for all recording formats.
 
diff --git a/gdb/record.c b/gdb/record.c
index 71ef973..b06bec7 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -458,7 +458,8 @@ get_insn_history_modifiers (char **arg)
 	  switch (*args)
 	    {
 	    case 'm':
-	      modifiers |= DISASSEMBLY_SOURCE_DEPRECATED;
+	    case 's':
+	      modifiers |= DISASSEMBLY_SOURCE;
 	      modifiers |= DISASSEMBLY_FILENAME;
 	      break;
 	    case 'r':
@@ -817,7 +818,7 @@ Argument is instruction number, as shown by 'info record'."),
 
   add_cmd ("instruction-history", class_obscure, cmd_record_insn_history, _("\
 Print disassembled instructions stored in the execution log.\n\
-With a /m modifier, source lines are included (if available).\n\
+With a /m or /s modifier, source lines are included (if available).\n\
 With a /r modifier, raw instructions in hex are included.\n\
 With a /f modifier, function names are omitted.\n\
 With a /p modifier, current position markers are omitted.\n\
-- 
1.8.3.1

  reply	other threads:[~2015-10-19  9:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19  9:26 [PATCH v2 0/4] disasm, record: fix "record instruction-history /m" Markus Metzger
2015-10-19  9:23 ` Markus Metzger [this message]
2015-10-19  9:37   ` [PATCH v2 4/4] btrace: add instruction-history /s and fix documentation Eli Zaretskii
2015-10-19  9:42     ` Metzger, Markus T
2015-10-26  3:47       ` Doug Evans
2015-10-19  9:23 ` [PATCH v2 3/4] btrace: change record instruction-history /m Markus Metzger
2015-10-26  3:47   ` Doug Evans
2015-10-26 12:55     ` Metzger, Markus T
2015-10-26 21:15       ` Doug Evans
2015-10-19  9:26 ` [PATCH v2 1/4] disasm: split dump_insns Markus Metzger
2015-10-26  3:47   ` Doug Evans
2015-10-19  9:27 ` [PATCH v2 2/4] disasm: add struct disasm_insn to describe to-be-disassembled instruction Markus Metzger
2015-10-26  3:47   ` Doug Evans
2015-10-26 12:55     ` Metzger, Markus T
2015-10-26 20:57       ` Doug Evans
2015-10-26  3:47 ` [PATCH v2 0/4] disasm, record: fix "record instruction-history /m" Doug Evans

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=1445246610-11645-5-git-send-email-markus.t.metzger@intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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).