commit | c957e24190c983d437126399606dd9bf743b873b | [log] [tgz] |
---|---|---|
author | Samuel Huang <huangs@chromium.org> | Fri Dec 14 05:56:28 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Dec 14 05:56:28 2018 |
tree | a54a1f826b50afe406f3b82b17ecbd95ad4bbf69 | |
parent | 5d6059787e4b94f450a6ebae42b605fd9c1a8edc [diff] |
[SuperSize] Refactor MapFileParserLld.Parse() using a filtering generator. We wish to extract more symbols from Level 3 lines from .map files. Some lines have |size == 0| (this can happen for symbols from assembly sources), but we can approximate actual size from |address| difference between successive lines. We call this approximation "span". This CL refactors MapFileParserLld.Parse() by extracting some parsing logic into a new generator MapFileParserLld.Tokenize(). Details: * Tokenize() is a generator that: * Consumes .map file lines and yields parsed fields. * Applies a one-step lookhead, and maintains "next" and "current" tokens from successive lines to compute "span" (some complication exist). * Skips Level 3 annotations ('$a', '$t.123', etc.), which also has |size == 0| but produces no symbols, and so should be ignored for "span" computation. * Detects Thumb2 annotations '$t' and adjusts |address| accordingly. * Add 2 new tests to LinkerMapParserTest: * test_ParseArmAnnotation() for annotation parsing. * test_Tokenize() to dump Tokenize() output, and compare against new Tokenize.golden file. As a refactoring CL, MapFileParserLld output remains unchanged. Actual usage of "span" will be implemented in follow-ups. Bug: 892648 Change-Id: Ia630027b85e45a234101396917ea4626b9dba1bc Reviewed-on: https://chromium-review.googlesource.com/c/1377189 Reviewed-by: Samuel Huang <huangs@chromium.org> Reviewed-by: agrieve <agrieve@chromium.org> Commit-Queue: Samuel Huang <huangs@chromium.org> Cr-Commit-Position: refs/heads/master@{#616594}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .