From: Andrew Burgess <andrew.burgess@embecosm.com>
To: "Metzger, Markus T" <markus.t.metzger@intel.com>
Cc: Pedro Alves <palves@redhat.com>,
"dje@google.com" <dje@google.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 3/6] disas: add gdb_disassembly_vec
Date: Mon, 12 Oct 2015 08:59:00 -0000 [thread overview]
Message-ID: <20151012085901.GA12446@embecosm.com> (raw)
In-Reply-To: <A78C989F6D9628469189715575E55B23331E5852@IRSMSX104.ger.corp.intel.com>
* Metzger, Markus T <markus.t.metzger@intel.com> [2015-10-09 13:16:30 +0000]:
> > -----Original Message-----
> > From: Pedro Alves [mailto:palves@redhat.com]
> > Sent: Friday, October 9, 2015 2:50 PM
> > To: Metzger, Markus T; dje@google.com
> > Cc: gdb-patches@sourceware.org
> > Subject: Re: [PATCH 3/6] disas: add gdb_disassembly_vec
> >
> > On 09/21/2015 03:54 PM, Markus Metzger wrote:
> > > Add a new function to disassemble a vector of instructions instead of a
> > > contiguous range of instructions. The instructions can be in any order
> > > and may originate from different functions.
> > >
> > > Change gdb_disassembly to create a vector of instructions from its low,
> > > high, and how_many arguments.
> >
> > I wonder whether the representation could/should be based on a vector
> > of struct mem_range's instead of a vector of instructions. I'm assuming
> > the normal case is that we're disassembling ranges of more than
> > one instruction. Just seems wasteful for something like
> >
> > (gdb) disassemble 0x3000000000,0x7000000000
> >
> > to allocate so much memory. But maybe I simply misunderstood.
>
> You didn't. It really is a vector of instructions - we do need additional information
> for each instruction (see [PATCH 2/6]). Also the instructions come in the order
> in which they were executed; not in the order of their memory address.
>
> I expected the normal usage of "disassemble" to be one function or maybe
> a few dozen instructions at a time.
This is definitely not correct.
This is probably a sensible assumption for CLI users, however,
disassemble requests from the MI are frequently larger, and based
around address ranges, happily spanning both function and compilation
unit boundaries.
The reason is that the driver might be trying to fill a possibly large
window (with look ahead) with disassembled instructions; at the same
time the driver will ask for the source information so that the user
can click a disassembled instruction and instantly be taken to the
corresponding source line.
I guess whether this is a "large" number of instruction is up for
debate, but I think we should assume that a couple of hundred is not
out of the question.
I don't know if this makes much of a difference to your proposed
change, but please do bear this in mind.
Thanks,
Andrew
next prev parent reply other threads:[~2015-10-12 8:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-21 14:55 [PATCH 0/6] disasm, record: fix "record instruction-history /m" Markus Metzger
2015-09-21 14:54 ` [PATCH 2/6] disasm: add struct disas_insn to describe to-be-disassembled instruction Markus Metzger
2015-10-09 12:51 ` Pedro Alves
2015-10-12 8:44 ` Metzger, Markus T
2015-10-20 11:29 ` Pedro Alves
2015-09-21 14:54 ` [PATCH 1/6] disasm: change dump_insns to print a single instruction Markus Metzger
2015-09-21 14:54 ` [PATCH 6/6] btrace: use gdb_disassembly_vec and new source interleaving method Markus Metzger
2015-09-21 21:48 ` Andrew Burgess
2015-09-22 6:18 ` Metzger, Markus T
2015-09-21 14:55 ` [PATCH 4/6] disasm: use entire line table in line_has_code_p Markus Metzger
2015-09-21 14:55 ` [PATCH 5/6] disasm: determine preceding lines independent of last_line Markus Metzger
2015-09-21 14:55 ` [PATCH 3/6] disas: add gdb_disassembly_vec Markus Metzger
2015-10-09 12:49 ` Pedro Alves
2015-10-09 13:17 ` Metzger, Markus T
2015-10-12 8:59 ` Andrew Burgess [this message]
2015-10-18 20:39 ` Doug Evans
2015-10-12 14:19 ` [PATCH 0/6] disasm, record: fix "record instruction-history /m" Metzger, Markus T
2015-10-18 21:17 ` Doug Evans
2015-10-19 9:35 ` Metzger, Markus T
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=20151012085901.GA12446@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=markus.t.metzger@intel.com \
--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