From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22700 invoked by alias); 27 May 2009 20:53:43 -0000 Received: (qmail 22689 invoked by uid 22791); 27 May 2009 20:53:42 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 May 2009 20:53:34 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n4RKrRZs005530 ; Wed, 27 May 2009 22:53:27 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n4RKrRuB037055 ; Wed, 27 May 2009 22:53:27 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n4RKrQlt064037 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Wed, 27 May 2009 22:53:26 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" Cc: References: <001401c9de9f$928b9f80$b7a2de80$@u-strasbg.fr> <83ab4ys5zy.fsf@gnu.org> In-Reply-To: <83ab4ys5zy.fsf@gnu.org> Subject: RE: [RFA] Fix troubles with watchpoints in DJGPP Date: Wed, 27 May 2009 20:53:00 -0000 Message-ID: <001b01c9df0d$32609890$9721c9b0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00592.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Eli Zaretskii > Envoy=E9=A0: Wednesday, May 27, 2009 9:25 PM > =C0=A0: Pierre Muller (IMAP) > Cc=A0: gdb-patches@sourceware.org > Objet=A0: Re: [RFA] Fix troubles with watchpoints in DJGPP >=20 > > From: "Pierre Muller \(IMAP\)" > > Date: Wed, 27 May 2009 09:48:49 +0200 > > > > > > I also tried to use it but I have several problems, > > some are probably DJGPP specific > > (bad file descriptor errors when trying to restart > > a ./gdb executable at level 2, meaning inside another gdb > > itself being debugged by gdb). >=20 > Please give me some simple test program and a transcript of a GDB > session that reproduces this problem. I debug GDB with itself a lot, > and I never saw this. Compile gdb on current CVS head. in build/gdb bash-2.05b$ ./gdb ./gdb GNU gdb (GDB) 6.8.50.20090524-cvs Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=3Di586-pc-msdosdjgpp --target=3Ddjgpp". For bug reporting instructions, please see: ... (gdb) watch gdb_tderr No symbol "gdb_tderr" in current context. (gdb) watch gdb_stderr Watchpoint 1: gdb_stderr (gdb) r Starting program: e:/cygwin/usr/local/src/gdbcvs/djbuild/gdb/./gdb.exe Watchpoint 1: gdb_stderr Old value =3D New value =3D (struct ui_file *) 0x0 0x00001a91 in start () (gdb) inf watch Num Type Disp Enb Address What 1 watchpoint keep y gdb_stderr breakpoint already hit 1 time (gdb) q With patch go32-nat.c file: bash-2.05b$ ./gdb ./gdb GNU gdb (GDB) 6.8.50.20090524-cvs Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=3Di586-pc-msdosdjgpp --target=3Ddjgpp". For bug reporting instructions, please see: ... (gdb) watch gdb_stderr Watchpoint 1: gdb_stderr (gdb) r Starting program: e:/cygwin/usr/local/src/gdbcvs/djbuild/gdb/./gdb.exe Hardware watchpoint 1: gdb_stderr Old value =3D (struct ui_file *) 0x0 New value =3D (struct ui_file *) 0x3aa7dc captured_main (data=3D0x3a92d0) at ../../purecvs/gdb/main.c:322 322 gdb_stdlog =3D gdb_stderr; /* for moment */ (gdb) inf watch Num Type Disp Enb Address What 1 hw watchpoint keep y gdb_stderr breakpoint already hit 1 time (gdb)q With the patch, the 'watchpoint'=20 is successfully promoted into a 'hardware watchpoint' thanks to this=20 breakpoint_re_set call. > Also, on what platform (OS and version) is that? >=20 > > After some debugging, I realized that > > DJGPP only calls insert_breakpoints () > > that does call update_watchpoint with reparse set to one, > > after pushing go32 target, > > while with cygwin, the DLL loaded caused a > > reloading of all breakpoints and triggered a > > call to update_watchpoint with reparse =3D 1. > > > > > > This one line patch fixes the problem. > > > > Is this patch OK? >=20 > Thanks, but here, too, I would like a simple test program and a > transcript of a GDB session before and after the patch. I hope the above is enough for you. =20 > > PS-2) Eli, > > do you have anything that could help me debug the > > Bad file descriptor problems, like a library recording > > file opening/closing using the DJGPP file system extensions? >=20 > No, but you can put a breakpoint on the respective library functions, > couldn't you? I discovered that there is already something in dbgcom.c, but I wanted to have dup and dup2 calls=20 be monitored also, as the problem seems related to handles of that type... But dup and dup2 never generate a call to the FSEXT function, which make it not useful for that :( Pierre