Re: CND with bare metal target: module + netbeans modifications

Emilian Bold <[email protected]> Mon, 3 Apr 2017 14:47:41 +0300
Newsgroups gmane.comp.java.netbeans.devel
Message-ID <CAL6R17DBKbEGV6m-XxvwKEJSAENpkJ1R36rsarKsr8+j9Wc+6A@mail.gmail.com>
--001a1142e0c0710f93054c41bcf2
Content-Type: text/plain; charset=UTF-8

Jan, NetBeans is becoming part of Apache so it would be best to
(cross-)post on [email protected]

It seems to me that right now everything runs without patching NetBeans 7.4?

So the problem is that your existing hooks no longer work? (They probably
never were and official API, no?)

Even if you have to patch NetBeans, open-sourcing the tool + patches +
modules seems valuable.

I haven't worked on the cnd modules but I'll throw my 2c:

 > Crosscompilation to bare metal - platform: There are many checks in the
source if the target platform is right (Linux, Windows). This is not an
issue for bare metal compilation, because it will produce same result on
all platforms.

If it's not an issue, it shouldn't matter. You could either use
PlatformTypes. PLATFORM_GENERIC or the default platform, etc.

> Program loading (Run button): [...] Executing the application on bare
metal is something between isLocal() and isRemote() in sense of NetBeans
CND.

This sounds like isRemote() to me, although communication is not via SSH.

> Debugger [...]

Sounds like you need some API based on GdbDebuggerImpl? How did things work
before?

PS: I assume you heard of https://en.wikipedia.org/wiki/Sleepycat_Software

--emi


On Mon, Apr 3, 2017 at 12:29 PM, Jan Breuer <[email protected]> wrote:

> Hello,
> I have developed a SCIDE <http://pck338-242.feld.cvut.cz/scide/>, the
> development environment for bare metal ARM Cortex devices. It was designed
> for my students at the university but now, I'm still using this IDE and my
> colegues enjoy it also so I decided to upgrade the old base from NetBeans
> 7.4 to NetBeans 8 (or 9).
> I would like to do it right now and open the source. And possibly separate
> it to the standalone module for NetBeans in the future. Unexpectedly, there
> are many blockers now in NetBeans sources. Currently, it is bad hack of
> many cnd and dlight modules.
>
> What I need is to provide seamless build, run and debug experience without
> configuring paths to tools and running external tools manualy.
> I can provide some patches to CND to support this usage but I would like
> to do it right.
>
> There are these issues for me:
>
> Crosscompilation to bare metal - platform:
> There are many checks in the source if the target platform is right
> (Linux, Windows). This is not an issue for bare metal compilation, because
> it will produce same result on all platforms.
> (e.g. in cnd.makeproject/src/org/netbeans/modules/cnd/
> makeproject/configurations/ConfigurationMakefileWriter.java)
> What is the right way to solve this? Introduce new platform
> in org.netbeans.modules.cnd.makeproject.api.configurations.Platforms? How
> to correctly force this platform in new project? Can I introduce new
> platform in module and inject it using OpenIDE?
>
> Program loading (Run button):
> It is not possible to run the compiled code directly, but the code must be
> loaded to target device. There is no SSH or so. Program loading is done by
> flash tool. Remote platform dialog is completely useless for this. I would
> like to provide flash tool in a module, so user should just select correct
> tool and not path to it.
> It seems like extending of org.netbeans.modules.nativeexecution.api.NativeProcess
> and org.netbeans.modules.nativeexecution.api.ExecutionEnvironment is good
> idea, but they are so tightly coupled to SSH... Executing the application
> on bare metal is something between isLocal() and isRemote() in sense of
> NetBeans CND.
> How to correctly hook to "Run" event and execute the loader? Using own
> ExecutionEnvironment? How to force own ExecutionEnvironment in the CND
> project?
>
> Debugger:
> Again, it is something between local and remote debuging in sense of
> NetBeans CND. I'm using OpenOCD as "gdb remote" but it is possible to run
> it using pipes, not tcp ports.
> OpenOCD is executed by the IDE so no need to run anything manually. Just
> press "debug button".
> In conjuction with OpenOCD, some commands are missing. E.g. it is not
> possible to execute gdb command "-exec-run", but instead, just
> "-exec-continue" is supported.
> There is need to chain some commands to standard debug commands e.g.
> "monitor reset run", "monitor reset halt", ...
> There is also need to preload the program to the device by external
> command before debug (same as running the code)
> How to correctly hook to these events without changing or reimplementing
> org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl?
>
> Any ideas are welcome.
>
> Best regards,
> Jan Breuer
>
>
>

