All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
@ 2013-08-09 19:19 Richard Henderson
  2013-08-09 19:19 ` [Qemu-devel] [PATCH 1/2] disas: Implement fallback to dump object code as hex Richard Henderson
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Richard Henderson @ 2013-08-09 19:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: jcmvbkbc, gxt, proljc, claudio.fontana, peter.maydell

We have one host platform (aarch64), and three target platforms
(openrisc, unicore32, xtensa) with no built-in disassembly support,
thanks largely to gplv3 silliness.

Here's a first-cut at handling these cases with an external tool.
The qemu-produced dump file contains just a hex dump of bytes, and
a perl script is provided to pass those bytes through objdump.

I've lightly tested this with aarch64 host running on Foundation.
Feedback appreciated.


r~


Richard Henderson (2):
  disas: Implement fallback to dump object code as hex
  disas: Add disas-objdump.pl

 disas.c                  | 46 +++++++++++++++++++------
 scripts/disas-objdump.pl | 87 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+), 10 deletions(-)
 create mode 100755 scripts/disas-objdump.pl

-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 1/2] disas: Implement fallback to dump object code as hex
  2013-08-09 19:19 [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Richard Henderson
@ 2013-08-09 19:19 ` Richard Henderson
  2013-08-09 19:19 ` [Qemu-devel] [PATCH 2/2] disas: Add disas-objdump.pl Richard Henderson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2013-08-09 19:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: jcmvbkbc, gxt, proljc, claudio.fontana, peter.maydell

The OBJD-[HT] tags will be used by a script to run the hex blob
through objdump --disassemble.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 disas.c | 46 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 36 insertions(+), 10 deletions(-)

diff --git a/disas.c b/disas.c
index 71007fb..bd74e85 100644
--- a/disas.c
+++ b/disas.c
@@ -158,6 +158,34 @@ print_insn_thumb1(bfd_vma pc, disassemble_info *info)
 }
 #endif
 
+static int print_insn_objdump(bfd_vma pc, disassemble_info *info,
+                              const char *prefix)
+{
+    int i, n = info->buffer_length;
+    uint8_t *buf = g_malloc(n);
+
+    info->read_memory_func(pc, buf, n, info);
+
+    for (i = 0; i < n; ++i) {
+        if (i % 32 == 0) {
+            info->fprintf_func(info->stream, "\n%s: ", prefix);
+        }
+        info->fprintf_func(info->stream, "%02x", buf[i]);
+    }
+
+    return n;
+}
+
+static int print_insn_od_host(bfd_vma pc, disassemble_info *info)
+{
+    return print_insn_objdump(pc, info, "OBJD-H");
+}
+
+static int print_insn_od_target(bfd_vma pc, disassemble_info *info)
+{
+    return print_insn_objdump(pc, info, "OBJD-T");
+}
+
 /* Disassemble this for me please... (debugging). 'flags' has the following
    values:
     i386 - 1 means 16 bit code, 2 means 64 bit code
@@ -171,7 +199,7 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
     target_ulong pc;
     int count;
     CPUDebug s;
-    int (*print_insn)(bfd_vma pc, disassemble_info *info);
+    int (*print_insn)(bfd_vma pc, disassemble_info *info) = NULL;
 
     INIT_DISASSEMBLE_INFO(s.info, out, fprintf);
 
@@ -263,11 +291,10 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
 #elif defined(TARGET_LM32)
     s.info.mach = bfd_mach_lm32;
     print_insn = print_insn_lm32;
-#else
-    fprintf(out, "0x" TARGET_FMT_lx
-	    ": Asm output not supported on this arch\n", code);
-    return;
 #endif
+    if (print_insn == NULL) {
+        print_insn = print_insn_od_target;
+    }
 
     for (pc = code; size > 0; pc += count, size -= count) {
 	fprintf(out, "0x" TARGET_FMT_lx ":  ", pc);
@@ -303,7 +330,7 @@ void disas(FILE *out, void *code, unsigned long size)
     uintptr_t pc;
     int count;
     CPUDebug s;
-    int (*print_insn)(bfd_vma pc, disassemble_info *info);
+    int (*print_insn)(bfd_vma pc, disassemble_info *info) = NULL;
 
     INIT_DISASSEMBLE_INFO(s.info, out, fprintf);
     s.info.print_address_func = generic_print_host_address;
@@ -347,11 +374,10 @@ void disas(FILE *out, void *code, unsigned long size)
     print_insn = print_insn_hppa;
 #elif defined(__ia64__)
     print_insn = print_insn_ia64;
-#else
-    fprintf(out, "0x%lx: Asm output not supported on this arch\n",
-	    (long) code);
-    return;
 #endif
+    if (print_insn == NULL) {
+        print_insn = print_insn_od_host;
+    }
     for (pc = (uintptr_t)code; size > 0; pc += count, size -= count) {
         fprintf(out, "0x%08" PRIxPTR ":  ", pc);
         count = print_insn(pc, &s.info);
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 2/2] disas: Add disas-objdump.pl
  2013-08-09 19:19 [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Richard Henderson
  2013-08-09 19:19 ` [Qemu-devel] [PATCH 1/2] disas: Implement fallback to dump object code as hex Richard Henderson
