DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Collecting Usage Data in Eclipse
  • Making an IoT Developer’s Life Easier With Eclipse IoT Packages
  • Beginners Guide for Web Scraping Using Selenium
  • Projection Queries: A Way to Optimize Data Traffic

Trending

  • Exploring Sorting Algorithms: A Comprehensive Guide
  • How To Deploy Helidon Application to Kubernetes With Kubernetes Maven Plugin
  • Bad Software Examples: How Much Can Poor Code Hurt You?
  • Choosing the Appropriate AWS Load Balancer: ALB vs. NLB
  1. DZone
  2. Data Engineering
  3. Data
  4. Listing Code and Data Size for Each Source File with GNU and Eclipse

Listing Code and Data Size for Each Source File with GNU and Eclipse

Erich Styger user avatar by
Erich Styger
·
Sep. 26, 14 · Interview
Like (0)
Save
Tweet
Share
6.40K Views

Join the DZone community and get the full member experience.

Join For Free

i have used the ‘classic’ codewarrior ide for years, before i moved over to eclipse some years ago. and as with any ide or tool switch, things are different in the ‘new world’. in summary, i don’t want to go back anyway, and eclipse is my development tool of choice now. but from time to time i get challenged about something like “hey, this was possible in the previous tool, so how can i do the same in eclipse?”. as a fan of eclipse, this then gets my attention as i feel that eclipse can do it, and it can do it better. ;-)

so what about this one: in codewarrior the project view lists code and data size for each source file:

code and data size in codewarrior

code and data size in codewarrior

codewarrior can easily do this, as it maintains an internal data base of the code and details of each compilation unit/file. to me, that feature is nice, but had not much relevance for me, as this does not tell me what will be the code and data size in the application (.elf) file. because the linker will be smart enough to strip unused functions and data.

anyway, how to do this in eclipse and gnu tools? actually, i have not found a way to show it in a nice view :-(. but i know from my post “ printing code size information in eclipse ” that the ‘size’ utility prints code and data size. but by default only for the application after linking. which is what i need anyway. but what about listing code and date size for the source files?

my solution is to list the object files as ‘other flags’ the ‘print size’ settings in the project:

listing object files for gnu print size

listing object files for gnu print size

with the gnu gcc arm embedded (launchpad) 4.8.x it is possible to use wildcards like sources\*.o. this is not supported in the gnu tools in kds, as they are using older or different tools, but you can swap the tools chain, see “ switching arm gnu tool chain and libraries in kinetis design studio “.

i can use relative paths, as at least with the gnu arm eclipse plugins the gnu tools have the ‘output’ folder as current directory:

object files

object files

this then lists the size information at the end of the link phase:

'invoking: cross arm gnu print size'
arm-none-eabi-size --format=berkeley sources\events.o sources\main.o generated_code\cpu.o generated_code\wait1.o generated_code\io1.o generated_code\csio1.o "k64_pex_printf.elf"
  text    data      bss       dec      hex      filename
    12       0        0        12        c      sources\events.o
   140       0        0       140       8c      sources\main.o
   108       0        0       108       6c      generated_code\cpu.o
   188       0        0       188       bc      generated_code\wait1.o
   824       0       24       848      350      generated_code\io1.o
   276       0        0       276      114      generated_code\csio1.o
 10572     712     8496     19780     4d44      k64_pex_printf.elf
'finished building: k64_pex_printf.siz'

summary

it is possible to list the code and data size for each source (well, object) file in eclipse. i admit it is not in the project view or in a graphical view, and i need to list the object files individually. so i do not say that eclipse can do the *same*, but i think it is very close ;-)

happy sizing :-)


Eclipse Data (computing) GNU Listing (computer)

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Collecting Usage Data in Eclipse
  • Making an IoT Developer’s Life Easier With Eclipse IoT Packages
  • Beginners Guide for Web Scraping Using Selenium
  • Projection Queries: A Way to Optimize Data Traffic

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: