|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have a C binary which is built from numerous .c and .h source files.
How can I trace through which functions are being called when I execute the binary? Ideally I'd like to just see the function names accessed. This is on an HP-UX system, but I'm curious as far as Linux is concerned. -Thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
nospam wrote:
> I have a C binary which is built from numerous .c and .h source files. > How can I trace through which functions are being called when I execute > the binary? Ideally I'd like to just see the function names accessed. > This is on an HP-UX system, but I'm curious as far as Linux is concerned. There's no built-into-C facility to do this, but perhaps you can find "test coverage" tools that run on the systems that concern you. (Questions about how to use the tools should be directed to forums about them or about their host systems; they're not questions about the C language.) -- Eric Sosman esosman@ieee-dot-org.invalid |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On May 29, 7:54pm, nospam <n...@spam.com> wrote:
> I have a C binary which is built from numerous .c and .h source files. > How can I trace through which functions are being called when I execute > the binary? Ideally I'd like to just see the function names accessed. > This is on an HP-UX system, but I'm curious as far as Linux is concerned. This is C++ code, but you can probably translate the idea to C: http://www.codeproject.com/KB/cpp/cmtrace.aspx I guess that for your environment, this is what you want: http://www.tlug.org.za/wiki/index.ph...C_upon_SIGSEGV |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
nospam <no@spam.com> writes:
> I have a C binary which is built from numerous .c and .h source files. > How can I trace through which functions are being called when I execute > the binary? Ideally I'd like to just see the function names accessed. > This is on an HP-UX system, but I'm curious as far as Linux is concerned. The C language doesn't define any way to do this. Try asking in comp.sys.hp.hpux, comp.unix.programmer, or one of the Linux groups. -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister" |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
nospam wrote:
> > I have a C binary which is built from numerous .c and .h source > files. How can I trace through which functions are being called > when I execute the binary? Ideally I'd like to just see the > function names accessed. This is on an HP-UX system, but I'm > curious as far as Linux is concerned. If you are using gcc, look up the -p (and -pg) options. For other systems see if there are useful profiling commands. This is all system specific, and thus off-topic here. -- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: <http://cbfalconer.home.att.net> Try the download section. ** Posted from http://www.teranews.com ** |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
In article <oPSdnRSGRavj8aLVnZ2dnUVZ_qTinZ2d@comcast.com>,
nospam <no@spam.com> wrote: >I have a C binary which is built from numerous .c and .h source files. >How can I trace through which functions are being called when I execute >the binary? Ideally I'd like to just see the function names accessed. If all else fails, you can run it under a debugger. -- Richard -- In the selection of the two characters immediately succeeding the numeral 9, consideration shall be given to their replacement by the graphics 10 and 11 to facilitate the adoption of the code in the sterling monetary area. (X3.4-1963) |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
In article <g1odto$l6r$2@pc-news.cogsci.ed.ac.uk>,
Richard Tobin <richard@cogsci.ed.ac.uk> wrote: >In article <oPSdnRSGRavj8aLVnZ2dnUVZ_qTinZ2d@comcast.com>, >nospam <no@spam.com> wrote: > >>I have a C binary which is built from numerous .c and .h source files. >>How can I trace through which functions are being called when I execute >>the binary? Ideally I'd like to just see the function names accessed. > >If all else fails, you can run it under a debugger. Excuse me. Noone here uses debuggers. |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
user923005 <dcorbit@connx.com> writes:
> On May 29, 7:54Âpm, nospam <n...@spam.com> wrote: >> I have a C binary which is built from numerous .c and .h source files. >> How can I trace through which functions are being called when I execute >> the binary? ÂIdeally I'd like to just see the function names accessed. >> This is on an HP-UX system, but I'm curious as far as Linux is concerned. > > This is C++ code, but you can probably translate the idea to C: > http://www.codeproject.com/KB/cpp/cmtrace.aspx > > I guess that for your environment, this is what you want: > http://www.tlug.org.za/wiki/index.ph...C_upon_SIGSEGV Just FYI also see "strace". |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
On Fri, 30 May 2008 02:54:54 UTC, nospam <no@spam.com> wrote:
> I have a C binary which is built from numerous .c and .h source files. > How can I trace through which functions are being called when I execute > the binary? Ideally I'd like to just see the function names accessed. > This is on an HP-UX system, but I'm curious as far as Linux is concerned. It's simple. You'll needs 2 steps. 1. step: tell the compiler to compile and bind the sources with bouded debug information. 2. step: You just starts the program under the control of a debug and tells the debug what you want from it. You can do much more now. You can hold the program at each source line where an executeable statement is. You can let the debug show you the value of each variable in sight when the execution of the debugee is frozen. You can change the value of each variable in sight at this point too. And many, many other things too. The only hurde is: you have to learn how to control the debug. -- Tschau/Bye Herbert Visit http://www.ecomstation.de the home of german eComStation eComStation 1.2R Deutsch ist da! |
|
![]() |
| Outils de la discussion | |
|
|