debuggable win32 VM?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

debuggable win32 VM?

ccrraaiigg
 

Hi--

     For the next Spoon release I want debuggable VMs and plugins on all
platforms. In 2007 for win32 I created a Microsoft Visual C "solution"
for use with the free MSVC Express Edition (2008 or later). The debugger
is decent.

     I scanned the current CMake-based stuff, but didn't see anything
about MSVC (or win32 gdb for that matter). Is there a current route for
debugging the win32 VM using MSVC or gdb (or anything more pleasant than
printf)? Or should I update my MSVC stuff and contribute it somewhere?
In 2007 I only gave it to Andreas (the win32 VM maintainer) and a few
other folks who asked for it.


     thanks!

-C

--
Craig Latta
www.netjam.org/resume
+31  06 2757 7177
+ 1 415  287 3547


Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Igor Stasenko

On 11 May 2011 14:59, Craig Latta <[hidden email]> wrote:

>
>
> Hi--
>
>     For the next Spoon release I want debuggable VMs and plugins on all
> platforms. In 2007 for win32 I created a Microsoft Visual C "solution"
> for use with the free MSVC Express Edition (2008 or later). The debugger
> is decent.
>
>     I scanned the current CMake-based stuff, but didn't see anything
> about MSVC (or win32 gdb for that matter). Is there a current route for
> debugging the win32 VM using MSVC or gdb (or anything more pleasant than
> printf)? Or should I update my MSVC stuff and contribute it somewhere?
> In 2007 I only gave it to Andreas (the win32 VM maintainer) and a few
> other folks who asked for it.
>
>
It was always a pain for me to debug windoze Vms.
The only option to debug VMs built using GCC on windows is gdb.
And for me is quite awkward to use debugger from console, and it
wasn't worked well
on windows (i tried different versions of gdb).
Some cannot even print correct stack frames, not saying about the rest.
MSVC debugger is superior in all regards.

For building VMs using other compiler: as you may know for GCC we're
using gnuification step
which converts a huge case statement in interpret() function into jump
table, which significantly
improves the speed (about 30%). So if you use other compiler you will
automatically lose this advantage
unless it also supports dispatch based on jump tables.
But of course for debugging, you don't have to care about speed.
I cannot say about Squeak VM, but for Cog & cmake today it could be
quite simple to create a configuration
and adopt it for MSVC.
Cmake can generate solution and project files, so you don't need to do
it manually,
and then you just open it in MSVC and build your project using it,
and then of course you can use MSVC debugger.

However i didn't tried it, but i tried to build Cog using clang
compiler (which is available on macs) and it works well
(i just created another class - StackCocoaIOSCLANGConfig, and then
built vm as usual, using cmake).

So, same could be done for MSVC, but of course someone has to do it. :)


>     thanks!
>
> -C
>
> --
> Craig Latta
> www.netjam.org/resume
> +31  06 2757 7177
> + 1 415  287 3547


--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Henrik Sperre Johansen
In reply to this post by ccrraaiigg
 
On 11.05.2011 14:59, Craig Latta wrote:

>
>
> Hi--
>
>       For the next Spoon release I want debuggable VMs and plugins on all
> platforms. In 2007 for win32 I created a Microsoft Visual C "solution"
> for use with the free MSVC Express Edition (2008 or later). The debugger
> is decent.
>
>       I scanned the current CMake-based stuff, but didn't see anything
> about MSVC (or win32 gdb for that matter). Is there a current route for
> debugging the win32 VM using MSVC or gdb (or anything more pleasant than
> printf)? Or should I update my MSVC stuff and contribute it somewhere?
> In 2007 I only gave it to Andreas (the win32 VM maintainer) and a few
> other folks who asked for it.
>
>
>       thanks!
>
> -C
FWIW, I'd really like it too if (not sure if it's already the case)
cmake -G "Visual Studio X YYYY" worked out of the box :)
Probably a more durable approach to spend effort there if it's not the
case, than make a new/update a project every once in a while.

Cheers,
Henry

Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Igor Stasenko

On 11 May 2011 15:32, Henrik Sperre Johansen
<[hidden email]> wrote:

>
> On 11.05.2011 14:59, Craig Latta wrote:
>>
>>
>> Hi--
>>
>>      For the next Spoon release I want debuggable VMs and plugins on all
>> platforms. In 2007 for win32 I created a Microsoft Visual C "solution"
>> for use with the free MSVC Express Edition (2008 or later). The debugger
>> is decent.
>>
>>      I scanned the current CMake-based stuff, but didn't see anything
>> about MSVC (or win32 gdb for that matter). Is there a current route for
>> debugging the win32 VM using MSVC or gdb (or anything more pleasant than
>> printf)? Or should I update my MSVC stuff and contribute it somewhere?
>> In 2007 I only gave it to Andreas (the win32 VM maintainer) and a few
>> other folks who asked for it.
>>
>>
>>      thanks!
>>
>> -C
>
> FWIW, I'd really like it too if (not sure if it's already the case) cmake -G
> "Visual Studio X YYYY" worked out of the box :)
> Probably a more durable approach to spend effort there if it's not the case,
> than make a new/update a project every once in a while.
>

