[PATCH] D61969: Fix Bugzilla ID 41862 to support checking addresses of disassembled object

Nicholas Krause via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 17:39:29 PDT 2019


xerofoify updated this revision to Diff 201373.
xerofoify added a comment.

Sorry about the issues. I looked through the comments and it seems that the test cases below are correct and one needed to just be added by copying and pasting the other one but checking for the same addresses with a newer error message to check against.  Hopefully this is correct now and thanks for the patience.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61969/new/

https://reviews.llvm.org/D61969

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


Index: llvm/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1403,8 +1403,8 @@
 }
 
 static void disassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
-  if (StartAddress > StopAddress)
-    error("Start address should be less than stop address");
+  if (StartAddress >= StopAddress)
+    error("error: start address should not be less than or equal to stop address");
 
   const Target *TheTarget = getTarget(Obj);
 
Index: llvm/test/tools/llvm-objdump/X86/start-stop-address.test
===================================================================
--- llvm/test/tools/llvm-objdump/X86/start-stop-address.test
+++ llvm/test/tools/llvm-objdump/X86/start-stop-address.test
@@ -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: error: start address should not be less than or equal to stop address


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61969.201373.patch
Type: text/x-patch
Size: 1270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190525/d1a685d0/attachment.bin>


More information about the llvm-commits mailing list