Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: tools/objdump-v8

Issue 2159103007: Fix objdump assembly truncations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Prioritize process specific code.asm Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/objdump-v8
diff --git a/tools/objdump-v8 b/tools/objdump-v8
index 185ce29cd38618a6239220045f29c5e113574a8f..25ec4745e64a6f58dc50841a6ba1b992bcd52c24 100755
--- a/tools/objdump-v8
+++ b/tools/objdump-v8
@@ -27,6 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import os.path
import re
import subprocess
import sys
@@ -50,17 +51,21 @@ def format_line(line):
def is_comment(line):
stripped = line.strip()
- return stripped.startswith("--") or stripped.startswith(";;;")
+ return stripped.startswith("--") or stripped.startswith(";;")
def main():
filename = sys.argv[-1]
match = re.match(r"/tmp/perf-(.*)\.map", filename)
if match:
start, end = get_address_bounds()
- codefile = "code-" + match.group(1) + "-1.asm"
- with open(codefile, "r") as code:
+ process_codefile = "code-" + match.group(1) + "-1.asm"
+ if os.path.exists(process_codefile):
+ codefile = open(process_codefile, "r")
+ else:
+ codefile = open("code.asm", "r")
+ with codefile:
printing = False
- for line in code:
+ for line in codefile:
if line.startswith("0x"):
addr = int(line.split()[0], 0)
if start <= addr <= end:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698