* How can I get the C function prototype from a SO(link by cc) on solaris using gdb?
@ 2002-06-21 2:16 NewHaka@hotmail
2002-06-21 8:38 ` Joel Brobecker
2002-06-21 10:05 ` Don Howard
0 siblings, 2 replies; 6+ messages in thread
From: NewHaka@hotmail @ 2002-06-21 2:16 UTC (permalink / raw)
To: gdb
hi,all
(gdb 5.0 sparc solaris 8)
I have a library link by sun cc,this library is complied and link
with flag -g.
I try to find out the prototype of functions in this library,gdb output:
(gdb) p GetDatVersion
$1 = {<text variable, no debug info>} 0xff273374 <GetDatVersion>
(gdb) p GetDatVersion
type = int ()
Does the library must complied by gcc?
Thanks.
regards
haka
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: How can I get the C function prototype from a SO(link by cc) on solaris using gdb?
2002-06-21 2:16 How can I get the C function prototype from a SO(link by cc) on solaris using gdb? NewHaka@hotmail
@ 2002-06-21 8:38 ` Joel Brobecker
2002-06-21 10:05 ` Don Howard
1 sibling, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2002-06-21 8:38 UTC (permalink / raw)
To: NewHaka@hotmail; +Cc: gdb
> (gdb 5.0 sparc solaris 8)
>
> I have a library link by sun cc,this library is complied and link
> with flag -g.
>
> I try to find out the prototype of functions in this library,gdb output:
> (gdb) p GetDatVersion
> $1 = {<text variable, no debug info>} 0xff273374 <GetDatVersion>
> (gdb) p GetDatVersion
> type = int ()
>
> Does the library must complied by gcc?
I don't have a Sun CC license handy to verify this, but I remember that
Sun decided to put the debugging informatin outside of the object files.
IIRC, the magical switch is -xs (try compiling with '-g -xs'), otherwise
it should be in the cc manpage.
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: How can I get the C function prototype from a SO(link by cc) on solaris using gdb?
2002-06-21 2:16 How can I get the C function prototype from a SO(link by cc) on solaris using gdb? NewHaka@hotmail
2002-06-21 8:38 ` Joel Brobecker
@ 2002-06-21 10:05 ` Don Howard
2002-06-21 10:08 ` Don Howard
2002-06-21 10:27 ` Keith Seitz
1 sibling, 2 replies; 6+ messages in thread
From: Don Howard @ 2002-06-21 10:05 UTC (permalink / raw)
To: NewHaka@hotmail; +Cc: gdb
On Fri, 21 Jun 2002, NewHaka@hotmail wrote:
> hi,all
>
> (gdb 5.0 sparc solaris 8)
>
> I have a library link by sun cc,this library is complied and link
> with flag -g.
>
> I try to find out the prototype of functions in this library,gdb output:
> (gdb) p GetDatVersion
> $1 = {<text variable, no debug info>} 0xff273374 <GetDatVersion>
> (gdb) p GetDatVersion
> type = int ()
>
> Does the library must complied by gcc?
>
'p <function>' or 'print <function>' tells you only the returned type.
Try 'ptype <function>'.
--
dhoward@redhat.com
gdb engineering
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: How can I get the C function prototype from a SO(link by cc) on solaris using gdb?
2002-06-21 10:05 ` Don Howard
@ 2002-06-21 10:08 ` Don Howard
2002-06-21 10:27 ` Keith Seitz
1 sibling, 0 replies; 6+ messages in thread
From: Don Howard @ 2002-06-21 10:08 UTC (permalink / raw)
To: NewHaka@hotmail; +Cc: gdb
On Fri, 21 Jun 2002, Don Howard wrote:
> On Fri, 21 Jun 2002, NewHaka@hotmail wrote:
>
> > hi,all
> >
> > (gdb 5.0 sparc solaris 8)
> >
> > I have a library link by sun cc,this library is complied and link
> > with flag -g.
> >
> > I try to find out the prototype of functions in this library,gdb output:
> > (gdb) p GetDatVersion
> > $1 = {<text variable, no debug info>} 0xff273374 <GetDatVersion>
> > (gdb) p GetDatVersion
> > type = int ()
> >
> > Does the library must complied by gcc?
> >
>
> 'p <function>' or 'print <function>' tells you only the returned type.
> Try 'ptype <function>'.
No. I'm quite wrong here. Both commands should give you full prototype
info when applied to a function.
Sorry for the confusion.
--
dhoward@redhat.com
gdb engineering
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: How can I get the C function prototype from a SO(link by cc) on solaris using gdb?
2002-06-21 10:05 ` Don Howard
2002-06-21 10:08 ` Don Howard
@ 2002-06-21 10:27 ` Keith Seitz
2002-06-23 17:46 ` Hi,Thank you for your help! Re: How can I get the C function protot NewHaka@hotmail
1 sibling, 1 reply; 6+ messages in thread
From: Keith Seitz @ 2002-06-21 10:27 UTC (permalink / raw)
To: NewHaka@hotmail; +Cc: gdb
On Fri, 21 Jun 2002, NewHaka@hotmail.com wrote:
> I try to find out the prototype of functions in this library,gdb output:
> (gdb) p GetDatVersion
> $1 = {<text variable, no debug info>} 0xff273374 <GetDatVersion>
^^^^^^^^^^^^^
> Does the library must complied by gcc?
No, but it must contain debug info that gdb can read...
Keith
^ permalink raw reply [flat|nested] 6+ messages in thread* Hi,Thank you for your help! Re: How can I get the C function protot....
2002-06-21 10:27 ` Keith Seitz
@ 2002-06-23 17:46 ` NewHaka@hotmail
0 siblings, 0 replies; 6+ messages in thread
From: NewHaka@hotmail @ 2002-06-23 17:46 UTC (permalink / raw)
To: Keith Seitz, dhoward, brobecker; +Cc: gdb
hi
Thank you for your help.
regards
haka
----- Original Message -----
From: "Keith Seitz" <keiths@redhat.com>
To: "NewHaka@hotmail" <newhaka@hotmail.com>
Cc: <gdb@sources.redhat.com>
Sent: Saturday, June 22, 2002 1:27 AM
Subject: Re: How can I get the C function prototype from a SO(link by cc) on solaris using gdb?
| On Fri, 21 Jun 2002, NewHaka@hotmail.com wrote:
|
| > I try to find out the prototype of functions in this library,gdb output:
| > (gdb) p GetDatVersion
| > $1 = {<text variable, no debug info>} 0xff273374 <GetDatVersion>
| ^^^^^^^^^^^^^
|
| > Does the library must complied by gcc?
|
| No, but it must contain debug info that gdb can read...
|
| Keith
|
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-06-24 0:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-21 2:16 How can I get the C function prototype from a SO(link by cc) on solaris using gdb? NewHaka@hotmail
2002-06-21 8:38 ` Joel Brobecker
2002-06-21 10:05 ` Don Howard
2002-06-21 10:08 ` Don Howard
2002-06-21 10:27 ` Keith Seitz
2002-06-23 17:46 ` Hi,Thank you for your help! Re: How can I get the C function protot NewHaka@hotmail
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox