473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

print all the functions invoked in a C program

How do I get a log of all the functions invoked in a huge C program ?
Does GDB (or ddd) have any such option ?
I mean the simplest possible scenario (please do not go for non-
debuggable object files or other such stuff)

This is required to compare the behaviour of two options which modify
two global variables and the
program runs differently for the two cases but this is not expected.
So we want to get a diff of the "functions invoked logs" in the two
cases.

Oct 31 '07 #1
7 1323
call_me_anything wrote:
How do I get a log of all the functions invoked in a huge C program ?
The tool to use is "a profiler".
Does GDB (or ddd) have any such option ?
You need to ask in the newsgroup that deals with GDB or ddd. I would
think that 'gprof' is what you need.
I mean the simplest possible scenario (please do not go for non-
debuggable object files or other such stuff)
Huh?
[..]
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 31 '07 #2
Shouldn't GDB have such an option ?
I mean all it needs to do is print the function name when it is about
to evaluate any function name.

Oct 31 '07 #3
call_me_anything wrote:
Shouldn't GDB have such an option ?
I mean all it needs to do is print the function name when it is about
to evaluate any function name.
Please ask in the newsgroup where GDB is on topic. Like in 'gnu.*'
hierarchy.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 31 '07 #4
call_me_anything <sg********@gmail.comwrites:
Shouldn't GDB have such an option ?
GDB is a debugger, not a profiler. GProf is the GNU profiler.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Oct 31 '07 #5
If you have access to the source code and are able to recompile it, you
may use the "-finstrument-functions" option of GCC, you may also have a
look there: http://freshmeat.net/projects/etrace/ for a ready-to-use
tool that prints the call tree of an execution.

call_me_anything a écrit :
How do I get a log of all the functions invoked in a huge C program ?
Does GDB (or ddd) have any such option ?
I mean the simplest possible scenario (please do not go for non-
debuggable object files or other such stuff)

This is required to compare the behaviour of two options which modify
two global variables and the
program runs differently for the two cases but this is not expected.
So we want to get a diff of the "functions invoked logs" in the two
cases.
Oct 31 '07 #6
Shouldn't GDB have such an option ?
I mean all it needs to do is print the function name when it is about
to evaluate any function name.

Oct 31 '07 #7
On 2007-10-31 21:37, call_me_anything wrote:
Shouldn't GDB have such an option ?
I mean all it needs to do is print the function name when it is about
to evaluate any function name.
1) Please quote the text you are replying to.

2) Posting the same question twice generally does not give you a better
answer, but it can annoy some people reducing the chances of getting an
answer.

3) Questions about gdb should be asked in a group discussing gbd.

An finally, yes you can probably make gdb print the names of functions
as you enter them with some fancy scripting or such (see 3. above
though). However profilers also do that and they are designed to do it
so it would be better to use one (and no profilers are not discussed in
here).

--
Erik Wikström
Oct 31 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rick | last post by:
Hello all. I have an index.php file that has a lot of functions that I wrote. Let's say for the sake of argument that there are 1000 functions of 100 lines each. The index.php file is invoked...
12
by: Joel | last post by:
Hi all, Forgive me if I've expressed the subject line ill. What I'm trying to do is to call a c++ function given the following: a. A function name. This would be used to fetch a list of...
47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
3
by: Martin McCormick | last post by:
A C program contains several signal statements to remove a lock file if the program gets killed: /*Set up interrupt handler to catch ctrl-C so that lock file can be removed.*/...
1
by: Robin Dindayal | last post by:
Does anyone know how I can print a fully rendered .aspx to the server's printer? I know that, if I wanted to print to the client's printer it would be easy (ie. use javascript's window.print()). ...
5
by: Tony | last post by:
Every 10 seconds I need to search a SQL table for orders to print. The orders are created through WebForms on ASP.NET clients. The orders should not print until 10 minutes before they are due. ...
10
by: aatish19 | last post by:
1: Write a program that asks the user to input an integer value and print it in a reverse order Sample Output Enter any number 65564 Reverse of 65564 is 46556 2: Write a program that takes a...
4
by: gw7rib | last post by:
If a class has more than one member function, is it possible for the code for one to be in one translation unit (ie file) and the code for another to be in a different translation unit? I would...
36
by: Kapteyn's Star | last post by:
hi group, i try to compile code below but my compiler is failing. it tells:- printbin.c: In function ‘main’: printbin.c:9: error: invalid operands to binary & i am not able to understand what...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.