This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FW: Help with GDB analyzing assembler code


I have searched the web with no luck in finding an answer to my question
and am hoping someone here can answer it or point me in the direction of
someone who can.

We are using RHEL 4.0 AS on an Opteron machine.  I am searching for a
way to count the number of divides, logs, exponentials, etc.  used
during a C++ program.  One suggested way, was to use GDB to debug the
program/assembly code generated and count the number of interested
instructions.

I see that GDB offers a way to print out the program code in assembly
language.  I also see that GDB can output things to a file (default
gdb.txt).  I have also looked at the DDD tool.

My question is this:
Is there a way to execute the program with GDB and print every assembler
line generated and used?  This way - I can output all the lines to a
file, and simply count the number of instructions that were used during
the execution.

Suggestions/ideas?

Thanks,
Sylvia N.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]