Debugging specifics wrt visual studio

classic Classic list List threaded Threaded
5 messages Options
Akash Jain Akash Jain
Reply | Threaded
Open this post in threaded view
|

Debugging specifics wrt visual studio

I was having problems debugging with visual studio 2015, where even
with all the relevant modules loaded and their status being "Symbols
loaded", I was not able to set any breakpoints from the source file.
This was happening even in WinDbg. I wondered if the pdb files even
had the sources specified. So I found code for a tool which is
essentially a pdb parser. On building and running it on any of the pdb
files, I found that there were no sources for all the object files,
related to lo, in that module.
I then downloaded vs2013 and built with it. And on inspection of the
pdb files, I found that the sources were now being specified. I was
also able to debug properly.

Has anyone had similar experience with debugging in vs2015 without
vs2013 being installed on their system? Better still can anyone shed
some light on why this might be happening?

Regards,
autoit
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Christian Lohmaier-3 Christian Lohmaier-3
Reply | Threaded
Open this post in threaded view
|

Re: Debugging specifics wrt visual studio

Hi Akash, *,

Akash Jain <[hidden email]> schrieb am Di., 07.06.2016, 6:58:

I wondered if the pdb files even
had the sources specified.


Yes, the official builds (including alpha and beta builds) are source-indexed. On crash, you will be able to see sources. Maybe windbg won't work if you don't use the same paths, so try to set a breakpoint in a function and have the debugger stop at that.

So I found code for a tool which is
essentially a pdb parser. On building and running it on any of the pdb
files, I found that there were no sources for all the object files,

They are not included in the pdb directly, but have instructions in them on how it can be downloaded. Downloading makes use of power shell, maybe you're missing that..



Ciao
Christian


_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Akash Jain Akash Jain
Reply | Threaded
Open this post in threaded view
|

Re: Debugging specifics wrt visual studio

Hi Christian,

I am building lo myself. With options: --with-visual-studio=yyyy,
--enable-dbgutil. So the symbols are not being downloaded from any
server.

> I wondered if the pdb files even
> had the sources specified.
>
> Yes, the official builds (including alpha and beta builds) are
> source-indexed. On crash, you will be able to see sources. Maybe windbg
> won't work if you don't use the same paths, so try to set a breakpoint in a
> function and have the debugger stop at that.

In WinDbg, I am able to set a breakpoint. When the breakpoint is hit,
I expect the source file to open, and the breakpoint line to be showed
because I am using the l+s option. But that is not the case. This is
after I have set the source files path and symbol files path
correctly. I also verified that I was debugging what I had built. Same
is the case with vs2015. I open the source file and but a breakpoint
in it, but I get a error saying bp will not be hit as symbols are not
loaded for this file. Bringing up the modules list I can see the
relevant module is loaded and symbols for it are also loaded.

> So I found code for a tool which is
> essentially a pdb parser. On building and running it on any of the pdb
> files, I found that there were no sources for all the object files,
>
> They are not included in the pdb directly, but have instructions in them on
> how it can be downloaded. Downloading makes use of power shell, maybe you're
> missing that..
 The tool is parsing these instructions and shows the source files
linked to all the object files in the module. The pdb files were not
showing any source files. Keeping all my other options same, I just
changed --with-visual-studio=2015 to --with-visual-studio=2013. Now
the pdb files were showing all the source files correctly and
debugging works as expected.

Regards,
Akash
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

Re: Debugging specifics wrt visual studio

In reply to this post by Akash Jain
On Tue, 2016-06-07 at 10:28 +0530, Akash Jain wrote:

> I was having problems debugging with visual studio 2015, where even
> with all the relevant modules loaded and their status being "Symbols
> loaded", I was not able to set any breakpoints from the source file.
> This was happening even in WinDbg. I wondered if the pdb files even
> had the sources specified. So I found code for a tool which is
> essentially a pdb parser. On building and running it on any of the
> pdb
> files, I found that there were no sources for all the object files,
> related to lo, in that module.
> I then downloaded vs2013 and built with it. And on inspection of the
> pdb files, I found that the sources were now being specified. I was
> also able to debug properly.
>
> Has anyone had similar experience with debugging in vs2015 without
> vs2013 being installed on their system? Better still can anyone shed
> some light on why this might be happening?

As mentioned on IRC today. I also had the same problem with vs2015. I
hacked my solenv/gbuild/platform/com_MSC_defs.mk to add -Z7 to
gb_CXXFLAGS and gb_CFLAGS to embed the debuginfo into the obj files and
debugging in msvc 2015 then works (without any --enable-debug --enable-
symbols etc configure flags).

So I can confirm that theres apparently something wrong with the pdbs
built under 2015 seeing as I can debug LibreOffice with -Z7 but not -Zi

C.
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: Debugging specifics wrt visual studio

In reply to this post by Akash Jain
On 06/07/2016 06:58 AM, Akash Jain wrote:

> I was having problems debugging with visual studio 2015, where even
> with all the relevant modules loaded and their status being "Symbols
> loaded", I was not able to set any breakpoints from the source file.
> This was happening even in WinDbg. I wondered if the pdb files even
> had the sources specified. So I found code for a tool which is
> essentially a pdb parser. On building and running it on any of the pdb
> files, I found that there were no sources for all the object files,
> related to lo, in that module.
> I then downloaded vs2013 and built with it. And on inspection of the
> pdb files, I found that the sources were now being specified. I was
> also able to debug properly.

<https://cgit.freedesktop.org/libreoffice/core/commit/?id=ed4b23548d28941f9b2c75207832afcb6c6ad0b3>
"Keep original CFLAGS etc. unmodified in configure.ac" will hopefully
fix that.

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice