<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><b>From:</b> Vm-dev [mailto:vm-dev-bounces@lists.squeakfoundation.org]
<b>On Behalf Of </b>Eliot Miranda<br>
<b>Sent:</b> Wednesday, April 18, 2018 14:36<br>
<b>To:</b> Open Smalltalk Virtual Machine Development Discussion <vm-dev@lists.squeakfoundation.org><br>
<b>Subject:</b> Re: [Vm-dev] VM debugging - breakpoint issue on Windows<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">Hi Vincent,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> On Apr 18, 2018, at 11:33 AM, <Vincent.Blondeau@lamresearch.com> <Vincent.Blondeau@lamresearch.com> wrote:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Hi,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> I would like to set up a breakpoint in the VM but I got this error when running:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Cannot insert breakpoint 1.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Error accessing memory address 0x509cad: Input/output error.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> For this, I am using gdb under Cygwin (same issue with powershell) and invoque the primitive I want to test:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> pharo.cog.spur/builddbg/vm $  gdb --args ./Pharo.exe â€“headless ../..somewhereOnMyDisk.../Pharo.image eval "FilePluginPrims new primitiveStdioDescriptorIsATTY."<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> I get these results:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> GNU gdb (GDB) 7.6.1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Reading symbols from C:\Users\BlondVi\Documents\GitRepos\opensmalltalk-vm\build.win32x86\pharo.cog.spur\builddbg\vm\Pharo.exe...done.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Next, I set a breakpoint in the primitive C method I created and run the app:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> (gdb) br sqStdioDescriptorIsATTY<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Breakpoint 1 at 0x509cb6: file ../../platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c, line 337.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> (gdb) r<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Starting program: C:\Users\BlondVi\Documents\GitRepos\opensmalltalk-vm\build.win32x86\pharo.cog.spur\builddbg\vm/./Pharo.exe --headless ../../../../../../../../..temp/logoVM/logoVM.image eval "FilePluginPrims
 new primitiveStdioDescriptorIsATTY."<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> [New Thread 27416.0x95bc]<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> [New Thread 27416.0xa1d0]<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> [New Thread 27416.0x3aa4]<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> [New Thread 27416.0x88bc]<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> (gdb) Warning:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Cannot insert breakpoint 1.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Error accessing memory address 0x509cad: Input/output error.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> What should I do to set the breakpoint correctly?<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">AFAICT you're doing everything right.  But if you're on 64-bit Cygwin then it won't work.  You can build the 32-bit vm on a 64-bit windows but gdb can only be used to debug 64-bit programs.  Even installing the
 gdb from 32-bit Cygwin doesn't work.  So if this is your configuration you'll have the create a 32-but Cygwin and debug the 32-bit app there-on.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal">I am debugging the 32 bits Pharo under this Cygwin:<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Lucida Console"">$ CYGWIN_NT-10.0-WOW 2.10.0(0.325/5/3) 2018-02-02 15:21 i686 Cygwin<o:p></o:p></span></p>
<p class="MsoNormal">It is 32 bits too. So, it should work? Or if I have well understood your last sentence, I should I get a 32 bits gdb? How?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Vincent<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">PS: I am receiving most of the replies as email attachment in my outlook browser. Has someone the same issue?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">HTH<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Thanks in advance,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">> Vincent Blondeau<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">>  <o:p></o:p></p>
</div>
</body>
</html>