function trace back and address to line number conversion

Thread Tools Search this Thread
Operating Systems AIX function trace back and address to line number conversion
# 1  
Old 10-16-2009
function trace back and address to line number conversion

I am new to AIX and I am developing a small tool for our product which helps debug memory leaks etc.

Q1)Is there a way in which i can get a function trace back as to the call (lets say malloc() )has been made in which file--> in which function.

I tried using the

#pragma options ( i might be making a mistake in the sub options for tbtable would need guidance here too)


which says that a full stack trace would be appended as a text file at the end of the object file that we create if we create the obj file using the -g option.

But I dont seem to see any stack trace at the end of the obj file.
Can someone tell me what possibly could be my mistake? or suggest a better way of getting a stack trace

now using __builtin_return_address() i can get the code address from where the fucntion call ( malloc() ) has been made.

Q2)Is there any function which will help me find the line number of the function call ( malloc() ).

On HP UX we have addr2line() function which does this thing... on AIX i dont have an idea which function does it.

Thank you very much in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find encapsulating function name from line number?

I am looking at a log file which just tells me the filename and the line number inside that file that has the Error. What I am interested is knowing the encapsulating function. For example, here are the contents of the log file Error: foo.file on line wxy Error: foo.file... (3 Replies)
Discussion started by: kaaliakahn
3 Replies

2. Shell Programming and Scripting

Line count of trace files for 24 period

Hi, Using solaris 10 5.10 o/s I am learning awk as I work here on the job. What I need to do is isolate the trace file for the last 24 hours. After that I need to open those trace files and search for 'TNS-|ORA-' message from each one. These trace files MAY HAVE an occurance of them. I... (5 Replies)
Discussion started by: bdby
5 Replies

3. IP Networking

IP address to host name conversion

hi, i want to get the hostname for the specified IP address. # host has address has address has address has address has address... (3 Replies)
Discussion started by: kavitha rao
3 Replies

4. Shell Programming and Scripting

IP address to decimal format conversion

I have a file which consist of some class 4 IP address as i want to store them in pure decimal notations instead of the given dotted decimal formats e.g.... (2 Replies)
Discussion started by: vaibhavkorde
2 Replies

5. UNIX for Dummies Questions & Answers

How to read contents of a file from a given line number upto line number again specified by user

Hello Everyone. I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below: if ; then if ; then tail +$1 $3 | head -n $2 else ... (5 Replies)
Discussion started by: grc
5 Replies

6. Programming

Binary conversion function

Is/are there any function(s) in C that convert(s) character/ASCII/Decimal to binary and vice versa? what about bcopy and strcpy? (1 Reply)
Discussion started by: Peevish
1 Replies

7. Shell Programming and Scripting

Adding a columnfrom a specifit line number to a specific line number

Hi, I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers. To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies

8. Shell Programming and Scripting

Function Trace

Does anyone know if there is a util out there to run through a shell script and be able to trace the function call tree. I have inherited some code and the original author was ****mad**** keen on functions - even ones called only once! If anyone knows of anything I would appreciate it - web... (3 Replies)
Discussion started by: ajcannon
3 Replies

9. UNIX for Dummies Questions & Answers

Date format conversion function

Hello, does somebody knows about a function that would convert a date like: YYMMDD into a date like YYYY-MM-DD ? Thank you for your ideas :) (9 Replies)
Discussion started by: Cecile
9 Replies

10. UNIX for Advanced & Expert Users

conversion of a input function to i18n

m using unix c with curses im trying out the conversion of an existing code in c to i18n for the japanese language. the problem is that, the input which is given as the japanese characters is not taken correctly. and what it outputs is question marks(i.e. ???), equivalent to the number o f... (4 Replies)
Discussion started by: nirnay_s
4 Replies
Login or Register to Ask a Question
LWP::Debug(3)						User Contributed Perl Documentation					     LWP::Debug(3)

LWP::Debug - debug routines for the libwww-perl library SYNOPSIS
use LWP::Debug qw(+ -conns); # Used internally in the library LWP::Debug::trace('send()'); LWP::Debug::debug('url ok'); LWP::Debug::conns("read $n bytes: $data"); DESCRIPTION
LWP::Debug provides tracing facilities. The trace(), debug() and conns() function are called within the library and they log information at increasing levels of detail. Which level of detail is actually printed is controlled with the "level()" function. The following functions are available: level(...) The "level()" function controls the level of detail being logged. Passing '+' or '-' indicates full and no logging respectively. Inidi- vidual levels can switched on and of by passing the name of the level with a '+' or '-' prepended. The levels are: trace : trace function calls debug : print debug messages conns : show all data transfered over the connections The LWP::Debug module provide a special import() method that allows you to pass the level() arguments with initial use statement. If a use argument start with '+' or '-' then it is passed to the level function, else the name is exported as usual. The following two statements are thus equivalent (if you ignore that the second pollutes your namespace): use LWP::Debug qw(+); use LWP::Debug qw(level); level('+'); trace($msg) The "trace()" function is used for tracing function calls. The package and calling subroutine name is printed along with the passed argument. This should be called at the start of every major function. debug($msg) The "debug()" function is used for high-granularity reporting of state in functions. conns($msg) The "conns()" function is used to show data being transferred over the connections. This may generate considerable output. libwww-perl-5.65 1997-12-02 LWP::Debug(3)