<div dir="ltr">Hi Vincent,<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 19, 2018 at 9:30 AM,  <span dir="ltr"><<a href="mailto:Vincent.Blondeau@lamresearch.com" target="_blank">Vincent.Blondeau@lamresearch.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>
Hi Dave,<br>
<br>
The optimization options are already disabled in the debug build and -ggdb2 is used. So, the real code is used.<br>
<br>
How do I change the build in a way that the plugin is external?<br></blockquote><div><br></div><div>I see the same issue as you.  I'll take a look.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Any experience is always welcome! Thanks! <br>
<br>
Vincent<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
-----Original Message-----<br>
From: Vm-dev [mailto:<a href="mailto:vm-dev-bounces@lists.squeakfoundation.org">vm-dev-bounces@lists.<wbr>squeakfoundation.org</a>] On Behalf Of David T. Lewis<br>
Sent: Wednesday, April 18, 2018 17:35<br>
To: Open Smalltalk Virtual Machine Development Discussion <<a href="mailto:vm-dev@lists.squeakfoundation.org">vm-dev@lists.<wbr>squeakfoundation.org</a>><br>
Subject: Re: [Vm-dev] VM debugging - breakpoint issue on Windows<br>
<br>
<br>
Hi Vincent,<br>
<br>
I am not a Windows user so this may be completely wrong, but one thing I have found in debugging plugins on Linux is that it is often necessary to compile with optimization turned off so that the debugger is dealing with the "real" code.<br>
<br>
I am guessing that perhaps your debugger is trying to use the C source code to locate something that got optimized away by the compiler.<br>
<br>
Sometimes it is helpful to compile the plugin as an external plugin (a DLL). You can compile it with zero optimization and compiler flags set (-O0 -g or similar), and the resulting plugun should be visible to the debugger. The plugin that you compile this way should work with any VM (optimized or not) and the debugger should still be able to see it.<br>
<br>
I have not done this on Windows, but that is my experience on Linux so maybe it will help.<br>
<br>
Dave<br>
<br>
<br>
On Wed, Apr 18, 2018 at 06:33:12PM +0000, <a href="mailto:Vincent.Blondeau@lamresearch.com">Vincent.Blondeau@lamresearch.<wbr>com</a> wrote:<br>
>  <br>
> Hi,<br>
> <br>
> I would like to set up a breakpoint in the VM but I got this error when running:<br>
> Cannot insert breakpoint 1.<br>
> Error accessing memory address 0x509cad: Input/output error.<br>
> <br>
> For this, I am using gdb under Cygwin (same issue with powershell) and invoque the primitive I want to test:<br>
> pharo.cog.spur/builddbg/vm $  gdb --args ./Pharo.exe -headless ../..somewhereOnMyDisk.../<wbr>Pharo.image eval "FilePluginPrims new primitiveStdioDescriptorIsATTY<wbr>."<br>
> <br>
> I get these results:<br>
> GNU gdb (GDB) 7.6.1<br>
> Reading symbols from C:\Users\BlondVi\Documents\<wbr>GitRepos\opensmalltalk-vm\<wbr>build.win32x86\pharo.cog.spur\<wbr>builddbg\vm\Pharo.exe...done.<br>
> <br>
> Next, I set a breakpoint in the primitive C method I created and run the app:<br>
> <br>
> (gdb) br sqStdioDescriptorIsATTY<br>
> Breakpoint 1 at 0x509cb6: file ../../platforms/win32/plugins/<wbr>FilePlugin/sqWin32FilePrims.c, line 337.<br>
> (gdb) r<br>
> Starting program: C:\Users\BlondVi\Documents\<wbr>GitRepos\opensmalltalk-vm\<wbr>build.win32x86\pharo.cog.spur\<wbr>builddbg\vm/./Pharo.exe --headless ../../../../../../../../..<wbr>temp/logoVM/logoVM.image eval "FilePluginPrims new primitiveStdioDescriptorIsATTY<wbr>."<br>
> [New Thread 27416.0x95bc]<br>
> [New Thread 27416.0xa1d0]<br>
> [New Thread 27416.0x3aa4]<br>
> [New Thread 27416.0x88bc]<br>
> (gdb) Warning:<br>
> Cannot insert breakpoint 1.<br>
> Error accessing memory address 0x509cad: Input/output error.<br>
> <br>
> What should I do to set the breakpoint correctly?<br>
> <br>
> Thanks in advance,<br>
> <br>
> Vincent Blondeau<br>
> <br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>