From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4026 invoked by alias); 17 Mar 2004 04:20:39 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 4019 invoked from network); 17 Mar 2004 04:20:39 -0000 Received: from unknown (HELO babyruth.hotpop.com) (38.113.3.61) by sources.redhat.com with SMTP; 17 Mar 2004 04:20:39 -0000 Received: from hotpop.com (kubrick.hotpop.com [38.113.3.103]) by babyruth.hotpop.com (Postfix) with SMTP id C49EA1721C7 for ; Wed, 17 Mar 2004 04:09:04 +0000 (UTC) Received: from [172.16.1.43] (unknown [203.129.254.138]) by smtp-2.hotpop.com (Postfix) with ESMTP id 90028172BA5; Wed, 17 Mar 2004 04:09:00 +0000 (UTC) Subject: Re: ptype of prototype of a funtion From: murugesan To: Michael Elizabeth Chastain Cc: "gdb@sources.redhat.com" In-Reply-To: <20040316141633.96FDE4B104@berman.michael-chastain.com> References: <20040316141633.96FDE4B104@berman.michael-chastain.com> Content-Type: text/plain Organization: Message-Id: <1079497230.4953.25.camel@mun-co> Mime-Version: 1.0 Date: Wed, 17 Mar 2004 04:20:00 -0000 Content-Transfer-Encoding: 7bit X-HotPOP: ----------------------------------------------- Sent By HotPOP.com FREE Email Get your FREE POP email at www.HotPOP.com ----------------------------------------------- X-SW-Source: 2004-03/txt/msg00153.txt.bz2 Hello Michael, Here goes what you wanted. # cat dinesh Script started on Wed Mar 17 09:31:16 2004 # cat dinesh.c #include #include #define PATH "./dinesh_p_v" #define MKDIR(PATH) mkdir(PATH,0755) #define I_LIKE_DINESH 0 int main(int argc, char* argv[]) { FILE *fp; MKDIR(PATH); fp=fopen(PATH"/out","w"); if(!fp) { fprintf(stderr,"\nError in creating the file "PATH"/out\n"); } else { if(PEM_write_PKCS8(fp,NULL)==0) { fprintf(stderr,"\nError in calling the function PEM_write\n"); } } fclose(fp); fp=fopen(PATH"/out","r"); if(PEM_read_PKCS8(fp,NULL,NULL,NULL)!=NULL) { fprintf(stderr,"\nError in calling the function PEM_read\n"); } fclose(fp); return I_LIKE_DINESH; } # gcc --version gcc (GCC) 3.1 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # gcc -g dinesh.c -lcrypto -lssl # gdb a.out HP gdb 3.3 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00. Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-Packard Wildebeest 3.3 (based on GDB) is covered by the GNU General Public License. Type "show copying" to see the conditions to change it and/or distribute copies. Type "show warranty" for warranty/support. .. (gdb) break main Breakpoint 1 at 0x2790: file dinesh.c, line 11. (gdb) r Starting program: /home/murugesh/openssl_test/a.out Breakpoint 1, main (argc=1, argv=0x7dbf07c4) at dinesh.c:11 11 MKDIR(PATH); (gdb) s 12 fp=fopen(PATH"/out","w"); (gdb) 13 if(!fp) (gdb) 19 if(PEM_write_PKCS8(fp,NULL)==0) (gdb) ptype PEM_write_PKCS8 type = int () (gdb) ptype PEM_write_PKCS8() type = int (gdb) whatis PEM_write_PKCS8() type = int (gdb) whatis PEM_write_PKCS8 type = (gdb) The program is running. Exit anyway? (y or n) y # script done on Wed Mar 17 09:32:26 2004 I think I have covered all the answers for your questions. Thanks, Murugesan ========================================================================================================= On Tue, 2004-03-16 at 19:46, Michael Elizabeth Chastain wrote: > Hello Murugesan, > > gdb>ptype fun > type = int () > > Okay, I have some questions: > > What computer and operating system are you using? > What compiler are you using to compile 'fun'? > What version of the compiler are you using? > What command line switches do you use to compile your program? > What command line switches do you use to link your program? > > Can you make a small sample program which shows this problem? > Then use the 'script' command. 'cat' the program, > compile and link the program, run gdb on the program, > exit 'script', and mail us the typescript. > > Michael C