User forums > General (but related to Code::Blocks)

[OT] unofficial MinGW GDB gdb with python released

<< < (2/35) > >>

ollydbg:
Here is the full output of the debug log.

It seems the Mingw gdb7.0 still can't reach the breakpoint.



[attachment deleted by admin]

mariocup:
Hi ollydbg,

I had a similar problem with ARM gdb that I build myself under windows. In the gdb sources there was a bug in getting the relative path for setting breakpoints. After putting the following code in the file util.c it worked also under windows. The strange thing is that the binary version of gdb 6.8 worked without changes for x86.


--- Code: ---#if !defined(HAVE_REALPATH)
#if defined (_WIN32) || defined(__MINGW32__)
# define WIN32_LEAN_AND_MEAN
# include <windows.h> /* for GetFullPathName */
# endif
#endif
....

char *
gdb_realpath (const char *filename)
{
...
  #if !defined(HAVE_REALPATH)
   # if defined (_WIN32) || defined(__MINGW32__)
   /* The MS Windows method. If we don't have realpath, we assume we
   don't have symlinks and just canonicalize to a Windows absolute
   path. GetFullPath converts ../ and ./ in relative paths to
   absolute paths, filling in current drive if one is not given
   or using the current directory of a specified drive (eg, "E:foo").
   It also converts all forward slashes to back slashes. */
   {
   char buf[MAX_PATH];
   char *basename;
   DWORD len = GetFullPathName (filename, MAX_PATH, buf, &basename);
   if (len == 0 || len > MAX_PATH - 1)
   return strdup (filename);
   else
   {
   return strdup (buf);
   }
   }
#endif
#endif

--- End code ---


ollydbg:

--- Quote from: mariocup on October 08, 2009, 01:31:50 pm ---Hi ollydbg,

I had a similar problem with ARM gdb that I build myself under windows. In the gdb sources there was a bug in getting the relative path for setting breakpoints. After putting the following code in the file util.c it worked also under windows. The strange thing is that the binary version of gdb 6.8 worked without changes for x86.


--- Code: ---#if !defined(HAVE_REALPATH)
#if defined (_WIN32) || defined(__MINGW32__)
# define WIN32_LEAN_AND_MEAN
# include <windows.h> /* for GetFullPathName */
# endif
#endif
....

char *
gdb_realpath (const char *filename)
{
...
  #if !defined(HAVE_REALPATH)
  # if defined (_WIN32) || defined(__MINGW32__)
  /* The MS Windows method. If we don't have realpath, we assume we
  don't have symlinks and just canonicalize to a Windows absolute
  path. GetFullPath converts ../ and ./ in relative paths to
  absolute paths, filling in current drive if one is not given
  or using the current directory of a specified drive (eg, "E:foo").
  It also converts all forward slashes to back slashes. */
  {
  char buf[MAX_PATH];
  char *basename;
  DWORD len = GetFullPathName (filename, MAX_PATH, buf, &basename);
  if (len == 0 || len > MAX_PATH - 1)
  return strdup (filename);
  else
  {
  return strdup (buf);
  }
  }
#endif
#endif

--- End code ---

--- End quote ---

Thanks.

I will report this issue on the MinGW Mail list.

Also, another question is:
How can I build a gdb.exe, Is it easy to do?
for now, I can download the source code from
http://sourceforge.net/projects/mingw/files/GNU%20Source-Level%20Debugger/GDB-7.0/gdb-7.0-mingw32-src.tar.gz/download

Thanks again!

ollydbg:
In the MinGW maillist. someone said:


--- Quote ---> I've packaged GDB-7.0 for MinGW:
> >
> > http://sourceforge.net/projects/mingw/files/GNU%20Source-Level%20Debugger/GDB-7.0/gdb-7.0-mingw32-src.tar.gz/download
> > http://sourceforge.net/projects/mingw/files/GNU%20Source-Level%20Debugger/GDB-7.0/gdb-7.0-mingw32-bin.tar.gz/download
> >
> >  
Excellent!
Now I can debug again using Code::Blocks.
I was not able to do this with previous GDB versions for MinGW since I
switched to 4.4.0.
Thanks.
    Brecht

--- End quote ---


String thing :(, it seems this guy can debug under GDB 7.0. and can't debug under GDB 6.8.

Edit

You can view the thread under this webpage:

http://news.gmane.org/gmane.comp.gnu.mingw.user


killerbot:
It works for me. (TDM-GCC 4.4.0 and GDB 7.0 from the above link)

However I also noticed something strange.

Tooltipped during debugging on an std::string (local variable).  [the ..... mean there is more stuff there]

--- Code: ---ContinueDebugEvent .......
gdb : kernel event for pid= ..... ... code=EXCEPTION_DEBUG_EVENT
ContinueDebugEvent ....
gdb : kernel event for pid= ..... ... code=EXCEPTION_DEBUG_EVENT
"Group"

--- End code ---
Notice the "Group" at the end, the correct value of the string.

With another string it is ok.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version