So, wanna try it out?
For this you need to create a subclass of CogWindowsConfig and
override few methods which are responsible for compiler flags
and probably include directories for standard include files, like
windows.h and directx etc.
And you done. :)

> Cheers,
> Henry


--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Henrik Sperre Johansen
 
On 11.05.2011 15:39, Igor Stasenko wrote:

>
> On 11 May 2011 15:32, Henrik Sperre Johansen
> <[hidden email]>  wrote:
>> On 11.05.2011 14:59, Craig Latta wrote:
>>>
>>> Hi--
>>>
>>>       For the next Spoon release I want debuggable VMs and plugins on all
>>> platforms. In 2007 for win32 I created a Microsoft Visual C "solution"
>>> for use with the free MSVC Express Edition (2008 or later). The debugger
>>> is decent.
>>>
>>>       I scanned the current CMake-based stuff, but didn't see anything
>>> about MSVC (or win32 gdb for that matter). Is there a current route for
>>> debugging the win32 VM using MSVC or gdb (or anything more pleasant than
>>> printf)? Or should I update my MSVC stuff and contribute it somewhere?
>>> In 2007 I only gave it to Andreas (the win32 VM maintainer) and a few
>>> other folks who asked for it.
>>>
>>>
>>>       thanks!
>>>
>>> -C
>> FWIW, I'd really like it too if (not sure if it's already the case) cmake -G
>> "Visual Studio X YYYY" worked out of the box :)
>> Probably a more durable approach to spend effort there if it's not the case,
>> than make a new/update a project every once in a while.
>>
> So, wanna try it out?
> For this you need to create a subclass of CogWindowsConfig and
> override few methods which are responsible for compiler flags
> and probably include directories for standard include files, like
> windows.h and directx etc.
> And you done. :)
No time, as usual :/
Not to mention having to dilly-dally around to correctly set up an
environment is about my least favourite activity on earth.
To the point that every time I change computer, I practically stop doing
any programming but smalltalk for as long as possible.
Worked for the last 7 months now, actually :)

Cheers,
Henry

Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Igor Stasenko

On 11 May 2011 15:50, Henrik Sperre Johansen
<[hidden email]> wrote:

>
> On 11.05.2011 15:39, Igor Stasenko wrote:
>>
>> On 11 May 2011 15:32, Henrik Sperre Johansen
>> <[hidden email]>  wrote:
>>>
>>> On 11.05.2011 14:59, Craig Latta wrote:
>>>>
>>>> Hi--
>>>>
>>>>      For the next Spoon release I want debuggable VMs and plugins on all
>>>> platforms. In 2007 for win32 I created a Microsoft Visual C "solution"
>>>> for use with the free MSVC Express Edition (2008 or later). The debugger
>>>> is decent.
>>>>
>>>>      I scanned the current CMake-based stuff, but didn't see anything
>>>> about MSVC (or win32 gdb for that matter). Is there a current route for
>>>> debugging the win32 VM using MSVC or gdb (or anything more pleasant than
>>>> printf)? Or should I update my MSVC stuff and contribute it somewhere?
>>>> In 2007 I only gave it to Andreas (the win32 VM maintainer) and a few
>>>> other folks who asked for it.
>>>>
>>>>
>>>>      thanks!
>>>>
>>>> -C
>>>
>>> FWIW, I'd really like it too if (not sure if it's already the case) cmake
>>> -G
>>> "Visual Studio X YYYY" worked out of the box :)
>>> Probably a more durable approach to spend effort there if it's not the
>>> case,
>>> than make a new/update a project every once in a while.
>>>
>> So, wanna try it out?
>> For this you need to create a subclass of CogWindowsConfig and
>> override few methods which are responsible for compiler flags
>> and probably include directories for standard include files, like
>> windows.h and directx etc.
>> And you done. :)
>
> No time, as usual :/
> Not to mention having to dilly-dally around to correctly set up an
> environment is about my least favourite activity on earth.
> To the point that every time I change computer, I practically stop doing any
> programming but smalltalk for as long as possible.
> Worked for the last 7 months now, actually :)
>

Indeed. Setting up everything from scratch is tedious and painful process :)
That's why when i bought new PC few years ago, i just did a low-level
copy from old hard disk
to a new one, so my years windows XP with a lots of crap installed,
just continues to run without need to install everything from scratch.


> Cheers,
> Henry


--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Mariano Martinez Peck
In reply to this post by ccrraaiigg
 


On Wed, May 11, 2011 at 2:59 PM, Craig Latta <[hidden email]> wrote:


Hi--

    For the next Spoon release I want debuggable VMs and plugins on all
platforms. In 2007 for win32 I created a Microsoft Visual C "solution"
for use with the free MSVC Express Edition (2008 or later). The debugger
is decent.

    I scanned the current CMake-based stuff, but didn't see anything
about MSVC (or win32 gdb for that matter). Is there a current route for
debugging the win32 VM using MSVC or gdb (or anything more pleasant than
printf)? Or should I update my MSVC stuff and contribute it somewhere?
In 2007 I only gave it to Andreas (the win32 VM maintainer) and a few
other folks who asked for it.


Hi Craig.  I did a post about how to build and debug a Cog VM with the new CMake stuff and how do debug it.
You probably know most of the stuff there but it may help you for the CMakeVMMaker configs.

Anyway, I tried to debug with gdb in Windows. The results where that I could sucessfully build the VM in windows with all the debug symblos, no compiler optimizations, etc...
I could run the VM with gdb, no problem.  The only REAL problem (which is quite big in fact) I have is that when I did a ctrl+c instead of interrupting the VM and hence get the gdb prompt....it killed gdb directly :(  I look in Internet and seems to be a known problem.

I didn't try the CMake generator (-G xxx) because I don't have a Visual nothing installed.

Mariano

 


    thanks!

-C

--
Craig Latta
www.netjam.org/resume
<a href="tel:%2B31%20%2006%202757%207177" value="+31627577177">+31 06 2757 7177
<a href="tel:%2B%201%20415%20%20287%203547" value="+14152873547">+ 1 415 287 3547





--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Mariano Martinez Peck
In reply to this post by Igor Stasenko
 

>
> FWIW, I'd really like it too if (not sure if it's already the case) cmake -G
> "Visual Studio X YYYY" worked out of the box :)
> Probably a more durable approach to spend effort there if it's not the case,
> than make a new/update a project every once in a while.
>

So, wanna try it out?
For this you need to create a subclass of CogWindowsConfig and
override few methods which are responsible for compiler flags
and probably include directories for standard include files, like
windows.h and directx etc.
And you done. :)



Why you would need that?  I mean, why doing a cmake -G "Visual Studio 9 2008"   or whatever is not enough ?


 
> Cheers,
> Henry


--
Best regards,
Igor Stasenko AKA sig.



--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Igor Stasenko

On 11 May 2011 16:57, Mariano Martinez Peck <[hidden email]> wrote:

>
>
>> >
>> > FWIW, I'd really like it too if (not sure if it's already the case) cmake -G
>> > "Visual Studio X YYYY" worked out of the box :)
>> > Probably a more durable approach to spend effort there if it's not the case,
>> > than make a new/update a project every once in a while.
>> >
>>
>> So, wanna try it out?
>> For this you need to create a subclass of CogWindowsConfig and
>> override few methods which are responsible for compiler flags
>> and probably include directories for standard include files, like
>> windows.h and directx etc.
>> And you done. :)
>>
>
>
> Why you would need that?  I mean, why doing a cmake -G "Visual Studio 9 2008"   or whatever is not enough ?
>
apparently because MSVC compiler and linker has own options and GCC
options will be simply ignored or
lead to errors.

>
>
>>
>> > Cheers,
>> > Henry
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Eliot Miranda-2
In reply to this post by ccrraaiigg
 


On Wed, May 11, 2011 at 5:59 AM, Craig Latta <[hidden email]> wrote:


Hi--

    For the next Spoon release I want debuggable VMs and plugins on all
platforms. In 2007 for win32 I created a Microsoft Visual C "solution"
for use with the free MSVC Express Edition (2008 or later). The debugger
is decent.

    I scanned the current CMake-based stuff, but didn't see anything
about MSVC (or win32 gdb for that matter). Is there a current route for
debugging the win32 VM using MSVC or gdb (or anything more pleasant than
printf)? Or should I update my MSVC stuff and contribute it somewhere?
In 2007 I only gave it to Andreas (the win32 VM maintainer) and a few
other folks who asked for it.


As far as Cog goes I've been getting by with cygwin's gdb.  It's not great but far better than printfs.  To make a debug VM go into the cygwinbuild directory and say

    $ make debug

The instructions are in cygwinbuild/HowToBuild
 


    thanks!

-C

--
Craig Latta
www.netjam.org/resume
<a href="tel:%2B31%20%2006%202757%207177" value="+31627577177">+31 06 2757 7177
<a href="tel:%2B%201%20415%20%20287%203547" value="+14152873547">+ 1 415 287 3547



Reply | Threaded
Open this post in threaded view
|

Re: debuggable win32 VM?

Stefan Marr

Hi:

On 11 May 2011, at 18:21, Eliot Miranda wrote:

> As far as Cog goes I've been getting by with cygwin's gdb.  It's not great but far better than printfs.  To make a debug VM go into the cygwinbuild directory and say

In case you just want a front-end to gdb on windows, Eclipse CDT used to work with cygwin in 2008.

Best regards
Stefan


--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax:   +32 2 629 3525