@ 2013-08-09 19:19 ` Richard Henderson
  2013-08-10  4:08   ` Max Filippov
  2013-08-10  1:54 ` [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Jia Liu
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2013-08-09 19:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: jcmvbkbc, gxt, proljc, claudio.fontana, peter.maydell

The script massages the output produced for architectures that are
not supported internally by qemu though an external objdump program
for disassembly.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 scripts/disas-objdump.pl | 87 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100755 scripts/disas-objdump.pl

diff --git a/scripts/disas-objdump.pl b/scripts/disas-objdump.pl
new file mode 100755
index 0000000..c66a629
--- /dev/null
+++ b/scripts/disas-objdump.pl
@@ -0,0 +1,87 @@
+#!/usr/bin/perl -w
+
+use File::Temp qw/ tempfile /;
+use Getopt::Long;
+
+# Default to the system objdump if a cross-compiler edition not given.
+my $aobjdump = "objdump";
+my $hobjdump = "";
+my $tobjdump = "";
+my $hmachine = "";
+my $tmachine = "";
+
+GetOptions ('O|objdump=s' => \$aobjdump,
+            'host-objdump=s' => \$hobjdump,
+            'target-objdump=s' => \$tobjdump,
+            'h|host-machine=s' => \$hmachine,
+            't|target-machine=s' => \$tmachine);
+
+# But we can't default the machines.  Sanity check that we've at least one.
+die "No host or target machine type" if !$hmachine && !$tmachine;
+
+# Reuse one temp file for all of the hunks.
+my ($outh, $outname) = tempfile();
+binmode($outh);
+END { unlink $outname; }
+
+# Pre-construct the command-lines for executing the dump.
+sub mkobjcommand ($$) {
+    my ($cmd, $mach) = @_;
+    return 0 if !$mach;
+    $cmd = $aobjdump if !$cmd;
+    return "$cmd -m $mach --disassemble-all -b binary $outname";
+}
+
+$objdump[1] = mkobjcommand($hobjdump, $hmachine);
+$objdump[2] = mkobjcommand($tobjdump, $tmachine);
+
+# Zero-initialize current dumping state.
+my $mem = "";
+my $inobjd = 0;
+
+sub objcommand {
+    my $ret = $objdump[$inobjd];
+    if (!$ret) {
+        die "Host machine type not specified" if $inobjd == 1;
+        die "Target machine type not specified" if $inobjd == 2;
+        die "Internal error";
+    }
+    return $ret;
+}
+
+while (<>) {
+    # Collect the data from the relevant OBJD-* lines.
+    if (/^OBJD-H: /) {
+        die "Internal error" if $inobjd == 2;
+        $mem = $mem . pack("H*", substr($_, 8, -1));
+        $inobjd = 1;
+    } elsif (/^OBJD-T: /) {
+        die "Internal error" if $inobjd == 1;
+        $mem = $mem . pack("H*", substr($_, 8, -1));
+        $inobjd = 2;
+    }
+    # ... which will always be followed by a blank line,
+    # at which point we should produce our dump.
+    elsif ($inobjd) {
+        # Rewrite the temp file in one go; it will usually be small.
+        sysseek $outh, 0, 0;
+        truncate $outh, 0;
+        syswrite $outh, $mem;
+
+        # Pipe from objdump...
+        open IN, "-|", objcommand();
+
+        # ... copying all but the first 7 lines of boilerplate to our stdout.
+	my $i = 0;
+	while (<IN>) {
+	    print if (++$i > 7);
+        }
+        close IN;
+        print "\n";
+
+        $mem = "";
+        $inobjd = 0;
+    } else {
+        print;
+    }
+}
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-09 19:19 [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Richard Henderson
  2013-08-09 19:19 ` [Qemu-devel] [PATCH 1/2] disas: Implement fallback to dump object code as hex Richard Henderson
  2013-08-09 19:19 ` [Qemu-devel] [PATCH 2/2] disas: Add disas-objdump.pl Richard Henderson
@ 2013-08-10  1:54 ` Jia Liu
  2013-08-10  9:16 ` Peter Maydell
  2013-08-11  8:59 ` Blue Swirl
  4 siblings, 0 replies; 14+ messages in thread
