From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24005 invoked by alias); 5 Jan 2006 14:12:01 -0000 Received: (qmail 23996 invoked by uid 22791); 5 Jan 2006 14:12:01 -0000 X-Spam-Check-By: sourceware.org Received: from smtp01.mrf.mail.rcn.net (HELO smtp01.mrf.mail.rcn.net) (207.172.4.61) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Jan 2006 14:11:56 +0000 Received: from 207-237-137-20.c3-0.80w-ubr16.nyr-80w.ny.cable.rcn.com (HELO [127.0.0.1]) ([207.237.137.20]) by smtp01.mrf.mail.rcn.net with ESMTP; 05 Jan 2006 09:11:52 -0500 X-IronPort-AV: i="3.99,334,1131339600"; d="scan'208"; a="149834896:sNHT126045846" Message-ID: <43BD291F.4030804@ajrh.net> Date: Thu, 05 Jan 2006 14:12:00 -0000 From: Anthony Heading User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: debugging shared libraries Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00018.txt.bz2 Hello, Happy New Year to all. I know this is an old question, but (probably in a bout of fresh New Year optimism) I hopefully tried the following: ~% gdb y.so GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. [...] (gdb) break my_buggy_shared_library_function() Breakpoint 1 at 0x792: file y.cpp, line 5. (gdb) run my_executable Starting program: /home/ajrh/y.so my_executable Breakpoint 1 at 0x80000792: file y.cpp, line 5. warning: shared library handler failed to enable breakpoint Command syntax aside, can GDB really not DWIM? Starting GDB on the .so seems like the right thing to do: the tab-completion etc on the function names works to get breakpoints set up, etc. But if the debug target is a shared library then I probably need to run a different executable to get the process started. (gdb) help file Use FILE as program to be debugged. It is read for its symbols, for getting the contents of pure memory, and it is the program executed when you use the `run' command. Equivalently, I think, do these two properties really need to be hardwired together? For reference, I think this works to my gratification in MS Visual Studio on Win32: if you try to debug a DLL, the program prompts to ask which executable you'd like to start. Regards Anthony