Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Apr 1998 09:25:17 -0400 (EDT)
From:      Thomas David Rivers <rivers@dignus.com>
To:        erakupa@kk.etx.ericsson.se, hackers@FreeBSD.ORG
Subject:   Re: how to get number of instructions in a prg
Message-ID:  <199804271325.JAA19787@lakes.dignus.com>

next in thread | raw e-mail | index | archive | help
> 
> What is the easiest way to count the number of assembler instructions
> in a program?

 If you can recompile the program, simply add the -S flag onto gcc.
This will have it "leave around" it's assembly source.

 Then, you can readily us 'wc' on that assembly source to get the
number of lines, which will be a good approximation to the number of
instructions...

	- Dave Rivers -

> 
> In gdb there is the "disassemble function-name" command, but it
> disassembles only the given function. One could of course call this
> several times and each time count the lines, but since a program can
> have several hundred small sub-functions, this method is not the best...
> 
> Thanks in advance,
> 
> Martti
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
> 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804271325.JAA19787>