--001a1142e0c0710f93054c41bcf2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Jan, NetBeans is becoming part of Apache so it would =
be best to (cross-)post on <a href=3D"mailto:[email protected].=
org">[email protected]</a></div><div><br></div><div>It seem=
s to me that right now everything runs without patching NetBeans 7.4?</div>=
<div><br></div><div>So the problem is that your existing hooks no longer wo=
rk? (They probably never were and official API, no?)</div><div><br></div><d=
iv>Even if you have to patch NetBeans, open-sourcing the tool + patches + m=
odules seems valuable.</div><div><div><br class=3D"gmail-Apple-interchange-=
newline">I haven&#39;t worked on the cnd modules but I&#39;ll throw my 2c:<=
/div></div><div><br></div><div>=C2=A0&gt; Crosscompilation to bare metal - =
platform: There are many checks in the source if the target platform is rig=
ht (Linux, Windows). This is not an issue for bare metal compilation, becau=
se it will produce same result on all platforms.</div><div><br></div><div>I=
f it&#39;s not an issue, it shouldn&#39;t matter. You could either use Plat=
formTypes. PLATFORM_GENERIC or the default platform, etc.</div><div><br></d=
iv><div>&gt;=C2=A0Program loading (Run button): [...]=C2=A0Executing the ap=
plication on bare metal is something between isLocal() and isRemote() in se=
nse of NetBeans CND.</div><div><br></div><div>This sounds like isRemote() t=
o me, although communication is not via SSH.</div><div><br></div><div>&gt; =
Debugger [...]</div><div><br></div><div>Sounds like you need some API based=
 on GdbDebuggerImpl? How did things work before?</div><div><br></div><div>P=
S: I assume you heard of=C2=A0<a href=3D"https://en.wikipedia.org/wiki/Slee=
pycat_Software">https://en.wikipedia.org/wiki/Sleepycat_Software</a><br></d=
iv><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><div>--e=
mi</div><div><br></div></div><div class=3D"gmail_extra">
<br><div class=3D"gmail_quote">On Mon, Apr 3, 2017 at 12:29 PM, Jan Breuer =
<span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_bl=
ank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex"><div dir=3D"ltr">Hello,<div>I have developed a <a=
 href=3D"http://pck338-242.feld.cvut.cz/scide/" target=3D"_blank">SCIDE</a>=
, the development environment for bare metal ARM Cortex devices. It was des=
igned for my students at the university but now, I&#39;m still using this I=
DE and my colegues enjoy it also so I decided to upgrade the old base from =
NetBeans 7.4 to NetBeans 8 (or 9).</div><div>I would like to do it right no=
w and open the source. And possibly separate it to the standalone module fo=
r NetBeans in the future. Unexpectedly, there are many blockers now in NetB=
eans sources. Currently, it is bad hack of many cnd and dlight modules.</di=
v><div><br></div><div>What I need is to provide seamless build, run and deb=
ug experience without configuring paths to tools and running external tools=
 manualy.<br></div><div>I can provide some patches to CND to support this u=
sage but I would like to do it right.<br></div><div><br></div><div>There ar=
e these issues for me:</div><div><br></div><div>Crosscompilation to bare me=
tal - platform:</div><div>There are many checks in the source if the target=
 platform is right (Linux, Windows). This is not an issue for bare metal co=
mpilation, because it will produce same result on all platforms.<br></div><=
div>(e.g. in cnd.makeproject/src/org/<wbr>netbeans/modules/cnd/<wbr>makepro=
ject/configurations/<wbr>ConfigurationMakefileWriter.<wbr>java)</div><div>W=
hat is the right way to solve this? Introduce new platform in=C2=A0org.netb=
eans.modules.cnd.<wbr>makeproject.api.<wbr>configurations.Platforms? How to=
 correctly force this platform in new project? Can I introduce new platform=
 in module and inject it using OpenIDE?</div><div><br></div><div>Program lo=
ading (Run button):</div><div>It is not possible to run the compiled code d=
irectly, but the code must be loaded to target device. There is no SSH or s=
o. Program loading is done by flash tool. Remote platform dialog is complet=
ely useless for this.=C2=A0I would like to provide flash tool in a module, =
so user should just select correct tool and not path to it.</div><div>It se=
ems like extending of=C2=A0org.netbeans.modules.<wbr>nativeexecution.api.<w=
br>NativeProcess and=C2=A0org.netbeans.modules.<wbr>nativeexecution.api.<wb=
r>ExecutionEnvironment is good idea, but they are so tightly coupled to SSH=
... Executing the application on bare metal is something between isLocal() =
and isRemote() in sense of NetBeans CND.</div><div>How to correctly hook to=
 &quot;Run&quot; event and execute the loader? Using own ExecutionEnvironme=
nt? How to force own ExecutionEnvironment in the CND project?</div><div><br=
></div><div>Debugger:</div><div>Again, it is something between local and re=
mote debuging in sense of NetBeans CND. I&#39;m using OpenOCD as &quot;gdb =
remote&quot; but it is possible to run it using pipes, not tcp ports.</div>=
<div>OpenOCD is executed by the IDE so no need to run anything manually. Ju=
st press &quot;debug button&quot;.</div><div>In conjuction with OpenOCD, so=
me commands are missing. E.g. it is not possible to execute gdb command &qu=
ot;-exec-run&quot;, but instead, just &quot;-exec-continue&quot; is support=
ed.</div><div>There is need to chain some commands to standard debug comman=
ds e.g. &quot;monitor reset run&quot;, &quot;monitor reset halt&quot;, ...<=
/div><div>There is also need to preload the program to the device by extern=
al command before debug (same as running the code)</div><div>How to correct=
ly hook to these events without changing or reimplementing org.netbeans.mod=
ules.cnd.<wbr>debugger.gdb2.GdbDebuggerImpl?</div><div><br></div><div>Any i=
deas are welcome.<br></div><div><br></div><div>Best regards,</div><div>Jan =
Breuer</div><div><br></div><div><br></div></div>
</blockquote></div><br></div></div>

--001a1142e0c0710f93054c41bcf2--