From: Jia Liu @ 2013-08-10  1:54 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Max Filippov, Guan Xuetao, qemu-devel, claudio.fontana, Peter Maydell

Hi Richard,

On Sat, Aug 10, 2013 at 3:19 AM, Richard Henderson <rth@twiddle.net> wrote:
> We have one host platform (aarch64), and three target platforms
> (openrisc, unicore32, xtensa) with no built-in disassembly support,
> thanks largely to gplv3 silliness.

Thank you for doing this for or32.

>
> Here's a first-cut at handling these cases with an external tool.
> The qemu-produced dump file contains just a hex dump of bytes, and
> a perl script is provided to pass those bytes through objdump.
>
> I've lightly tested this with aarch64 host running on Foundation.
> Feedback appreciated.
>
>
> r~
>
>
> Richard Henderson (2):
>   disas: Implement fallback to dump object code as hex
>   disas: Add disas-objdump.pl
>
>  disas.c                  | 46 +++++++++++++++++++------
>  scripts/disas-objdump.pl | 87 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 123 insertions(+), 10 deletions(-)
>  create mode 100755 scripts/disas-objdump.pl
>
> --
> 1.8.3.1
>

Regards,
Jia

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

* Re: [Qemu-devel] [PATCH 2/2] disas: Add disas-objdump.pl
  2013-08-09 19:19 ` [Qemu-devel] [PATCH 2/2] disas: Add disas-objdump.pl Richard Henderson
@ 2013-08-10  4:08   ` Max Filippov
  2013-08-10 10:39     ` Richard Henderson
  0 siblings, 1 reply; 14+ messages in thread
From: Max Filippov @ 2013-08-10  4:08 UTC (permalink / raw)
  To: Richard Henderson; +Cc: peter.maydell, gxt, qemu-devel, claudio.fontana, proljc

On Fri, Aug 9, 2013 at 11:19 PM, Richard Henderson <rth@twiddle.net> wrote:
> The script massages the output produced for architectures that are
> not supported internally by qemu though an external objdump program
> for disassembly.

I'd add something like the following to get disassembled hunks with correct
addresses:

diff --git a/scripts/disas-objdump.pl b/scripts/disas-objdump.pl
index c66a629..b6824b4 100755
--- a/scripts/disas-objdump.pl
+++ b/scripts/disas-objdump.pl
@@ -38,15 +38,17 @@ $objdump[2] = mkobjcommand($tobjdump, $tmachine);
 # Zero-initialize current dumping state.
 my $mem = "";
 my $inobjd = 0;
+my $vma = "";

-sub objcommand {
+sub objcommand ($) {
+    my ($vma) = @_;
     my $ret = $objdump[$inobjd];
     if (!$ret) {
         die "Host machine type not specified" if $inobjd == 1;
         die "Target machine type not specified" if $inobjd == 2;
         die "Internal error";
     }
-    return $ret;
+    return $ret . " --adjust-vma=" . $vma;
 }

 while (<>) {
@@ -69,7 +71,8 @@ while (<>) {
         syswrite $outh, $mem;

         # Pipe from objdump...
-        open IN, "-|", objcommand();
+        $vma =~ s/:.*//;
+        open IN, "-|", objcommand($vma);

         # ... copying all but the first 7 lines of boilerplate to our stdout.
        my $i = 0;
@@ -82,6 +85,7 @@ while (<>) {
         $mem = "";
         $inobjd = 0;
     } else {
+        $vma = $_;
         print;
     }
 }

-- 
Thanks.
-- Max

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-09 19:19 [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Richard Henderson
                   ` (2 preceding siblings ...)
  2013-08-10  1:54 ` [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Jia Liu
@ 2013-08-10  9:16 ` Peter Maydell
  2013-08-10 10:22   ` Claudio Fontana
  2013-08-11  8:59 ` Blue Swirl
  4 siblings, 1 reply; 14+ messages in thread
