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

Issue 2008253004: Refactor rel32 searching process for x64 to make it more similar to x86. (Closed)

Created:
4 years, 7 months ago by etiennep
Modified:
4 years, 6 months ago
Reviewers:
huangs, Will Harris
CC:
chromium-reviews, wfh+watch_chromium.org, huangs+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor rel32 searching process for x64 to make it more similar to x86. I created a base class Rel32Finder from which derives both Rel32FinderX86 and Rel32Finder64. This makes ParseRel32RelocsFromSection method more similar in x64 and x86. Note that I removed the Win32 part of the name because it may be used by DisassemblerElf. I created test cases for Rel32FinderX64 which extends those for Rel32FinderX86. BUG=617965 Committed: https://crrev.com/7a43c3ede6d7db6e9ec25c80db8fbcd5ed80ad0f Cr-Commit-Position: refs/heads/master@{#398326}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Rollback to original courgette algorithm and improve unittests #

Total comments: 35

Patch Set 3 : Add missing file and cleanup #

Patch Set 4 : More cleanup #

Patch Set 5 : Improve rel32_finder doc #

Total comments: 36

Patch Set 6 : Include processor type in test files and NIT #

Total comments: 26

Patch Set 7 : Improve and format unittests #

Total comments: 16

Patch Set 8 : NIT cleanup #

Total comments: 2

Patch Set 9 : Correct far away ptr in rel32_x64_03.txt test case #

Unified diffs Side-by-side diffs Delta from patch set Stats (+473 lines, -724 lines) Patch
M courgette/BUILD.gn View 1 2 3 2 chunks +7 lines, -3 lines 0 comments Download
M courgette/courgette.gyp View 1 2 chunks +7 lines, -3 lines 0 comments Download
M courgette/disassembler_win32_x64.cc View 1 2 3 chunks +10 lines, -85 lines 0 comments Download
M courgette/disassembler_win32_x86.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
A + courgette/rel32_finder.h View 1 2 3 chunks +7 lines, -22 lines 0 comments Download
A courgette/rel32_finder.cc View 1 2 1 chunk +22 lines, -0 lines 0 comments Download
A + courgette/rel32_finder_unittest.cc View 1 2 3 4 5 6 6 chunks +39 lines, -19 lines 0 comments Download
D courgette/rel32_finder_win32_x86.h View 1 chunk +0 lines, -71 lines 0 comments Download
D courgette/rel32_finder_win32_x86.cc View 1 chunk +0 lines, -113 lines 0 comments Download
D courgette/rel32_finder_win32_x86_unittest.cc View 1 chunk +0 lines, -151 lines 0 comments Download
A courgette/rel32_finder_x64.h View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download
A courgette/rel32_finder_x64.cc View 1 2 3 4 5 6 1 chunk +121 lines, -0 lines 0 comments Download
A courgette/rel32_finder_x86.h View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
A + courgette/rel32_finder_x86.cc View 1 2 3 4 5 6 3 chunks +21 lines, -43 lines 0 comments Download
D courgette/testdata/rel32_win32_x86_01.txt View 1 chunk +0 lines, -55 lines 0 comments Download
D courgette/testdata/rel32_win32_x86_02.txt View 1 chunk +0 lines, -62 lines 0 comments Download
D courgette/testdata/rel32_win32_x86_03.txt View 1 chunk +0 lines, -40 lines 0 comments Download
D courgette/testdata/rel32_win32_x86_04.txt View 1 chunk +0 lines, -47 lines 0 comments Download
A + courgette/testdata/rel32_x64_01.txt View 1 2 3 4 5 6 7 3 chunks +41 lines, -3 lines 0 comments Download
A + courgette/testdata/rel32_x64_02.txt View 1 2 3 4 5 6 7 3 chunks +44 lines, -4 lines 0 comments Download
A courgette/testdata/rel32_x64_03.txt View 1 2 3 4 5 6 7 8 1 chunk +74 lines, -0 lines 0 comments Download
A + courgette/testdata/rel32_x86_01.txt View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A + courgette/testdata/rel32_x86_02.txt View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download
A + courgette/testdata/rel32_x86_03.txt View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A + courgette/testdata/rel32_x86_04.txt View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (10 generated)
etiennep
PTAL
4 years, 7 months ago (2016-05-26 18:17:58 UTC) #1
huangs
High level comments. https://codereview.chromium.org/2008253004/diff/1/courgette/assembly_program.cc File courgette/assembly_program.cc (right): https://codereview.chromium.org/2008253004/diff/1/courgette/assembly_program.cc#newcode409 courgette/assembly_program.cc:409: /*case REL32ARM: { Not sure what ...
4 years, 7 months ago (2016-05-26 18:34:34 UTC) #3
huangs
Also, please mention Courgette somewhere in the title.
4 years, 7 months ago (2016-05-26 18:38:50 UTC) #4
etiennep
I've undo the changes in the algorithm to make a separate CL. Addresses that would ...
4 years, 7 months ago (2016-05-26 20:50:10 UTC) #5
huangs
Need to git add rel32_finder_unittest.cc ? https://codereview.chromium.org/2008253004/diff/20001/courgette/rel32_finder.cc File courgette/rel32_finder.cc (right): https://codereview.chromium.org/2008253004/diff/20001/courgette/rel32_finder.cc#newcode7 courgette/rel32_finder.cc:7: #include "courgette/rel32_finder.h" NIT: ...
4 years, 7 months ago (2016-05-26 22:11:18 UTC) #6
huangs
https://codereview.chromium.org/2008253004/diff/20001/courgette/rel32_finder.h File courgette/rel32_finder.h (right): https://codereview.chromium.org/2008253004/diff/20001/courgette/rel32_finder.h#newcode20 courgette/rel32_finder.h:20: Rel32Finder() = default; If the default constructor is unused ...
4 years, 7 months ago (2016-05-26 22:40:56 UTC) #7
etiennep
PTAnL https://chromiumcodereview.appspot.com/2008253004/diff/20001/courgette/rel32_finder.cc File courgette/rel32_finder.cc (right): https://chromiumcodereview.appspot.com/2008253004/diff/20001/courgette/rel32_finder.cc#newcode7 courgette/rel32_finder.cc:7: #include "courgette/rel32_finder.h" On 2016/05/26 22:11:17, huangs wrote: > ...
4 years, 6 months ago (2016-05-27 18:12:34 UTC) #8
huangs
More comments, please see accompanying email for tool. https://codereview.chromium.org/2008253004/diff/80001/courgette/rel32_finder_unittest.cc File courgette/rel32_finder_unittest.cc (right): https://codereview.chromium.org/2008253004/diff/80001/courgette/rel32_finder_unittest.cc#newcode35 courgette/rel32_finder_unittest.cc:35: template ...
4 years, 6 months ago (2016-05-30 05:48:35 UTC) #9
etiennep
PTAnL https://chromiumcodereview.appspot.com/2008253004/diff/80001/courgette/rel32_finder_unittest.cc File courgette/rel32_finder_unittest.cc (right): https://chromiumcodereview.appspot.com/2008253004/diff/80001/courgette/rel32_finder_unittest.cc#newcode35 courgette/rel32_finder_unittest.cc:35: template <class Finder> On 2016/05/30 05:48:34, huangs wrote: ...
4 years, 6 months ago (2016-05-30 17:07:31 UTC) #10
huangs
Comment NITs and suggested fixes to test data. https://chromiumcodereview.appspot.com/2008253004/diff/100001/courgette/rel32_finder_x64.cc File courgette/rel32_finder_x64.cc (right): https://chromiumcodereview.appspot.com/2008253004/diff/100001/courgette/rel32_finder_x64.cc#newcode60 courgette/rel32_finder_x64.cc:60: // ...
4 years, 6 months ago (2016-05-30 18:14:48 UTC) #11
etiennep
PTAnL https://chromiumcodereview.appspot.com/2008253004/diff/100001/courgette/rel32_finder_x64.cc File courgette/rel32_finder_x64.cc (right): https://chromiumcodereview.appspot.com/2008253004/diff/100001/courgette/rel32_finder_x64.cc#newcode60 courgette/rel32_finder_x64.cc:60: // rip relative call/jmp On 2016/05/30 18:14:47, huangs ...
4 years, 6 months ago (2016-06-01 17:23:41 UTC) #12
huangs
Awesome work! LGTM with NITs on test data. https://codereview.chromium.org/2008253004/diff/120001/courgette/rel32_finder_x64.cc File courgette/rel32_finder_x64.cc (right): https://codereview.chromium.org/2008253004/diff/120001/courgette/rel32_finder_x64.cc#newcode89 courgette/rel32_finder_x64.cc:89: while ...
4 years, 6 months ago (2016-06-01 20:57:21 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2008253004/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2008253004/140001
4 years, 6 months ago (2016-06-03 13:03:58 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-03 14:27:09 UTC) #18
etiennep
Ready to commit? https://codereview.chromium.org/2008253004/diff/120001/courgette/testdata/rel32_x64_01.txt File courgette/testdata/rel32_x64_01.txt (right): https://codereview.chromium.org/2008253004/diff/120001/courgette/testdata/rel32_x64_01.txt#newcode38 courgette/testdata/rel32_x64_01.txt:38: 00401079: 8B 05 00 00 00 ...
4 years, 6 months ago (2016-06-03 15:39:40 UTC) #19
huangs
LGTM with small change. https://codereview.chromium.org/2008253004/diff/140001/courgette/testdata/rel32_x64_03.txt File courgette/testdata/rel32_x64_03.txt (right): https://codereview.chromium.org/2008253004/diff/140001/courgette/testdata/rel32_x64_03.txt#newcode41 courgette/testdata/rel32_x64_03.txt:41: 00401060: FF 15 6A 88 ...
4 years, 6 months ago (2016-06-03 15:59:06 UTC) #20
etiennep
PTAL https://codereview.chromium.org/2008253004/diff/140001/courgette/testdata/rel32_x64_03.txt File courgette/testdata/rel32_x64_03.txt (right): https://codereview.chromium.org/2008253004/diff/140001/courgette/testdata/rel32_x64_03.txt#newcode41 courgette/testdata/rel32_x64_03.txt:41: 00401060: FF 15 6A 88 C8 88 call ...
4 years, 6 months ago (2016-06-03 17:17:12 UTC) #22
Will Harris
can you add a BUG=, otherwise defer to huangs existing lgtm
4 years, 6 months ago (2016-06-03 21:41:41 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2008253004/160001
4 years, 6 months ago (2016-06-07 14:56:06 UTC) #27
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 6 months ago (2016-06-07 17:40:53 UTC) #29
commit-bot: I haz the power
4 years, 6 months ago (2016-06-07 17:42:34 UTC) #31
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/7a43c3ede6d7db6e9ec25c80db8fbcd5ed80ad0f
Cr-Commit-Position: refs/heads/master@{#398326}

Powered by Google App Engine
This is Rietveld 408576698