tag:blogger.com,1999:blog-2376548004644133032024-03-14T02:40:59.471-07:00Forward in codeSoftware development; mainly Ada, mainly on macOS.Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.comBlogger64125tag:blogger.com,1999:blog-237654800464413303.post-15973558401326867752024-02-11T10:08:00.000-08:002024-02-11T10:08:51.415-08:00SDK 15 issues<p>This note covers some problems we’ve had with Xcode/the Command Line Tools (CLTs) at version 15.</p>
<a href="https://forward-in-code.blogspot.com/2024/02/sdk-15-issues.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-7782045504091357662023-06-07T09:40:00.002-07:002023-06-07T09:40:28.135-07:00Alire on macOS, revisited<p>This note covers some of the considerations that’ll apply when running <a href="https://alire.ada.dev">Alire</a> on macOS.</p>
<a href="https://forward-in-code.blogspot.com/2023/06/alire-on-macos-revisited.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-47849121018021901042023-03-22T10:54:00.007-07:002023-03-23T03:25:04.428-07:00Libadalang, Alire, and macOS<h2 id="background">Background</h2>
<p>This exercise was prompted by the need for <a href="https://github.com/simonjwright/scripted_testing">Scripted Testing</a> to be supported by – as far as possible – code generation. The need is for the public or interfacing view of a supporting part (domain) of a system to be able to log calls made to it and to provide values on calls to it, using a scripting mechanism.</p>
<a href="https://forward-in-code.blogspot.com/2023/03/libadalang-alire-and-macos.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-44479151456771998242023-02-10T13:22:00.012-08:002023-02-11T09:53:26.100-08:00ColdFrame and the micro:bit revisited<p>This article discusses various issues rebuilding a demonstrator intended for the <a href="https://microbit.org">BBC micro:bit</a> (version 1.3b) after an interval of several years.</p>
<a href="https://forward-in-code.blogspot.com/2023/02/coldframe-and-microbit-revisited.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-38356899983198880222023-02-06T04:38:00.000-08:002023-02-06T04:38:35.269-08:00Alire on Mac<p>Once you’ve <a href="https://alire.ada.dev">downloaded Alire</a> and begun the <a href="https://alire.ada.dev/docs/#first-steps">Getting Started tutorial</a>, how do you go about actually writing Ada?</p>
<a href="https://forward-in-code.blogspot.com/2023/02/alire-on-mac.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-58585110061369857832022-11-20T01:41:00.002-08:002022-11-20T01:41:27.197-08:00Building GCC 12.2.0 on Ventura for aarch64<p>These are notes on building GCC 12.2.0 and GNAT tools for Apple silicon.</p>
<p>There were two main problems:</p>
<ul>
<li>the base package was built on an Intel machine (<em>lockheed</em> - named after Shadowcat’s companion dragon), running Monterey (macOS 12).</li>
<li>the build machine, an M1 mac Mini (<em>temeraire</em> - named after Naomi Novik’s dragon) was by this time running Ventura (macOS 13), but I wanted to make sure that users could continue to run on Monterey.</li>
</ul>
<a href="https://forward-in-code.blogspot.com/2022/11/building-gcc-1220-on-ventura-for-aarch64.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-25389576424881480442022-06-03T09:18:00.000-07:002022-06-03T09:18:32.414-07:00Packing issue in libusb<p>This note is about an issue encountered creating a very thin Ada binding to <tt>libusb</tt> (1.0.26).</p>
<a href="https://forward-in-code.blogspot.com/2022/06/packing-issue-in-libusb.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-65878367603157088632022-05-31T14:26:00.009-07:002022-06-12T10:24:33.026-07:00I don’t like Homebrew<p>This exploration came about because of trying to add <a href="https://github.com/simonjwright/gnat_math_extensions">GNAT Math Extensions</a> to <a href="https://github.com/alire-project">Alire</a>.</p>
<a href="https://forward-in-code.blogspot.com/2022/05/i-dont-like-homebrew.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-10297848846357457092022-03-12T07:44:00.007-08:002022-03-12T07:56:09.120-08:00Which SDK? choices, choices ...<p>This note is about configuring GCC on macOS so that your built compiler can be used independently of which Software Development Kit (SDK) is installed.</p>
<a href="https://forward-in-code.blogspot.com/2022/03/which-sdk-choices-choices.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-57399765178077287262022-03-09T12:56:00.014-08:002022-03-28T12:28:02.708-07:00GNAT LLVM<p>This is a note about building <a href="https://github.com/AdaCore/gnat-llvm">GNAT-LLVM</a> on macOS.</p>
<a href="https://forward-in-code.blogspot.com/2022/03/gnat-llvm.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-63242781049867643542022-02-20T10:01:00.000-08:002022-02-20T10:01:48.901-08:00SPARK2014 and FSF GCC<p>This is a note about building SPARK (i.e. <tt>gnatprove</tt>) against an FSF GCC.</p>
<a href="https://forward-in-code.blogspot.com/2022/02/spark2014-and-fsf-gcc.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-49201947129579883882022-02-20T09:00:00.000-08:002022-02-20T09:00:05.755-08:00Where’s that library?<p>This note is about some difficulties using shared libraries (<tt>.dylib</tt>s) on macOS.</p>
<a href="https://forward-in-code.blogspot.com/2022/02/wheres-that-library.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-40014006249007271872021-10-08T10:44:00.000-07:002021-10-08T10:44:03.276-07:00Word, templates, rageThis is with Word 2019 for Mac.
Why am I using Word, anyway? - because LibreOffice has stopped working with our membership database in SQLite, and wasn’t working at all well with a CSV export. Oh, and Word doesn’t work with SQLite either.<div><br /></div><div>I managed to create a Word template by careful editing of the LibreOffice version; painful to have to work with CSVs, but better than filling in 100 membership letters by hand (most of our members have email, so a Python script using <span style="font-family: courier; font-size: x-small;">email.mime</span>, <span style="font-family: courier; font-size: x-small;">smtplib</span>, <span style="font-family: courier; font-size: x-small;">sqlite3</span> etc worked for them, leaving the diehards ...)</div><div><br /></div><div>OK, the organisation has a new chair, time to update the template.</div><div><br /></div><div>Where is it? Turns out, <span style="font-family: Monaco; font-size: 10px;">~/Library/Group Containers/UBF8T346G9.Office/User Content/Templates</span><span style="font-family: inherit;">. Well done, Microsoft.</span></div><div><span style="font-family: inherit;"><br /></span></div><div><span style="font-family: inherit;">And then, the challenge is to find a way of editing the template. Whatever I try, whatever tips I follow on the net, all I can do is edit a document based on the template, which is not what I need to happen!</span></div><div><span style="font-family: inherit;"><br /></span></div><div><span style="font-family: inherit;">I would look into PDFs via <a href="https://www.blog.pythonlibrary.org/2018/06/05/creating-pdfs-with-pyfpdf-and-python/" rel="nofollow">fpdf2</a>, but I should only have another year in this post and the next person might have an issue with that. (The same applies to using SQLite, of course. Hmm.)</span></div><div><span style="font-family: inherit;"><br /></span></div><div><span style="font-family: inherit;">So I guess it</span>’<span style="font-family: inherit;">s back to LibreOffice.</span></div><div><span style="font-family: inherit;"><br /></span></div><div><span style="font-family: inherit;"><br /></span></div>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-66516225479986498142021-08-23T09:48:00.002-07:002022-06-08T15:05:03.886-07:00(Not) building GTK on Big Sur<p>People are having much trouble with GtkAda on Big Sur, so I thought "why not try building Gtk?" - as <a href="https://wiki.gnome.org/Projects/GTK/OSX/Building">here</a>.
<p>Unfortunately, it's just too complicated & runs into so many problems that I give up.
</p></p><a href="https://forward-in-code.blogspot.com/2021/08/not-building-gtk-on-big-sur.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com4tag:blogger.com,1999:blog-237654800464413303.post-64936986987404331702021-04-06T04:03:00.002-07:002021-04-06T04:03:11.624-07:00Preparing for a Github PR<p>This is a note about preparing a pull request (PR) for a Github repository. As much as anything, it’s to stop me having to page back through my lab notebook to find out how I did it last time …</p>
<a href="https://forward-in-code.blogspot.com/2021/04/preparing-for-github-pr.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-31684405317451126392021-03-06T08:20:00.000-08:002021-03-06T08:21:55.539-08:00Developing for Cortex MCUs on a Raspberry Pi<p>Recently, on the Gitter <a href="https://gitter.im/ada-lang/Lobby">Ada Programming Language</a> lobby, there have been discussions on cross-compiling for Cortex M micro-controllers, specifically the <a href="https://microbit.org">BBC micro:bit</a>, using the Raspberry Pi.</p>
<p>TL;DR: it's not going to be easy, unfortunately. Maybe later (or earlier?) Raspbian releases will help.</p>
<a href="https://forward-in-code.blogspot.com/2021/03/developing-for-cortex-mcus-on-raspberry.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-68363704870502693592019-06-10T04:24:00.001-07:002019-06-22T11:59:09.292-07:00MacOS Software Development Kit changes<p>This post is based on the README from the corresponding <a href="https://github.com/simonjwright/macos-sdks-vs-gcc">Github repository</a>.
<p>That repository attempts to cope with expected changes in Apple’s approach to software development kits, specifically where to find the system headers (you’d expect <tt>/usr/include</tt>).</p>
</p><a href="https://forward-in-code.blogspot.com/2019/06/macos-software-development-kit-changes.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com2tag:blogger.com,1999:blog-237654800464413303.post-34038880930061160192019-05-19T08:04:00.000-07:002019-05-19T08:04:24.365-07:00Coding Guidelines<!DOCTYPE html>
<html lang="GB">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content=" IE=edge,chrome=1">
<title>Coding_Guide</title>
<meta name="viewport" content=" width=device-width, initial-scale=1.0">
<style id="mkstylesheet">
body{-webkit-font-smoothing:antialiased;font-family:"Helvetica Neue",Helvetica,Arial,Verdana,sans-serif;margin:30px 0 0;padding:0;background:#fff;color:#303030;font-size:14px;line-height:1.45}#wrapper{padding:20px}li{font-size:110%}li li{font-size:100%}li p{font-size:100%;margin:.5em 0}h1{color:#000}h2{color:#111}h3{color:#111}h4{color:#111}h5{color:#111}h6{color:#111;font-style:italic}p,td,div{color:#111;font-family:"Helvetica Neue",Helvetica,Arial,Verdana,sans-serif;word-wrap:break-word}a{color:#0d6ea1;text-decoration:none;-webkit-transition:color .2s ease-in-out;-moz-transition:color .2s ease-in-out;-o-transition:color .2s ease-in-out;-ms-transition:color .2s ease-in-out;transition:color .2s ease-in-out}a:hover{color:#3593d9}h1,h2,h3,h4,h5{margin:2.75rem 0 1rem;font-weight:600;line-height:1.15}h1{margin-top:0;font-size:3.052em}h2{font-size:2.441em}h3{font-size:1.953em}h4{font-size:1.563em}h5{font-size:1.25em}ul,ol,pre,table,blockquote{margin-top:.625em;margin-bottom:.625em}hr{border:1px solid;margin:-1px 0}ul ul,ol ol,ul ol,ol ul{margin-top:0;margin-bottom:0}b,strong,em,small,code{line-height:1}.footnote{color:#0d6ea1;font-size:.8em;vertical-align:super}abbr,acronym{border-bottom:1px dotted #aaa}#wrapper img{max-width:100%;height:auto}dd{font-size:1em;margin-bottom:1em}li>p:first-of-type{margin:0}li p+p{margin-top:16px}ul,ol{padding-left:1.5em}#wrapper ol{list-style-position:outside}ul ul,ul ol{margin-bottom:.4em}caption,col,colgroup,table,tbody,td,tfoot,th,thead,tr{border-spacing:0}table{border:1px solid rgba(0,0,0,0.25);border-collapse:collapse;display:table;empty-cells:hide;margin:-1px 0 1.3125em;padding:0;table-layout:fixed}caption{display:table-caption;font-weight:700}col{display:table-column}colgroup{display:table-column-group}tbody{display:table-row-group}tfoot{display:table-footer-group}thead{display:table-header-group}td,th{display:table-cell}tr{display:table-row}table th,table td{font-size:1.1em;line-height:1.3;padding:.5em 1em 0}table thead{background:rgba(0,0,0,0.15);border:1px solid rgba(0,0,0,0.15);border-bottom:1px solid rgba(0,0,0,0.2)}table tbody{background:rgba(0,0,0,0.05)}table tfoot{background:rgba(0,0,0,0.15);border:1px solid rgba(0,0,0,0.15);border-top:1px solid rgba(0,0,0,0.2)}figure{display:inline-block;overflow:hidden;position:relative;margin:1em 0 2em}figcaption{font-style:italic;text-align:center;background:white;color:#666}.poetry pre{display:block;font-family:Georgia,Garamond,serif !important;font-size:110% !important;font-style:italic;line-height:1.6em;margin-left:1em}.poetry pre code{font-family:Georgia,Garamond,serif !important;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto;white-space:pre-wrap}blockquote p{font-size:110%;font-style:italic;line-height:1.6em}sup,sub,a.footnote{font-size:1.4ex;height:0;line-height:1;position:relative;vertical-align:super}sub{vertical-align:sub;top:-1px}p{font-size:1.1429em;line-height:1.3125em;margin:1.3125em 0}dt,th{font-weight:700}table tr:nth-child(odd),table th:nth-child(odd),table td:nth-child(odd){background:rgba(255,255,255,0.06)}table tr:nth-child(even),table td:nth-child(even){background:rgba(200,200,200,0.25)}@media print{img,table,figure{page-break-inside:avoid}#wrapper{background:#fff;color:#303030;padding:10px;position:relative;text-indent:0}}@media screen{.inverted{background:#252a2a}.inverted #wrapper{background:#252a2a;color:#eee}.inverted hr{border-color:#333f40 !important}.inverted p,.inverted td,.inverted li,.inverted h1,.inverted h2,.inverted h3,.inverted h4,.inverted h5,.inverted h6,.inverted th,.inverted .math,.inverted caption,.inverted dt,.inverted dd{color:#eee}.inverted pre{background:#ccc;color:#111}.inverted table{background:none}.inverted table tr:nth-child(odd),.inverted table td:nth-child(odd){background:none}.inverted a{color:#acd1d5}::selection{background:rgba(157,193,200,0.5)}h1::selection{background-color:rgba(45,156,208,0.3)}h2::selection{background-color:rgba(90,182,224,0.3)}h3::selection,h4::selection,h5::selection,h6::selection,li::selection,ol::selection{background-color:rgba(133,201,232,0.3)}code::selection{background-color:rgba(0,0,0,0.7);color:#eee}code span::selection{background-color:rgba(0,0,0,0.7) !important;color:#eee !important}a::selection{background-color:rgba(255,230,102,0.2)}.inverted a::selection{background-color:rgba(255,230,102,0.6)}td::selection,th::selection,caption::selection{background-color:rgba(180,237,95,0.5)}}.mkstyle--swiss #wrapper aside.blurb:before{margin-top:.7em}
#mkreplaced-toc{list-style-position:inside;padding:0;margin:0 0 0 1rem;list-style-type:none}#mkreplaced-toc li::before{content:''}#mkreplaced-toc li{font-size:1rem;line-height:1.25;font-weight:normal}#mkreplaced-toc li ul{font-size:1.3rem;font-weight:300;padding:.5rem 0;margin:0 0 0 1rem}#mkreplaced-toc li.missing{list-style-type:none !important}#mkreplaced-toc.max-1 ul,#mkreplaced-toc.max1 ul{display:none}#mkreplaced-toc.max-2 ul ul,#mkreplaced-toc.max2 ul ul{display:none}#mkreplaced-toc.max-3 ul ul ul,#mkreplaced-toc.max3 ul ul ul{display:none}#mkreplaced-toc.max-4 ul ul ul ul,#mkreplaced-toc.max4 ul ul ul ul{display:none}#mkreplaced-toc.max-5 ul ul ul ul ul,#mkreplaced-toc.max5 ul ul ul ul ul{display:none}.mk-rtl{direction:rtl;text-align:right}.mkprinting,.mkprinting #wrapper{height:auto;margin-bottom:0;padding-bottom:0}.hideProgress #generated-toc,.hideProgress #firstdiff,.hideProgress #toc-title,.hideProgress #mkdocumentprogress,.hideProgress #mkincludechart,.hideProgress #mkprogressbar1,.hideProgress #mkprogressbar2,.hideProgress b.bookmark,.hideProgress .mkscrollmeter,.hideProgress #alllinks,.hideProgress #criticnav,.hideProgress .popup,.hideProgress #progressindicator,.hideProgress #mkautoscroll,.mkprinting #generated-toc,.mkprinting #firstdiff,.mkprinting #toc-title,.mkprinting #mkdocumentprogress,.mkprinting #mkincludechart,.mkprinting #mkprogressbar1,.mkprinting #mkprogressbar2,.mkprinting b.bookmark,.mkprinting .mkscrollmeter,.mkprinting #alllinks,.mkprinting #criticnav,.mkprinting .popup,.mkprinting #progressindicator,.mkprinting #mkautoscroll{display:none !important}@media print{body{background:white;line-height:1.4}html,body,#wrapper{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;-webkit-perspective:none !important;-webkit-text-size-adjust:none;border:0;box-sizing:border-box;float:none;margin:0;max-width:100%;padding:10px 0 0;width:auto}.critic #wrapper mark.crit{background-color:#fffd38 !important;text-decoration:none;color:#000}h1,h2,h3,h4,h5,h6{page-break-after:avoid}p,h2,h3{orphans:3;widows:3}section{page-break-before:avoid}pre>code{white-space:pre;word-break:break-word}#generated-toc,#firstdiff,#toc-title,#mkdocumentprogress,#mkincludechart,#mkprogressbar1,#mkprogressbar2,.mkscrollmeter,#alllinks,.popup{display:none !important}.suppressprintlinks a{border-bottom:none !important;color:inherit !important;cursor:default !important;text-decoration:none !important}.hrefafterlinktext #wrapper a:link:after,.hrefafterlinktext #wrapper a:visited:after{content:" (" attr(href) ") ";font-size:90%;opacity:.9}.nocodebreak pre{page-break-inside:avoid}img,table,figure{page-break-inside:avoid}.breakfootnotes .footnotes{page-break-before:always}.breakfootnotes .footnotes hr{display:none}#mktoctitle{display:block}#print-title{border-bottom:solid 1px #666;display:block}#wrapper pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}#wrapper #generated-toc-clone,#wrapper #mkreplaced-toc{display:block}.task-list .task-list-item{list-style-type:none !important}.task-list .gh-complete.task-list-item .task-list-item-checkbox:before{background:#838387;content:'\2713'}.task-list .task-list-item-checkbox{-webkit-appearance:none;position:relative}.task-list .task-list-item-checkbox:before{border:solid 1px #aaa;border-radius:2px;color:white;content:' ';display:block;font-weight:bold;height:1em;left:-20px;line-height:1;position:absolute;text-align:center;top:-.75em;width:1em}}
#wrapper #generated-toc-clone,#wrapper #mkreplaced-toc,#wrapper #generated-toc-clone ul,#wrapper #mkreplaced-toc ul{list-style-position:inside}#wrapper #generated-toc-clone li.missing,#wrapper #mkreplaced-toc li.missing{list-style-type: none!important}#wrapper #generated-toc-clone ul,#wrapper #mkreplaced-toc ul{list-style-type: upper-roman}#wrapper #generated-toc-clone>ul>li>ul,#wrapper #mkreplaced-toc>li>ul {list-style-type: decimal}#wrapper #generated-toc-clone>ul>li>ul>li>ul,#wrapper #mkreplaced-toc>li>ul>li>ul{list-style-type: decimal-leading-zero}#wrapper #generated-toc-clone>ul>li>ul>li>ul>li>ul,#wrapper #mkreplaced-toc>li>ul>li>ul>li>ul{list-style-type: lower-greek}#wrapper #generated-toc-clone>ul>li>ul>li>ul>li>ul>li>ul,#wrapper #mkreplaced-toc>li>ul>li>ul>li>ul>li>ul{list-style-type: disc}#wrapper #generated-toc-clone>ul>li>ul>li>ul>li>ul>li>ul>li>ul,#wrapper #mkreplaced-toc>li>ul>li>ul>li>ul>li>ul>li>ul{list-style-type: square}#wrapper #generated-toc-clone,#wrapper #mkreplaced-toc{}
</style>
<style id="mkprintstyles">@media print{#wrapper #generated-toc-clone,#generated-toc{display:none!important}
html,body,#wrapper{font-size:10pt!important}
}
</style>
</head>
<body class="normal">
<div id="wrapper">
<p><em>This is a rather self-satisfied document, written in the mid-1990’s, which may still have some relevance.</em></p>
<h1 id="Coding-Guide">Coding Guide</h1>
<h2 id="Purpose-and-Scope">Purpose and Scope</h2>
<p>While it is hard to make a silk purse out of a sow’s ear (to create good code from a bad design), it is all too easy to do the reverse.</p>
<p>The principle that clear, readable, understandable source text eases program evolution, adaptation, and maintenance is not dependent on the programming language in which the text is written. The purpose of this document is to indicate those language-independent techniques which can help you to produce source text with these qualities.</p>
</div></body></html></!DOCTYPE><a href="https://forward-in-code.blogspot.com/2019/05/coding-guidelines.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-34892521687792938932019-02-01T12:28:00.001-08:002019-02-01T12:30:02.489-08:00Using GDB with a BBC micro:bit<p>This note is about using <a href="https://www.segger.com">Segger</a> J-Link software to help debug code on a BBC micro:bit.
</p><a href="https://forward-in-code.blogspot.com/2019/02/using-gdb-with-bbc-microbit.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-26282333566314627402018-11-19T00:27:00.000-08:002019-04-03T07:42:32.805-07:00Mojave vs. GCC<p>After you've installed Xcode (or, my preference, the Command Line
Tools via <tt>xcode-select -install</tt>) so that you can install and
use GNAT, you may expect to be able to compile C code too.
<p>Mojave may surprise you with
<pre>
$ gcc casing.c -o casing
casing.c:1:10: fatal error: stdio.h: No such file or directory
1 | #include <stdio.h>
| ^~~~~~~~~
compilation terminated.
</pre>
<p>The reason, according
to <a href="https://apple.stackexchange.com/questions/337940/why-is-usr-include-missing-i-have-xcode-and-command-line-tools-installed-moja">this
question and its answers</a>, is that Apple's developer tools, in
particular the <tt>clang</tt> compiler, know where to find the include
files under <tt>/Library/Developer</tt>; GCC doesn't (I'm sure it
could be made to, but ...) and so we have to add an extra step to
install them in the normal place:
<pre>
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
Password:
installer: Package name is macOS_SDK_headers_for_macOS_10.14
installer: Installing at base path /
installer: The install was successful.
</pre>
You may need to repeat this after macOS or Command Line Tools (or
Xcode) updates.
Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com1tag:blogger.com,1999:blog-237654800464413303.post-6396227551876588212018-11-19T00:23:00.000-08:002020-05-16T04:55:10.291-07:00Mojave vs. GDB<p>Apple's software development tools are based on LLVM, and Apple
don't seem to feel it necessary to keep GCC and friends up to date
with changes in the Apple tools or security policies.
<p>GDB has been particularly affected by this. You can see why a tool
which is capable of interacting with running programs would have to be
treated with caution.
</p></p><a href="https://forward-in-code.blogspot.com/2018/11/mojave-vs-gdb.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com6tag:blogger.com,1999:blog-237654800464413303.post-21657863112155116942018-06-21T02:57:00.000-07:002018-06-21T02:57:17.551-07:00VMWare shared drive vs Debian Stretch<p>This note is about problems with VMWare shared drives failing to mount.
<p>My previous setup was VMWare Fusion 8 and Debian 8 (jessie), with the VMWare-recommended <tt>open-vm-tools</tt>. After upgrading to VMWare Fusion 10 and Debian 9 (stretch), the shared folder (<tt>~</tt>) on the Mac was no longer visible from Debian (<tt>~/mac</tt>, a symbolic link to <tt>/mnt/hgfs</tt>).
<p>After looking <a href="https://github.com/vmware/open-vm-tools/issues/199">here</a>, I added this line to <tt>/etc/fstab</tt>:
<pre>
vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0
</pre>
<p>but rebooting hung, and invited me to log in as <tt>system</tt> to fix the problem.
<p>Other posts in the reference stated that you need to mount to <tt>/mnt/hgfs/mac</tt>: so, edit the <tt>/etc/fstab</tt> line to
<pre>
vmhgfs-fuse /mnt/hgfs/mac fuse defaults,allow_other 0 0
</pre>
<p>and the system rebooted OK.
<p>Now, make <tt>~/mac</tt> a link to <tt>/mnt/hgfs/mac</tt>:
<pre>
ln -sf /mnt/hgfs/mac ~/mac
</pre>
<p>and all is well again.
<hr/>
<p>Incidentally, I found that copy/paste between host and client no longer worked: another Google search led me to
<pre>
sudo apt-get install open-vm-tools-desktop
</pre>
<p>Reboot, and on we go!
Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-25389996510510993732018-06-14T09:59:00.000-07:002018-11-28T12:30:25.033-08:00Secondary Stack in Cortex GNAT RTS<p>In GNAT, the secondary stack is a construct used with indeterminate types. For example, if a function returns a <tt>String</tt>, it isn't possible for the caller to determine how much space to reserve for the result: instead, the called function allocates the amount of space required on the secondary stack, and on return the caller determines how much space to allocate on the normal (primary) stack, and pops the function's result from the secondary stack to there.
<p>This note discusses how the secondary stack is managed in <a href="https://github.com/simonjwright/cortex-gnat-rts">Cortex GNAT RTS</a> for FSF GCC and GNAT Community Edition (was GNAT GPL).
</p></p><a href="https://forward-in-code.blogspot.com/2018/06/secondary-stack-in-cortex-gnat-rts.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-31974301356324368872018-04-16T05:45:00.002-07:002018-04-16T05:52:36.925-07:00Dependency plotI wanted to get a dependency graph for a project, and found <a href="https://sites.google.com/site/depplot/">DePlo</a> (Dependency Plotter). Great stuff, last updated in 2012 but still works with FSF GCC 8.0.1!<br />
<br />
This sample is from my <a href="https://github.com/simonjwright/analytical-engine">Analytical Engine project</a>:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-JeWIG8jD5gQ/WtSat8G4mpI/AAAAAAAABR0/fvoJTgjdZSw8x-9KWPpS4eB2kpG9IpB8wCLcBGAs/s1600/engine.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="693" data-original-width="837" height="330" src="https://4.bp.blogspot.com/-JeWIG8jD5gQ/WtSat8G4mpI/AAAAAAAABR0/fvoJTgjdZSw8x-9KWPpS4eB2kpG9IpB8wCLcBGAs/s400/engine.png" width="400" /></a></div>
<br />Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com0tag:blogger.com,1999:blog-237654800464413303.post-33431692036680960442018-03-14T10:44:00.000-07:002018-04-16T05:47:06.198-07:00Tcl/Tk vs TrampolinesThis is a note on a problem I encountered while working on
the <a href="http://coldframe.sourceforge.net/coldframe/House_Management.html">House
Management</a> example domain in
my <a href="https://sourceforge.net/projects/coldframe/">ColdFrame</a>
project.
<br>
TL;DR: If you write a Tcl callback function in Ada, declare it at
library level.
<br>
<a href="https://forward-in-code.blogspot.com/2018/03/tcltk-vs-trampolines.html#more">Read more »</a>Simon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.com1