Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » trying to add a page to the wiki for cDT
trying to add a page to the wiki for cDT [message #95998] Tue, 02 March 2004 11:05 Go to next message
Eclipse UserFriend
Hi,

I figured out how to configure Eclipse 3 so that it works with gprof. I
tried puttting a page up in wiki but it keeps telling me the connection
is refused.

Any tricks on what I need to do so I can connect and then add my page?

Thanks

David
wiki text here [message #96014 is a reply to message #95998] Tue, 02 March 2004 11:23 Go to previous message
Eclipse UserFriend
I can't seem to get to the site. it just keeps saying connection refused.

I'll post the wiki stuff here in the hopes I can try it from a different
ip address at a later time????


= Using a profile tool with linux =
In the main http://www.eclipse.org/cdt FAQ there is reference to a
profiling capability. The IDE is very flexible as it is plug-in driven
and external tools can be configured as needed. gprof and eclipse is
mentioned
http://dev.eclipse.org/viewcvs/index.cgi/cdt-home/user/faq.h tml?cvsroot=Tools_Project&rev=1.24.
They say gprof and gdb are only officially supported on Linux. In the
project properties, the ability to add profile information is a
'checkbox', so its probably supported given the right parameters are
supplied.
== Setting up gprof ==

The basic method to using gprof is to
|| Step || Instruction ||
||1) || Get the program working (debug it, etc) ||
||2) || Configure the project so the -pg option is used ||
||3) || Rebuild the project ||
||4) || Run the program (First cut I did '''Run''' on the debug build)
||
||5) || Run the external tool '''gprof''' ||


=== configuring the project so the -pg option is used ===
* Select the project and right click to bring up the context sensitive
menu. Choose '''properties'''
* A properties dialog will appear
* In the left pane, select '''C/C++ Build'''
* In the right pane (configuration settings groupbox), select
'''Debugging'''.
* Make sure the following settings are observed (minimally)

|| Field Name || Value ||
|| Debug Level || '''Maximum (-g3)''' ||
|| Other Debugging Flags || '''-ggdb''' ||
|| Generate prof information (-p) || '''unchecked''' ||
|| Generate gprof information (-pg) || '''checked''' ||

* Press '''OK''' or '''Apply''' then '''OK''' to accept the changes.
=== Preparing to do a run ===
* On the menu select, '''Project | Rebuild All''' to build the project.
* On the menu select, '''Run | Run...''' to open up the run
configuration dialog.
* Once you have run once, you can just do '''Run | Run last
launched'''.
* Press the '''New''' button and then select what build to run and what
arguments to use.
* Press the '''Apply''' button to save your changes.
* Press the '''Run''' button to run your program.
* from the linux shell you should see a new file appear called
gmon.out in the directory where the program was executed from.

=== Configure gprof so it will be run as an external tool ===
* On the menu select, '''Run | External Tools | External Tools'''

A dialog will open.
* Select '''Program''' in the left pane and press the '''New''' button.
* At a linux shell prompt type {{{which gprof}}}. Use this value to
denote the Location

Enter the following values

|| Field Name || Value || Notes
||
|| Name || {{{gprof}}} || This is what will
appear on the submenu under external tools ||
|| Location || {{{/usr/bin/gprof}}} || full path and name of
gprof ||
|| Working Directory || {{{${resource_loc}}}} || <<No comment>> ||
|| Arguments || {{{${project_name}}}} || Add any extra gprof
arguments here ||

* Press the '''Apply''' button.
* Press the '''Close''' button.

=== Running gprof ===
* Select the project folder to run the profile on
* If the target is the debug build, then select the debug folder.
* On the menu, Select '''Run | External Tools | gprof'''
* Note, whatever name you entered when you configured gprof, that name
will show up on the third sub-menu (above).
* The output will be sent to the 'console' tab window in the Eclipse
editor.
Previous Topic:Narrowing scope of navigation
Next Topic:macosx host
Goto Forum:
  


Current Time: Thu Sep 18 19:23:51 EDT 2025

Powered by FUDForum. Page generated in 0.02511 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top