Fwd: Debugging Win32 with GDB

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Debugging Win32 with GDB

D'Squarius X

Hi all,

I have a Win32 program which I want to debug using GDB. It has a 'WinMain' function and actually does what I want, but I can't seem to set any breakpoints to it because gdb can't find the source file. I'm pretty sure I've given it the right path + line no, both in absolute and relative paths and the source has been compiled with the gcc -g switch.

I'm using Windows 7 and the MinGW Toolchain.

Regards,

kurvenschubser


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Debugging Win32 with GDB

lrn-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22.09.2013 20:57, D'Squarius X wrote:
> Hi all,
>
> I have a Win32 program which I want to debug using GDB. It has a 'WinMain'
> function and actually does what I want, but I can't seem to set any
> breakpoints to it because gdb can't find the source file.
You can't set up breakpoints? What does gdb tell you, exactly?

> I'm pretty sure
> I've given it the right path + line no, both in absolute and relative paths
> and the source has been compiled with the gcc -g switch.
Did gdb tell you that it found debug symbols when it loaded the executable?
If not, then maybe executable is stripped at some point.

- --
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJSP2C8AAoJEOs4Jb6SI2CwQFIH/2zQdmV1dwa9BVEx+WTOtopk
KkUyn+gJMjb5J2ZipQjixpYJrIRJ/1qQjx8c10PFpIbDU2R4hNpDr66xrgBEnuKO
kwEnT7g+HDAaJeU6bPJt8SnljdILJL6uI7FbD44XtYzPtpeP2rrVpV7WLlo5z2Mz
ZGDMqB4o1nYJgkYr7RG6l2T+4RWckvjvlmr2vyNyOif/qcZqNKv4KndogLQ8kpcY
Y2bFIJ9kUFm2s/3tYAilMl8lOKYPV0Fn4vcNj8QbY2zp7DF1SjmDPzWGgTElVpe6
WngibnnGOIRkeGiPOlFdvosSMmqSwDlSpYBFkWg1cqC8rfAhLyDjMxyhmCAUG14=
=VKAf
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Debugging Win32 with GDB

D'Squarius X
Yes, it found the debug symbols. I have several libraries linked in, some of them dependent on the others and linked accordingly. They have all been compiled with the -g switch. I also link to precompiled dll's for OpenGL, gdi, freeglut and glew. I guess they don't have debug symbols, but I'am unsure.


2013/9/22 LRN <[hidden email]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22.09.2013 20:57, D'Squarius X wrote:
> Hi all,
>
> I have a Win32 program which I want to debug using GDB. It has a 'WinMain'
> function and actually does what I want, but I can't seem to set any
> breakpoints to it because gdb can't find the source file.
You can't set up breakpoints? What does gdb tell you, exactly?

> I'm pretty sure
> I've given it the right path + line no, both in absolute and relative paths
> and the source has been compiled with the gcc -g switch.
Did gdb tell you that it found debug symbols when it loaded the executable?
If not, then maybe executable is stripped at some point.

- --
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJSP2C8AAoJEOs4Jb6SI2CwQFIH/2zQdmV1dwa9BVEx+WTOtopk
KkUyn+gJMjb5J2ZipQjixpYJrIRJ/1qQjx8c10PFpIbDU2R4hNpDr66xrgBEnuKO
kwEnT7g+HDAaJeU6bPJt8SnljdILJL6uI7FbD44XtYzPtpeP2rrVpV7WLlo5z2Mz
ZGDMqB4o1nYJgkYr7RG6l2T+4RWckvjvlmr2vyNyOif/qcZqNKv4KndogLQ8kpcY
Y2bFIJ9kUFm2s/3tYAilMl8lOKYPV0Fn4vcNj8QbY2zp7DF1SjmDPzWGgTElVpe6
WngibnnGOIRkeGiPOlFdvosSMmqSwDlSpYBFkWg1cqC8rfAhLyDjMxyhmCAUG14=
=VKAf
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Debugging Win32 with GDB

lrn-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 23.09.2013 10:37, D'Squarius X wrote:
> On 2013/9/22 LRN wrote:
>> On 22.09.2013 20:57, D'Squarius X wrote:
>>> I have a Win32 program which I want to debug using GDB. It has a
>>> 'WinMain' function and actually does what I want, but I can't
>>> seem to set any breakpoints to it because gdb can't find the
>>> source file.
>> You can't set up breakpoints? What does gdb tell you, exactly?
> [no reply]

So, what does gdb tell you, exactly, when you are trying to set a
breakpoint?

>>> I'm pretty sure I've given it the right path + line no, both in
>>> absolute and relative paths
>>> and the source has been compiled with the gcc -g switch.
>> Did gdb tell you that it found debug symbols when it loaded the
>> executable? If not, then maybe executable is stripped at some
>> point.
>>
> Yes, it found the debug symbols. I have several libraries linked in,
> some of them dependent on the others and linked accordingly. They
> have all been compiled with the -g switch. I also link to precompiled
> dll's for OpenGL, gdi, freeglut and glew. I guess they don't have
> debug symbols, but I'am unsure.

OK, you seem to have that covered.

- --
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJSP+f5AAoJEOs4Jb6SI2Cw714IAIu8E+z9WtLx6nVTkAlSGiwt
07qTe9TN4sT3I/TvKDeV2viPyLAlXI3/vV/pUktboRJknZEdKEVWl51e4KjTyPtb
x2AejqeaGh3ix4H35GTK/QiLIv/Seq86orwDEcOGc8qRZHYlsg8Bs8HFVBfiP80/
Xr8TVCpib6QXc38aC5+BT5t+D7dStlDTmtITluxjRuViCcnNekBVcx1yblgxtavd
pjLOuNQ7Xf6Q0gprjIqaboiX+uLdy/oxtAND5op9JA9WkjOpyFy/lrtugUCGuAMB
h1EKuiNonmsUqd2tR82EEgU/G84fbI+hsGTxHrpRIUV9RQbMjz2WUm4lZqt+7dE=
=v0na
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe