Project

General

Profile

Bug #1409

dis is overly restrictive when looking for it's next symbol

Added by Jason King almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2011-08-24
Due date:
% Done:

90%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

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).

History

#1

Updated by Albert Lee almost 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 90

Fixed in:
changeset: 13451:4349f1403dad
tag: tip
user: Jason King <>
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
description:
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 <>
Reviewed by: Eric Schrock <>
Approved by: Albert Lee <>

Also available in: Atom PDF