[PATCH] D63631: [llvm-objdump] Move --start-address >= --stop-address check out of the -d code.
Yuanfang Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 20 20:50:02 PDT 2019
ychen updated this revision to Diff 205940.
ychen added a comment.
- update
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63631/new/
https://reviews.llvm.org/D63631
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
@@ -1418,9 +1418,6 @@
}
static void disassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
- if (StartAddress >= StopAddress)
- error("start address should be less than stop address");
-
const Target *TheTarget = getTarget(Obj);
// Package up features to be passed to target/subtarget
@@ -2064,6 +2061,9 @@
cl::ParseCommandLineOptions(argc, argv, "llvm object file dumper\n");
+ if (StartAddress >= StopAddress)
+ error("start address should be less than stop address");
+
ToolName = argv[0];
// Defaults to a.out if no filenames specified.
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
@@ -67,6 +67,6 @@
// 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
-// RUN: not llvm-objdump -d %t.out --start-address=0x40 --stop-address=0x40 2>&1 | FileCheck %s --check-prefix ERRMSG
+// RUN: not llvm-objdump %t.out --start-address=0x40 --stop-address=0x40 2>&1 | FileCheck %s --check-prefix ERRMSG
+// RUN: not llvm-objdump %t.out --start-address=0x40 --stop-address=0x3f 2>&1 | FileCheck %s --check-prefix ERRMSG
// ERRMSG: start address should be less than stop address.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63631.205940.patch
Type: text/x-patch
Size: 1629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190621/0729dc04/attachment.bin>
More information about the llvm-commits
mailing list