From: Peter Maydell @ 2013-08-10  9:16 UTC (permalink / raw)
  To: Richard Henderson; +Cc: jcmvbkbc, gxt, qemu-devel, claudio.fontana, proljc

On 9 August 2013 20:19, Richard Henderson <rth@twiddle.net> wrote:
> We have one host platform (aarch64), and three target platforms
> (openrisc, unicore32, xtensa) with no built-in disassembly support,
> thanks largely to gplv3 silliness.

FWIW, there's an aarch64 BSD disassembler available as part
of vixl: https://github.com/armvixl/vixl

but this is still going to be useful for other platforms anyway.

-- PMM

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-10  9:16 ` Peter Maydell
@ 2013-08-10 10:22   ` Claudio Fontana
  2013-08-10 15:45     ` Peter Maydell
  0 siblings, 1 reply; 14+ messages in thread
From: Claudio Fontana @ 2013-08-10 10:22 UTC (permalink / raw)
  To: Peter Maydell; +Cc: jcmvbkbc, proljc, gxt, qemu-devel, Richard Henderson

On Sat, Aug 10, 2013 at 11:16 AM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> On 9 August 2013 20:19, Richard Henderson <rth@twiddle.net> wrote:
>> We have one host platform (aarch64), and three target platforms
>> (openrisc, unicore32, xtensa) with no built-in disassembly support,
>> thanks largely to gplv3 silliness.
>
> FWIW, there's an aarch64 BSD disassembler available as part
> of vixl: https://github.com/armvixl/vixl
>
> but this is still going to be useful for other platforms anyway.
>
> -- PMM

I was integrating vixl into qemu, but I like Richard's idea better.
I think that using objdump is better even for AArch64, since objdump
will see more use and be more tested.

I don't have anywhere to test until September, but I generally

Acked-by: Claudio Fontana <claudio.fontana@huawei.com>

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

* Re: [Qemu-devel] [PATCH 2/2] disas: Add disas-objdump.pl
  2013-08-10  4:08   ` Max Filippov
@ 2013-08-10 10:39     ` Richard Henderson
  0 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2013-08-10 10:39 UTC (permalink / raw)
  To: Max Filippov; +Cc: peter.maydell, gxt, qemu-devel, claudio.fontana, proljc

On 08/09/2013 06:08 PM, Max Filippov wrote:
> +    return $ret . " --adjust-vma=" . $vma;

Interesting.  I didn't consider this, as that option
doesn't appear in objdump --help.

Thanks,


r~

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-10 10:22   ` Claudio Fontana
@ 2013-08-10 15:45     ` Peter Maydell
  2013-08-10 16:42       ` Richard Henderson
  0 siblings, 1 reply; 14+ messages in thread
From: Peter Maydell @ 2013-08-10 15:45 UTC (permalink / raw)
  To: Claudio Fontana; +Cc: jcmvbkbc, proljc, gxt, qemu-devel, Richard Henderson

