[Gambas-devel] Enhancing the gb.debug component

Benoît Minisini gambas at ...1...
Mon Feb 1 12:09:32 CET 2010


> Hi, Benoît.
> 
> Before start , let's make a small remote debug session simulation.
> 
> Suppose I wrote a program on PC and I want to debug it on my target
> machine. I made also a gambas component for the SPI (ex. gb.spi), that
> use a peripheral that exists only on target system and not on PC system.
> I thought that on pc all the method of gb.spi must be empty , I need
> only that the (sorry for the definition) intellisense work, while on ARM
> system the components is fully functional.

I would say yes, as I don't know what gb.spi will actually include.

> 
> When I press the debug button I need to copy the source directory on
> target system, and run the compiler on it.
> 
> If I'm a good coder I have no error, but if I get an error, I have to
> redirect it on gambas IDE.

Not really. The compiled code is the same on all architecture. So all the 
compilation is done on the PC. 

Theoritically, The ARM just needs the executable generated with debugging 
information.

> 
> Is it possible to compile on my PC system and only when the compilation
> is done, move the project directory on my target system ?
> When I compile on PC and move on ARM system which gb.spi the executable
> use ? In this manner I haven't to redirect the compiler output from
> target system to PC system .

See above.

> 
> At this point ON PC system I call the gbx2 with 2 argument the first
> that tell to executor to use a tcp socket and the second which address
> it must connect. ON Target system the gbx2 will be launch with only an
> argument that tell to became a server and than use the tcp socket for
> exchange the debug data.
> 
> Is this mechanism correct ?

Not really: you are debugging one project, so you run only one program. The 
ARM one. The PC process is already running, it is the IDE. 

By using ssh, the IDE will run "gbx3" (not gbx2, as only Gambas 3 is opened to 
new developments) directly on the ARM. 

Using a tcp socket, and its address can be put in the same argument. For 
example, starting with a double slash means "tcp".

So, if:
- The ARM gets a full executable.
- The ARM ip is 10.90.0.2.
- The PC ip is 10.90.0.1.
- The PC uses the 8080 port.
Then the IDE will run something like that:

	$ scp /path/to/executable/on/pc user at ...649...:/path/to/executable/on/arm
	
	$ ssh user at ...649...:/path gbx3 -g -x /path/to/executable/for/arm -f \
	//10.90.0.1:8080

And if you want to debug just the gb.spi component, you must do that directly 
on ARM, by using a test Gambas project. If you have crashes, you must use gdb 
directly on the ARM.

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list