updated parsemap to also process RAM
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
# 2015-07-22 - first version
|
||||
# ------------------------------------------------
|
||||
|
||||
DISABLE_DEBUG := 0
|
||||
DISABLE_MSC := 0
|
||||
DISABLE_TEST_UNIT := 0
|
||||
|
||||
include User/gex.mk
|
||||
GEX_PLAT=F072_DISCOVERY
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ ENTRY(Reset_Handler)
|
||||
_estack = 0x20004000; /* end of RAM */
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
_Min_Heap_Size = 0x200; /* required amount of heap */
|
||||
_Min_Stack_Size = 0x400; /* required amount of stack */
|
||||
_Min_Stack_Size = 0x200; /* required amount of stack */
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
|
||||
+1
-1
Submodule User updated: 45910e7f04...cffedd7a9a
+49
-2
@@ -17,7 +17,6 @@ file_put_contents("main.flash.map", $flash);
|
||||
file_put_contents("main.ram.map", $ram);
|
||||
|
||||
$flash = preg_replace('/(\.(text|rodata)\.[^ ]*?)\n/', '$1', $flash);
|
||||
|
||||
$lines = explode("\n", $flash);
|
||||
|
||||
$sections = [];
|
||||
@@ -49,7 +48,55 @@ usort($sections, function($a,$b) {
|
||||
return -($a->size - $b->size);
|
||||
});
|
||||
|
||||
$limit = 60;
|
||||
echo "--- FLASH ---\n";
|
||||
$limit = 40;
|
||||
foreach($sections as $s) {
|
||||
if ($s->type=='DATA')echo "\033[33m";else echo "\033[32m";
|
||||
echo "{$s->type}\033[0m {$s->addr} \033[96m{$s->size}\033[0m\t".
|
||||
"\033[36m{$s->name}\033[0m";
|
||||
|
||||
for($i=0;$i<36-strlen($s->name);$i++) echo " ";
|
||||
|
||||
echo "{$s->file}\n";
|
||||
|
||||
if($limit--==0) break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$ram = preg_replace('/(\.(bss|data)\.[^ ]*?)\n/', '$1', $ram);
|
||||
$lines = explode("\n", $ram);
|
||||
|
||||
$sections = [];
|
||||
foreach($lines as $l) {
|
||||
if ((false !== strpos($l, '0x0000000020')) && (false !== strpos($l, '.bss.') || false !== strpos($l, '.data.'))) {
|
||||
//echo "$l\n";
|
||||
preg_match('/\s*.(bss|data).([^ ]+)\s+0x00000000(20[\da-f]+)\s+0x([\da-f]+)\s+(.*)/', $l, $m);
|
||||
//print_r($m);
|
||||
$sec = new stdClass;
|
||||
$sec->type = $m[1]=='bss'?'BSS ':'DATA';
|
||||
$sec->name = $m[2];
|
||||
$sec->addr = "0x".$m[3];
|
||||
$sec->size = hexdec($m[4]);
|
||||
$sec->file = $m[5];
|
||||
|
||||
if (($p=strrpos($sec->file, 'arm-none-eabi/')) !== false) {
|
||||
$sec->file = "\033[90m".substr($sec->file, $p)."\033[0m";
|
||||
} else {
|
||||
$sec->file = "\033[35m".str_replace("build/","",$sec->file)."\033[0m";
|
||||
}
|
||||
|
||||
//print_r($sec);
|
||||
$sections[] = $sec;
|
||||
}
|
||||
}
|
||||
|
||||
usort($sections, function($a,$b) {
|
||||
return -($a->size - $b->size);
|
||||
});
|
||||
|
||||
echo "\n--- RAM ---\n";
|
||||
$limit = 20;
|
||||
foreach($sections as $s) {
|
||||
if ($s->type=='DATA')echo "\033[33m";else echo "\033[32m";
|
||||
echo "{$s->type}\033[0m {$s->addr} \033[96m{$s->size}\033[0m\t".
|
||||
|
||||
Reference in New Issue
Block a user