From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16780 invoked by alias); 12 Jun 2011 08:15:33 -0000 Received: (qmail 16764 invoked by uid 22791); 12 Jun 2011 08:15:28 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_DB,TW_SM X-Spam-Check-By: sourceware.org Received: from mail-pz0-f41.google.com (HELO mail-pz0-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 12 Jun 2011 08:15:07 +0000 Received: by pzk4 with SMTP id 4so2105465pzk.0 for ; Sun, 12 Jun 2011 01:15:07 -0700 (PDT) Received: by 10.143.76.17 with SMTP id d17mr626158wfl.70.1307857057519; Sat, 11 Jun 2011 22:37:37 -0700 (PDT) Received: from [192.168.1.100] ([115.195.155.250]) by mx.google.com with ESMTPS id z7sm4601924wff.17.2011.06.11.22.37.24 (version=SSLv3 cipher=OTHER); Sat, 11 Jun 2011 22:37:35 -0700 (PDT) Message-ID: <4DF4513A.3090902@gmail.com> Date: Sun, 12 Jun 2011 08:15:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: MinGW Users List , gdb@sourceware.org Subject: Re: setting a breakpoint on a dll, relative path or absolute path issue References: <4DF31EB0.6080006@gmail.com> <4DF37ADA.3070905@users.sourceforge.net> In-Reply-To: <4DF37ADA.3070905@users.sourceforge.net> Content-Type: text/plain; charset=UTF-8; format=flowed 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: 2011-06/txt/msg00082.txt.bz2 On 2011-6-11 22:25, Earnie wrote: > asmwarrior wrote: >> The strange thing is: >> when I pass a true path >> "E:\code\cb\wx\wxWidgets-2.8.12\src/common/string.cpp", then the >> breakpoint failed, gdb report that there is no such source file. >> >> But when using "../../src/common/datetime.cpp" or >> "E:\code\cb\wx\wxWidgets-2.8.12\build\msw/../../src/common/string.cpp", >> the breakpoint can be set correctly. >> >> So, can some gdb developers can tell the truth why this would happen? >> I think at least when using >> "E:\code\cb\wx\wxWidgets-2.8.12\src/common/string.cpp", the breakpoint >> should set correctly. >> > > I'm not a gdb developer nor do I use it often but I'm of the opinion > that gdb isn't looking on disk for the file and is looking instead for a > match in a record in the object data. Does it help if you use the > --directory=/path/to/source/files switch? My dll was located in: E:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28ud_gcc_custom.dll and when build this dll, I use the make file locates in: E:\code\cb\wx\wxWidgets-2.8.12\build\msw\makefile.gcc and all the sources were under: E:\code\cb\wx\wxWidgets-2.8.12\src I have manually add the directory by using those command: dir E:/code/cb/wx/wxWidgets-2.8.12/build/msw dir E:/code/cb/wx/wxWidgets-2.8.12/src dir dir E:/code/cb/wx/wxWidgets-2.8.12/lib/gcc_dll and now, I try to set a break point: > break "E:/code/cb/wx/wxWidgets-2.8.12/src/common/string.cpp:164" No source file named E:/code/cb/wx/wxWidgets-2.8.12/src/common/string.cpp. Breakpoint 3 ("E:/code/cb/wx/wxWidgets-2.8.12/src/common/string.cpp:164) pending. Which means: passing the absolute path still failed. ------------------------------------------------------------ The strange thing is that passing a relative path works > break "../../src/common/string.cpp:164" Breakpoint 4 at 0x66d89f44: file ../../src/common/string.cpp, line 164. This means that gdb internally know this relative path matches some debugging symbols. The more strange thing is, if the path was supplied by this: >>>>>>cb_gdb: > break E:\code\cb\wx\wxWidgets-2.8.12\build\msw/../../src/common/string.cpp:164 Breakpoint 2 at 0x66d89f44: file ../../src/common/string.cpp, line 164. >>>>>>cb_gdb: > break E:\code\cb\wx\wxWidgets-2.8.12\src\common/../../src/common/string.cpp:165 No source file named E:\code\cb\wx\wxWidgets-2.8.12\src\common/../../src/common/string.cpp. Breakpoint 3 (E:\code\cb\wx\wxWidgets-2.8.12\src\common/../../src/common/string.cpp:165) pending. >>>>>>cb_gdb: > break E:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll/../../src/common/string.cpp:165 No source file named E:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll/../../src/common/string.cpp. Breakpoint 4 (E:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll/../../src/common/string.cpp:165) pending. >>>>>>cb_gdb: You can see: if the relative path is followed by E:\code\cb\wx\wxWidgets-2.8.12\build\msw the breakpoint can be set correctly. If the relative path is followed by some other path like: E:\code\cb\wx\wxWidgets-2.8.12\src\common or E:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll The breakpoint can't be set. > >> Can you give me a direction that I can dig into the gdb's source? > > Sorry, no, debugging the debugger is an awesome task and one I've never > desired to do. Good luck on your journey into this venture, I truly wish > you well. There has been little development in gdb on Windows that I > know of and it would be good if someone had the heart to put some love > into it. > thanks for the encourage, and I will do my best to contribute. asmwarrior ollydbg from codeblocks' forum