From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30977 invoked by alias); 14 Jan 2010 22:46:20 -0000 Received: (qmail 30967 invoked by uid 22791); 14 Jan 2010 22:46:19 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_00,DATE_IN_PAST_24_48,SPF_PASS X-Spam-Check-By: sourceware.org Received: from trinity.develer.com (HELO trinity.develer.com) (83.149.158.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jan 2010 22:46:14 +0000 Received: (qmail 28124 invoked from network); 14 Jan 2010 22:46:10 -0000 Received: from host3g-15.hipuu.com.py (HELO ?172.16.202.122?) (bernie@190.104.161.15) by trinity.develer.com with ESMTPA; 14 Jan 2010 22:46:10 -0000 Subject: Re: Debugging X with GDB From: Bernie Innocenti To: rms@gnu.org Cc: gdb@sourceware.org In-Reply-To: References: <1263170536.29695.86.camel@giskard> <1263243923.2695.72.camel@giskard> Content-Type: text/plain; charset="UTF-8" Date: Thu, 14 Jan 2010 22:46:00 -0000 Message-ID: <1263421855.11940.86.camel@giskard> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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/msg00140.txt.bz2 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. I thought we could easily do that by just setting a breakpoint on dlopen(), but it didn't seem to work for the X server, perhaps because the old, hand-crafted dynamic loader did not call dlopen() at all. Perhaps mmap() would have worked or, as a last resort, open(). gdb supports setting conditional expressions on breakpoints, but I'm not sure they can be used on function arguments and if basic string manipulation is supported. Ideally, we'd want to have the moral equivalent of break dlopen if strstr(filename, "siliconmotion_drv") -- // Bernie Innocenti - http://codewiz.org/ \X/ Sugar Labs - http://sugarlabs.org/