Skip to content

disas: Unify target_disas and monitor_disas

Peter Crosthwaite qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7disas: Create factored out fn for monitor and target disasdisas.c+61 -871 reply
2/7disas: microblaze: Migrate setup to common codedisas.c+3 -30 replies
3/7disas: cris: Fix 0 buffer length casedisas/cris.c+3 -30 replies
4/7disas: cris: Migrate setup to common codedisas.c+8 -80 replies
5/7disas: arm-a64: Make printfer and stream variabledisas/arm-a64.cc+17 -52 replies
6/7monitor: "i": Add ARM specificsmonitor.c+11 -012 replies
7/7disas: arm: Use target_disas impl for monitordisas.c+23 -252 replies

Reviews trailers per patch

4 of 7 patches have a Reviewed-by or Acked-by.

PatchClaudio Fontana
1/7R-b
2/7
3/7
4/7
5/7R-b T-b
6/7R-b T-b
7/7T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/7] disas: Unify target_disas and monitor_disas

There two functions are mostly trying to do the same thing, which is disassemble a target instruction (sequence) for printfing. The architecture specific setup is largely duped between the two functions. Most architectures are carbon copy and can be factored out without issue (P1). Three architectures (microblaze, cris and ARM) are patched to make the monitor_disas consistent with target_disas.

Microblaze is trivial, the target_disas setup is directly applicable to monitor_disas to bring in microblaze monitor disas support (P2).

Cris had a small hiccup, a patch is needed to handle monitor_disas's 0 buffer length (P3). Then cris is patched to enable monitor disas in same way as microblaze (P4).

ARM is the harder. The vixl A64 disas was hardcoded to fprintf with a statically inited output stream (matching target_disas). The vixl printfery is patched to be runtime variable (P5). ARM is also missing setting of the disas flags from monitor.c. Fixed in (P6). P7 bring ARM monitor disassembly online (via unification as target_disas implementation).

Two architectures remain unresolved. PPC has some diffs between target_disas and monitor_disas. Alpha looks easier, but I have no test case (can anyone link me a random elf or kernel? Doesn't need to do anything meaningful other than enter execution of instructions).

Alpha sets the BFD for target_disas but not monitor_disas? Should it just always set the BFD? That is this:

s.info.mach = bfd_mach_alpha_ev6;

PPC sets the disassembler_options to "any" but only for target_disas.

s.info.disassembler_options = (char *)"any";

Can/should this be applied to monitor disas to remove the diff?

Regards,
Peter

Peter Crosthwaite (7):
disas: Create factored out fn for monitor and target disas
disas: microblaze: Migrate setup to common code
disas: cris: Fix 0 buffer length case
disas: cris: Migrate setup to common code
disas: arm-a64: Make printfer and stream variable
monitor: "i": Add ARM specifics
disas: arm: Use target_disas impl for monitor

 disas.c          | 202 ++++++++++++++++++++++++-------------------------------
 disas/arm-a64.cc |  22 ++++--
 disas/cris.c     |   6 +-
 monitor.c        |  11 +++
 4 files changed, 118 insertions(+), 123 deletions(-)
Signature · 1 line
1.9.1