On 10 August 2013 11:22, Claudio Fontana <claudio.fontana@gmail.com> wrote:
> On Sat, Aug 10, 2013 at 11:16 AM, Peter Maydell
> <peter.maydell@linaro.org> wrote:
>> On 9 August 2013 20:19, Richard Henderson <rth@twiddle.net> wrote:
>>> We have one host platform (aarch64), and three target platforms
>>> (openrisc, unicore32, xtensa) with no built-in disassembly support,
>>> thanks largely to gplv3 silliness.
>>
>> FWIW, there's an aarch64 BSD disassembler available as part
>> of vixl: https://github.com/armvixl/vixl

> I was integrating vixl into qemu, but I like Richard's idea better.

Well, it depends. If we're going to dump all the in-tree
disassemblers and always use an external objdump, that's fine.
If we aren't I'd rather aarch64 not be in the "second class
citizen" camp if we have a disassembler available.

-- PMM

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-10 15:45     ` Peter Maydell
@ 2013-08-10 16:42       ` Richard Henderson
  2013-08-10 16:53         ` Max Filippov
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2013-08-10 16:42 UTC (permalink / raw)
  To: Peter Maydell; +Cc: jcmvbkbc, gxt, qemu-devel, Claudio Fontana, proljc

On 08/10/2013 05:45 AM, Peter Maydell wrote:
> Well, it depends. If we're going to dump all the in-tree
> disassemblers and always use an external objdump, that's fine.

It's tempting, given that the only internal disassemblers that
are not missing opcodes are for the extinct cpus.


r~

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-10 16:42       ` Richard Henderson
@ 2013-08-10 16:53         ` Max Filippov
  2013-08-10 19:47           ` Richard Henderson
  0 siblings, 1 reply; 14+ messages in thread
From: Max Filippov @ 2013-08-10 16:53 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Peter Maydell, gxt, qemu-devel, Claudio Fontana, proljc

On Sat, Aug 10, 2013 at 8:42 PM, Richard Henderson <rth@twiddle.net> wrote:
> On 08/10/2013 05:45 AM, Peter Maydell wrote:
>> Well, it depends. If we're going to dump all the in-tree
>> disassemblers and always use an external objdump, that's fine.
>
> It's tempting, given that the only internal disassemblers that
> are not missing opcodes are for the extinct cpus.

Will that leave those CPUs without x/i support from monitor?
Does anybody use it?

-- 
Thanks.
-- Max

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-10 16:53         ` Max Filippov
@ 2013-08-10 19:47           ` Richard Henderson
  2013-09-03 13:18             ` Claudio Fontana
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2013-08-10 19:47 UTC (permalink / raw)
  To: Max Filippov; +Cc: Peter Maydell, gxt, qemu-devel, Claudio Fontana, proljc

On 08/10/2013 06:53 AM, Max Filippov wrote:
> On Sat, Aug 10, 2013 at 8:42 PM, Richard Henderson <rth@twiddle.net> wrote:
>> On 08/10/2013 05:45 AM, Peter Maydell wrote:
>>> Well, it depends. If we're going to dump all the in-tree
>>> disassemblers and always use an external objdump, that's fine.
>>
>> It's tempting, given that the only internal disassemblers that
>> are not missing opcodes are for the extinct cpus.
> 
> Will that leave those CPUs without x/i support from monitor?

Yes.

One could always have qemu fork to objdump too.  Though finding the
right one could be tricky without help.

> Does anybody use it?

That I can't answer.


r~

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-09 19:19 [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Richard Henderson
                   ` (3 preceding siblings ...)
  2013-08-10  9:16 ` Peter Maydell
@ 2013-08-11  8:59 ` Blue Swirl
  4 siblings, 0 replies; 14+ messages in thread
From: Blue Swirl @ 2013-08-11  8:59 UTC (permalink / raw)
  To: Richard Henderson
  Cc: peter.maydell, proljc, claudio.fontana, qemu-devel, jcmvbkbc, gxt

