delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/05/29/07:27:55

X-Spam-Check-By: sourceware.org
Message-ID: <447ADA84.3070404@freenet.de>
Date: Mon, 29 May 2006 13:27:00 +0200
From: Ralf Habacker <ralf DOT habacker AT freenet DOT de>
User-Agent: Thunderbird 1.5.0.2 (Windows/20060308)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: note about how-to-debug-cygwin.txt
References: <447A0F37 DOT 2080704 AT freenet DOT de> <20060528214504 DOT GB3974 AT trixie DOT casa DOT cgf DOT cx>
In-Reply-To: <20060528214504.GB3974@trixie.casa.cgf.cx>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christopher Faylor schrieb:
> On Sun, May 28, 2006 at 10:59:35PM +0200, Ralf Habacker wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> In the how-to-debug-cygwin.txt there is listed how to run application
>> using strace in gdb:
>>
>> To debug this scenario, do something like this:
>>
>>    bash$ gdb -nw yourapp.exe
>>    (gdb) dll cygwin1
>>    (gdb) l dll_crt0_1
>>    (gdb) b <<first line in the function>>
>>    (gdb) run
>>    (gdb) set strace.active=1
>>    (gdb) continue
>>
>>
>> According to winsup/cygwin/include/sys/strace.h the class member active
>> is known now as _active.
> 
> I've changed this.
> 
>> I have tried to get this running in gdb (cvs), but there is no output in
>> gdb.
> 
> Getting output from gdb was not the intent of this section.  Look at the
> name of the section: "Program dies when running under strace".  If the
> intent was to get output from gdb it would have been something like
> "Make gdb output strace info".

It was not explicit said that there is no output, so I guess it was.

> I'm not aware of any way to have gdb print strace info.

The following patch enables gdb to print cygwin strace messages.

2006-05-29 Ralf Habacker <ralf DOT habacker AT freenet DOT de>

	* win32-nat.c: (handle_output_debug_string): initial strace
	output support for cygwin.


Index: gdb/win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.122
diff -u -b -B -r1.122 win32-nat.c
- --- gdb/win32-nat.c	10 Apr 2006 21:43:45 -0000	1.122
+++ gdb/win32-nat.c	29 May 2006 11:19:49 -0000
@@ -927,7 +927,12 @@
     /* nothing to do */;
   else if (strncmp (s, _CYGWIN_SIGNAL_STRING, sizeof
(_CYGWIN_SIGNAL_STRING) - 1) != 0)
     {
- -      if (strncmp (s, "cYg", 3) != 0)
+      if (strncmp (s, "cYg", 3) == 0)
+        {
+          char *p = strchr(s+12,' '); // skip 'cYgxxxxxxxx <category>'
+          printf_unfiltered ("strace: %s", p ? p+1 : s+12);
+        }
+      else
 	warning (("%s"), s);
     }
 #ifdef __COPY_CONTEXT_SIZE
===================================================================

Regards
 Ralf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEetqEoHh+5t8EXncRAuhNAJ9ox5IHUnkqZL93hQejih0HuIraIQCglMhg
22SIlwNUvNgbx6dfzMYe640=
=gqy2
-----END PGP SIGNATURE-----

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019