Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 51447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:45:07+00:00 2026-05-10T16:45:07+00:00

My gcc build toolchain produces a .map file. How do I display the memory

  • 0

My gcc build toolchain produces a .map file. How do I display the memory sections using memory map graphically?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:45:07+00:00Added an answer on May 10, 2026 at 4:45 pm

    Here’s the beginnings of a script in Python. It loads the map file into a list of Sections and Symbols (first half). It then renders the map using HTML (or do whatever you want with the sections and symbols lists).

    You can control the script by modifying these lines:

    with open('t.map') as f: colors = ['9C9F84', 'A97D5D', 'F7DCB4', '5C755E'] total_height = 32.0 

    map2html.py

    from __future__ import with_statement import re  class Section:     def __init__(self, address, size, segment, section):         self.address = address         self.size = size         self.segment = segment         self.section = section     def __str__(self):         return self.section+''  class Symbol:     def __init__(self, address, size, file, name):         self.address = address         self.size = size         self.file = file         self.name = name     def __str__(self):         return self.name  #=============================== # Load the Sections and Symbols # sections = [] symbols = []  with open('t.map') as f:     in_sections = True     for line in f:         m = re.search('^([0-9A-Fx]+)\s+([0-9A-Fx]+)\s+((\[[ 0-9]+\])|\w+)\s+(.*?)\s*$', line)         if m:             if in_sections:                 sections.append(Section(eval(m.group(1)), eval(m.group(2)), m.group(3), m.group(5)))             else:                 symbols.append(Symbol(eval(m.group(1)), eval(m.group(2)), m.group(3), m.group(5)))         else:             if len(sections) > 0:                 in_sections = False   #=============================== # Gererate the HTML File #  colors = ['9C9F84', 'A97D5D', 'F7DCB4', '5C755E'] total_height = 32.0  segments = set() for s in sections: segments.add(s.segment) segment_colors = dict() i = 0 for s in segments:     segment_colors[s] = colors[i % len(colors)]     i += 1  total_size = 0 for s in symbols:     total_size += s.size  sections.sort(lambda a,b: a.address - b.address) symbols.sort(lambda a,b: a.address - b.address)  def section_from_address(addr):     for s in sections:         if addr >= s.address and addr < (s.address + s.size):             return s     return None  print '<html><head>' print '  <style>a { color: black; text-decoration: none; font-family:monospace }</style>' print '<body>' print '<table cellspacing='1px'>' for sym in symbols:     section = section_from_address(sym.address)     height = (total_height/total_size) * sym.size     font_size = 1.0 if height > 1.0 else height     print '<tr style='background-color:#%s;height:%gem;line-height:%gem;font-size:%gem'><td style='overflow:hidden'>' % \         (segment_colors[section.segment], height, height, font_size)     print '<a href='#%s'>%s</a>' % (sym.name, sym.name)     print '</td></tr>' print '</table>' print '</body></html>' 

    And here’s a bad rendering of the HTML it outputs:

    Map

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 138k
  • Answers 138k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer TempData persist between two requests. What does the ReturnView method… May 12, 2026 at 7:36 am
  • Editorial Team
    Editorial Team added an answer The principle of design are not difficult to learn but… May 12, 2026 at 7:36 am
  • Editorial Team
    Editorial Team added an answer I don't believe this is supported out of the box,… May 12, 2026 at 7:36 am

Related Questions

Some background: As a personal project, I've been developing a kernel in c++. Things
I've been unable to build P4Python for an Intel Mac OS X 10.5.5. These
I'm working on porting a Visual C++ application to GCC (should build on MingW
GCC is a very well respected multi-language compiler (from what I've gathered). One thing

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.