On Fri, Aug 9, 2013 at 7:19 PM, Richard Henderson <rth@twiddle.net> wrote:
> We have one host platform (aarch64), and three target platforms
> (openrisc, unicore32, xtensa) with no built-in disassembly support,
> thanks largely to gplv3 silliness.
>
> Here's a first-cut at handling these cases with an external tool.
> The qemu-produced dump file contains just a hex dump of bytes, and
> a perl script is provided to pass those bytes through objdump.
>
> I've lightly tested this with aarch64 host running on Foundation.
> Feedback appreciated.

Nice idea, now that QEMU is now more easily portable to new host platforms.

>
>
> r~
>
>
> Richard Henderson (2):
>   disas: Implement fallback to dump object code as hex
>   disas: Add disas-objdump.pl
>
>  disas.c                  | 46 +++++++++++++++++++------
>  scripts/disas-objdump.pl | 87 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 123 insertions(+), 10 deletions(-)
>  create mode 100755 scripts/disas-objdump.pl
>
> --
> 1.8.3.1
>
>

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

* Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump
  2013-08-10 19:47           ` Richard Henderson
@ 2013-09-03 13:18             ` Claudio Fontana
  0 siblings, 0 replies; 14+ messages in thread
From: Claudio Fontana @ 2013-09-03 13:18 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Peter Maydell, proljc, Claudio Fontana, qemu-devel, Max Filippov, gxt

Hi, resuming this conversation about external objdump,

On 10.08.2013 21:47, Richard Henderson wrote:
> On 08/10/2013 06:53 AM, Max Filippov wrote:
>> On Sat, Aug 10, 2013 at 8:42 PM, Richard Henderson <rth@twiddle.net> wrote:
>>> On 08/10/2013 05:45 AM, Peter Maydell wrote:
>>>> Well, it depends. If we're going to dump all the in-tree
>>>> disassemblers and always use an external objdump, that's fine.
>>>
>>> It's tempting, given that the only internal disassemblers that
>>> are not missing opcodes are for the extinct cpus.
>>
>> Will that leave those CPUs without x/i support from monitor?
> 
> Yes.
> 
> One could always have qemu fork to objdump too.  Though finding the
> right one could be tricky without help.

I lost track of what you mean here.. that we could implement x/i support also using an external objdump?

I got my first actual run of a qemu with integrated libvixl from ARM for disassembly output of aarch64 code, and the results are substandard.
Many instructions are missing, in particular all PC relative instructions, and the README warns about multiple other problems.
It also introduces dependencies from scons, C++, and can only build and run on 64bit LP64 hosts.
Using external objdump would be very much better for aarch64.

What about making the external objdump the first class citizen here, and removing all the old  stuff? Or just keeping it as fallback?

> 
>> Does anybody use it?
> 
> That I can't answer.

As I started the aarch64 tcg task I just used gdb's disassembly feature for achieving that goal.
However, since the feature is already there and people rely on it, maybe it could be done with external objdump as well?

> 
> 
> r~

Ciao,

Claudio

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

end of thread, other threads:[~2013-09-03 13:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-09 19:19 [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Richard Henderson
2013-08-09 19:19 ` [Qemu-devel] [PATCH 1/2] disas: Implement fallback to dump object code as hex Richard Henderson
2013-08-09 19:19 ` [Qemu-devel] [PATCH 2/2] disas: Add disas-objdump.pl Richard Henderson
2013-08-10  4:08   ` Max Filippov
2013-08-10 10:39     ` Richard Henderson
2013-08-10  1:54 ` [Qemu-devel] [PATCH 0/2] Disassembly with external objdump Jia Liu
2013-08-10  9:16 ` Peter Maydell
2013-08-10 10:22   ` Claudio Fontana
2013-08-10 15:45     ` Peter Maydell
2013-08-10 16:42       ` Richard Henderson
2013-08-10 16:53         ` Max Filippov
2013-08-10 19:47           ` Richard Henderson
2013-09-03 13:18             ` Claudio Fontana
2013-08-11  8:59 ` Blue Swirl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.