dis is overly restrictive when looking for it's next symbol
When an invalid opcode is encountered, dis dumps the instruction stream as hex until it can find the next symbol in the section, and then begins disassembly again. However, it will only look for a symbol if the current address is already within a known symbol. With the advent of NOP padding between functions, this is overly restrictive. It should just look for the next symbol whose value > the current address.
Also on sparc, since instructions are fixed size, all that work is not necessary -- we always know where the next instruction will be. It should only do the symbol lookup on variable length instruction architectures (i.e. x86/amd64).
Updated by Albert Lee almost 11 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 90
user: Jason King <firstname.lastname@example.org>
date: Wed Sep 14 11:28:33 2011 -0500
files: usr/src/cmd/dis/dis_main.c usr/src/cmd/dis/dis_target.c usr/src/cmd/dis/dis_target.h
1393 dis does not handle sections with unassigned virtual addresses well
1409 dis is overly restrictive when looking for it's next symbol
Reviewed by: Rich Lowe <email@example.com>
Reviewed by: Eric Schrock <firstname.lastname@example.org>
Approved by: Albert Lee <email@example.com>