The most common extension for static libraries is .a and CMake generates
it with both GCC and Arm toolchains. Mbed CLI 1 generates .ar files with
the Arm Compiler, but since Mbed CLI 2 uses memap.py to generate map
files too, both extensions should be permitted.
This fixes a warning when building greentea tests:
Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
...
which repeats over 30 times per test.
IAR 8 linker map puts C++14-style apostrophe digit separators in its
addresses, such as:
.data inited 0x2000'1ff0 0x4 mbed_rtx_idle.o [159]
Extend the regex pattern to allow this.
### Description
This PR moves the old memap file handling required for differential
memap from within memap to the toolchain object. This has the
advantage that we can do the `mv <app>.map <app>.map.old` the moment
before it is overwritten by the linker. This should allow multiple
reruns of memap without modifying your build directory.
### Pull request type
[ ] Fix
[x] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change
### Description
Memap will create a bunch of warnings about "Unknown object name" when
parsing a map file created for the RZ_A1H and the GR_Peach. Theses
warnings are sperious; the information in these sections does not belong
to an object file. This PR silences these warnings.
Fixes#6258
### Pull request type
[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change
Looks like this:
Building project mbed-os-prettyoutput (ARCH_PRO, GCC_ARM)
Scan: .
Scan: env
Scan: mbed
Scan: FEATURE_LWIP
Text 70.5KB Data 2.72KB BSS 7.43KB ROM 73.2KB RAM 10.1KB
ROM [||||||| ] 73.2KB/512KB
RAM [|||||||||||||||| ] 10.1KB/32KB
Image: BUILD/ARCH_PRO/GCC_ARM/mbed-os-prettyoutput.bin
If you build a target without a cmsis-pack it looks like this:
Building project mbed-os-prettyoutput (ARM_BEETLE_SOC, GCC_ARM)
Scan: .
Scan: env
Scan: mbed
Scan: FEATURE_BLE
Text 99KB Data 2.84KB BSS 13KB ROM 102KB RAM 15.8KB
Image: BUILD/ARM_BEETLE_SOC/GCC_ARM/mbed-os-prettyoutput.bin
And the old behaviour of displaying the memap table can be brought back
by passing the --stats-depth parameter
Parsing dispatch now uses a metaclass as a Trait and a series of classes
that implement the trait for dispatching parsing. This structure gives
each parser it's own namespace, avoiding tacking on suffixes to each
attribute indicating which parser uses it.