Chromium Code Reviews| Index: tools/objdump-v8 |
| diff --git a/tools/objdump-v8 b/tools/objdump-v8 |
| index 185ce29cd38618a6239220045f29c5e113574a8f..95649f4b7d30f647b2d62a4f9f05f9e4184269e9 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,20 @@ 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: |
| + if os.path.exists("code.asm"): |
| + codefile = open("code.asm", "r") |
|
Benedikt Meurer
2016/07/21 17:28:26
I think you should prefer the code-<pid>-<isolate
|
| + else: |
| + codefile = open("code-" + match.group(1) + "-1.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: |