This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem debugging application that calls getservbyname()


On Apr  3 22:22, Brian Dessent wrote:
> #include <string.h>
> #include <netdb.h>
> 
> int main(char **argv, int argc)
> {
>   struct servent *p;
> 
>   if((p = getservbyname("smtp", "tcp"))) {
>     printf("success\n");
>   } else {
>     printf("failure\n");
>   }  
> }
> 
> Simple enough, no?
> 
> $ ./getservbyname 
> success
> 
> However, when I try to run this with gdb, the call to getservbyname()
> dies somewhere in the autoloading code of Cygwin:
> 
> $ gdb --quiet getservbyname
> (gdb) br main
> Breakpoint 1 at 0x40107e: file getservbyname.c, line 8.
> (gdb) run
> Starting program: /tmp/getservbyname.exe 
> 
> Breakpoint 1, main (argv=0x1, argc=168109856) at getservbyname.c:8
> 8         if((p = getservbyname("smtp", "tcp"))) {
> (gdb) n
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x7801b8a8 in RpcRaiseException () from /winxp/system32/rpcrt4.dll
> (gdb) c
> Continuing.

Hmm, http://cygwin.com/acronyms/#WJFFM


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]