public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: asmwarrior <asmwarrior@gmail.com>
To: gdb@sourceware.org,
	 MinGW Users List <mingw-users@lists.sourceforge.net>
Subject: setting a breakpoint on a dll, relative path or absolute path issue
Date: Sat, 11 Jun 2011 07:49:00 -0000	[thread overview]
Message-ID: <4DF31EB0.6080006@gmail.com> (raw)

I meet some problems on setting a break point on a shared dll. (I'm 
using gdb cvs 20110401 mingw32 build version)
The dll is build with relative sources paths, and my main App was build 
with absolute source paths.

the dll is a debug version of wxWidgets shared library, locates in:
E:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28ud_gcc_custom.dll

Here is the debug log:

--------------------------------------------------------
info sources
Source files for which symbols have been read in:
E:\code\cb\test_code\debug_wx_library\debug_wx_libraryMain.cpp, 
E:/code/cb/wx/wxWidgets-2.8.12/include/wx/generic/textdlgg.h,
...
e:/code/cb/gcc/mingw_gcc4.5.4.20110428_static_win32/mingw/bin/../lib/gcc/i686-pc-mingw32/4.5.4/include/c++/i686-pc-mingw32/bits/gthr-default.h, 

E:\code\cb\wx\wxWidgets-2.8.12\build\msw/../../include/wx/filefn.h, 
E:\code\cb\wx\wxWidgets-2.8.12\build\msw/../../include/wx/filename.h,
...
Source files for which symbols will be read in on demand:

../.././libgcc/../gcc/gthr-win32.h,

...

E:/code/cb/wx/wxWidgets-2.8.12/include/wx/list.h, 
E:/code/cb/wx/wxWidgets-2.8.12/include/wx/object.h,
...
../../include/wx/vector.h, ../../include/wx/clntdata.h,

...

../../src/richtext/richtextstylepage.cpp,
...

--------------------------------------------------------
Now, I try to set break points on the shared dll's source file:


--------------------------------------------------------
 >>>>>>cb_gdb:
 > b "../../include/wx/spinbutt.h:20"
Breakpoint 2 at 0x67109942: file ../../include/wx/spinbutt.h, line 40. 
(3 locations)
 >>>>>>cb_gdb:
 > b 
"E:\code\cb\wx\wxWidgets-2.8.12\build\msw/../../src/common/string.cpp:161"
Breakpoint 3 at 0x66d89efd: file ../../src/common/string.cpp, line 161.
 >>>>>>cb_gdb:
 > b "../../src/common/string.cpp:161"
Breakpoint 4 at 0x66d89efd: file ../../src/common/string.cpp, line 161.
 >>>>>>cb_gdb:
 > b "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 5 ("E:\code\cb\wx\wxWidgets-2.8.12\src/common/string.cpp:164) 
pending.
 >>>>>>cb_gdb:
 > b "../../src/common/datetime.cpp:100"
Breakpoint 6 at 0x66d47ba5: file ../../src/common/datetime.cpp, line 100.
 >>>>>>cb_gdb:
 > b 
"E:\code\cb\wx\wxWidgets-2.8.12\build\msw/../../src/common/datetime.cpp:101"
--------------------------------------------------------


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.

Can you give me a direction that I can dig into the gdb's source?

thanks.

PS:
The related discussion can be found here:
http://forums.codeblocks.org/index.php/topic,14792.msg99482/topicseen.html#msg99482
and
http://forums.codeblocks.org/index.php/topic,13306.msg89692.html#msg89692

thanks you very much!

asmwarrior
ollydbg from codeblocks' forum

             reply	other threads:[~2011-06-11  7:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-11  7:49 asmwarrior [this message]
2011-06-11 17:56 ` Keith Seitz
2011-06-12  3:56   ` asmwarrior
2011-06-12  7:45     ` asmwarrior
2011-06-12  7:56       ` Jan Kratochvil
2011-06-12  8:06         ` asmwarrior
2011-06-12 16:22           ` [Mingw-users] " Earnie
2011-06-12 16:51         ` Eli Zaretskii
2011-06-12 16:54           ` Jan Kratochvil
     [not found] ` <4DF37ADA.3070905@users.sourceforge.net>
2011-06-12  8:15   ` asmwarrior
     [not found]   ` <4DF4513A.3090902__7466.60719528354$1307866544$gmane$org@gmail.com>
2011-06-13  6:33     ` Asm warrior
2011-06-13 17:02       ` Eli Zaretskii
2011-06-14  3:14         ` Asm warrior
2011-06-14  3:49           ` Asm warrior
2011-06-14  4:22             ` Jeffrey Walton
2011-06-14  5:27         ` setting a breakpoint on a dll, relative path or absolute path issue[solved with a patch] asmwarrior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DF31EB0.6080006@gmail.com \
    --to=asmwarrior@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=mingw-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).