public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Muthukumar" <kmuthu_linux@HotPOP.com>
To: "murugesan" <mukeshgct@hotpop.com>, "Daniel Jacobowitz" <drow@false.org>
Cc: <gdb@sources.redhat.com>
Subject: Re: ptype of prototype of a funtion
Date: Tue, 16 Mar 2004 10:39:00 -0000	[thread overview]
Message-ID: <01f001c40b42$ff300260$2e0110ac@mukco> (raw)
In-Reply-To: <00e001c40b0a$f941bcf0$4b0110ac@munco>




>>
> gdb>ptype fun
> type = int ()
>
> But 'ptype fun' just displays the return type followed by paranthesis.
>
> Also,
>
> gdb>ptype fun()
> type = int
> What a great! the paranthesis is missing.

You can get also the function information using thr "whatis" command too.
as .,
whatis fun (or) whatis fun()

> But I am unable to get the parameter type.
> Is there really a way to find the parameter type ?

If you are attempting to know about the function parameters then they are only known to the function loop only.
not to the main function.Because they may be local to the function not as global.
At that time you have to get the function parameter informations by going into the function and put the command
ptype or whatis for the particular parameter type.

For example:
main()

If you get the information with ptype then
gdb> ptype main
type = int ()

If you change the code as
/* Global variables */
int argc;
char argv[];
main(argc,argv)

If you get the information with ptype / whatis then
gdb> ptype main
type = int (int, int)

>
> Thanks,
> Murugesan
>


Regards,
Muthukumar.

===========================================================================================
>
> ----- Original Message -----
> From: Daniel Jacobowitz
> To: murugesan
> Cc: gdb@sources.redhat.com
> Sent: Friday, March 12, 2004 9:09 PM
> Subject: Re: ptype of prototype of a funtion
>
>
> On Fri, Mar 12, 2004 at 01:23:59PM +0530, murugesan wrote:
> > Hello all,
> >     ptype fun(NULL,NULL)
> > This gives me the return type of the function fun
> >     Is there a way to get  the prototype of a function i gdb.
> >
> > I don't know the type of the parameters of fun which can have the value
> > NULL. [ (void*)0 ]
> >
> > thanks in advance for the help.
>
> How about 'ptype fun'?
>
> --
> Daniel Jacobowitz
> MontaVista Software                         Debian GNU/Linux Developer
>
>


  reply	other threads:[~2004-03-16 10:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-12  7:53 murugesan
2004-03-12 15:39 ` Daniel Jacobowitz
2004-03-16  3:58   ` murugesan
2004-03-16 10:39     ` Muthukumar [this message]
2004-03-12 15:39 Michael Elizabeth Chastain
2004-03-16 11:31 murugesan
2004-03-16 14:16 Michael Elizabeth Chastain
2004-03-17  4:20 ` murugesan
2004-03-17  4:35   ` Ramana Radhakrishnan
2004-03-17  5:58     ` murugesan
2004-03-18  4:46       ` murugesan
2004-03-17  5:19 Michael Elizabeth Chastain
2004-03-18 19:52 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='01f001c40b42$ff300260$2e0110ac@mukco' \
    --to=kmuthu_linux@hotpop.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=mukeshgct@hotpop.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).