addr2line help required

S

suman

I am trying out addr2line inside my program.I am invoking system(cmd) where cmd
is a string "addr2line -e exename -f 0x56773" where 0x56773 is an address inside
my program.
Now the problem is i want the output of addr2line to be written to a file(All
the logs inside my program are written to file only). By default addr2line will
print its output to stdout, which is what i don't want. Is it possible to
"redirect" the output of addr2line to the FILE??

Can any one please help me in this regard,
Thanks in advance,
Suman
 
R

Richard Bos

suman said:
Now the problem is i want the output of addr2line to be written to a file(All
the logs inside my program are written to file only). By default addr2line will
print its output to stdout, which is what i don't want.

Then you want help using your OS, not using C. The answer to your
question depends on what OS you're using, and may be different on all of
them. You'll have to ask in a newsgroup for using, not programming, your
OS - or even *gasp* read the friggin' manual.
<OT>
It's very likely to involve the > sign, though.
</OT>

Richard
 
M

Mark McIntyre

On Wed, 01 Jun 2005 14:39:09 GMT, in comp.lang.c ,
<OT>
It's very likely to involve the > sign, though.

although not on VMS, which is a fairly good demonstration why its
offtopic here...
 
S

SM Ryan

# I am trying out addr2line inside my program.I am invoking system(cmd) where cmd
# is a string "addr2line -e exename -f 0x56773" where 0x56773 is an address inside
# my program.
# Now the problem is i want the output of addr2line to be written to a file(All
# the logs inside my program are written to file only). By default addr2line will
# print its output to stdout, which is what i don't want. Is it possible to
# "redirect" the output of addr2line to the FILE??

Can you redirect the output at the command line or shell prompt? The string in
the system() function will probably look the same. If I wanted to redirect output
to /tmp/syo on my machine I would do something like system("gdb ... >/tmp/syo").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top