OSDN Git Service

[llvm-objdump] Fix Bugzilla ID 41862 to support checking addresses of disassembled...
authorJordan Rupprecht <rupprecht@google.com>
Fri, 7 Jun 2019 21:49:26 +0000 (21:49 +0000)
committerJordan Rupprecht <rupprecht@google.com>
Fri, 7 Jun 2019 21:49:26 +0000 (21:49 +0000)
Summary:
This fixes the bugzilla id,41862 to support dealing with checking
stop address against start address to support this not being a
proper object to check the disasembly against like gnu objdump
currently does.

Reviewers: jakehehrlich, rupprecht, echristo, jhenderson, grimar

Reviewed By: jhenderson

Subscribers: MaskRay, smeenai, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61969

Patch by Nicholas Krause!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362847 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-objdump/X86/start-stop-address.test
tools/llvm-objdump/llvm-objdump.cpp

index e8b390f..3f76e79 100644 (file)
@@ -68,4 +68,5 @@
 // OUT-OF-RANGE-NOT: Disassembly
 
 // RUN: not llvm-objdump -d %t.out --start-address=0x40 --stop-address=0x3f 2>&1 | FileCheck %s --check-prefix ERRMSG
-// ERRMSG: error: Start address should be less than stop address.
+// RUN: not llvm-objdump -d %t.out --start-address=0x40 --stop-address=0x40 2>&1 | FileCheck %s --check-prefix ERRMSG
+// ERRMSG: start address should be less than stop address.
index bbd65d9..8f4acc7 100644 (file)
@@ -1417,8 +1417,8 @@ static void disassembleObject(const Target *TheTarget, const ObjectFile *Obj,
 }
 
 static void disassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
-  if (StartAddress > StopAddress)
-    error("Start address should be less than stop address");
+  if (StartAddress >= StopAddress)
+    error("start address should be less than stop address");
 
   const Target *TheTarget = getTarget(Obj);