From owner-freebsd-hackers Mon Apr 27 09:33:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA16756 for freebsd-hackers-outgoing; Mon, 27 Apr 1998 09:33:18 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from elvis.vnet.net (elvis.vnet.net [166.82.1.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA16746 for ; Mon, 27 Apr 1998 09:33:11 -0700 (PDT) (envelope-from rivers@dignus.com) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by elvis.vnet.net (8.8.8/8.8.4) with ESMTP id MAA21990; Mon, 27 Apr 1998 12:32:17 -0400 (EDT) Received: from lakes.dignus.com (lakes [10.0.0.3]) by dignus.com (8.8.5/8.8.5) with ESMTP id JAA08571; Mon, 27 Apr 1998 09:49:40 -0400 (EDT) Received: (from rivers@localhost) by lakes.dignus.com (8.8.7/8.6.9) id JAA19787; Mon, 27 Apr 1998 09:25:17 -0400 (EDT) Date: Mon, 27 Apr 1998 09:25:17 -0400 (EDT) From: Thomas David Rivers Message-Id: <199804271325.JAA19787@lakes.dignus.com> To: erakupa@kk.etx.ericsson.se, hackers@FreeBSD.ORG Subject: Re: how to get number of instructions in a prg Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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