From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10246 invoked by alias); 15 Jan 2010 01:48:09 -0000 Received: (qmail 9974 invoked by uid 22791); 15 Jan 2010 01:48:06 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jan 2010 01:48:02 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0F1lhJR000605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Jan 2010 20:47:44 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0F1lhXU011122; Thu, 14 Jan 2010 20:47:43 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o0F1lgMk001691; Thu, 14 Jan 2010 20:47:42 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id C6CB837819A; Thu, 14 Jan 2010 18:47:41 -0700 (MST) From: Tom Tromey To: Bernie Innocenti Cc: rms@gnu.org, gdb@sourceware.org Subject: Re: Debugging X with GDB References: <1263170536.29695.86.camel@giskard> <1263243923.2695.72.camel@giskard> <1263421855.11940.86.camel@giskard> Reply-To: tromey@redhat.com Date: Fri, 15 Jan 2010 01:48:00 -0000 In-Reply-To: <1263421855.11940.86.camel@giskard> (Bernie Innocenti's message of "Wed, 13 Jan 2010 17:30:55 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00142.txt.bz2 >>>>> "Bernie" == Bernie Innocenti writes: Bernie> On Tue, 2010-01-12 at 18:19 -0500, Richard Stallman wrote: >> That is good, but GDB knew to recognize that the driver file was being >> loaded even with old X server. Given that it could recognize the >> file, it could also offer a command to specify "stop the program after >> loading file FOO". That will be useful when strange things are >> happening. Bernie> I thought we could easily do that by just setting a breakpoint on Bernie> dlopen(), but it didn't seem to work for the X server, perhaps because Bernie> the old, hand-crafted dynamic loader did not call dlopen() at all. Bernie> Perhaps mmap() would have worked or, as a last resort, open(). You could try `set stop-on-solib-events on'. This isn't as handy as a breakpoint because you can't make it conditional. IMO, both this and `handle' would be better expressed as `catch' subcommands (thus allowing conditions and attached commands automatically) -- but AFAIK nobody is actively working on this. Bernie> gdb supports setting conditional expressions on breakpoints, but I'm not Bernie> sure they can be used on function arguments and if basic string Bernie> manipulation is supported. Yes to both. Tom