I am attempting to use GDB to debug a remote target over a serial line on a windows box using MinGW. The target remote command GDB expects a path to a device driver (e.g. /dev/ttyS0) in order to connect to the remote target. There are 4 properly functioning serial ports on my machine, but they don't seem to be visible from MinGW. Is there a way to install them, or is this just not possible in the self proclaimed minimalist MinGW?
I did some searching on MinGW, Google, and here and wasn't able to find anything relevant.
Per #J.J Hakala com ports are just named com1, com2, etc in windows. They are in the root directory so ./com1 works as well. There is no need to install drivers.
Related
I have been tasked with setting up a development environment for an embedded platform. So far, I have set up a remote build host in NetBeans, which copies all of the source files to the target device, compiles them natively with the GNU toolchain on the device (g++, ld, etc.), and then runs the compiled binary and forwards stdout to the development machine that NetBeans is running on.
What I don't understand is: How does the binary on the build machine know where and when to start/stop if the breakpoints exist only in NetBeans? The build host only required ssh access and a compiling/linking toolchain, but somehow seems to communicate with NetBeans for debugging. A colleague of mine suggested it uses gdbserver, but I have not found any documentation on the NetBeans website about this package, and it is not installed on the build host (at least not from apt). How is NetBeans doing this?
GUI IDE's which use (or can be configured to use) a distinct command-line toolchain for compilation and debug typically do this by running each required toolchain program as a subprocess and interacting with it through standard streams. Essentially, the IDE would use gcc or gdb with the same textual interface used when running it in a terminal window. The IDE uses its knowledge of lines in the source file to configure breakpoints in gdb much as you would while running it by hand.
In your case, the IDE is configured to use a "remote host" for all of this, so instead of being invoked locally, the toolchain is controlled through as ssh session to the remote machine where both building and running occur.
Because the gdb debugger and the target program are running on the same computer, no gdbserver is required.
In the cases where gdb is too large for the target system, gdbserver is a small program which often gets cross-compiled for the target and loaded onto it. This serves as a compact little delegate which talks to the main gdb program running on a build machine via a serial or network connection and performs the raw interaction with processor, memory, and running program on behalf of gdb.
Another possibility is that the gdbserver role is held by a helper program running on the same machine as gdb which instead commands something like a JTAG debug adapter to interact with the target hardware at a lower level. In this case however, the helper program implementing the gdbserver protocol is not usually called "gdbserver" but instead has an implementation specific name, for example openocd.
gdb runs on the target machine. Only communication with gdb (commands etc) goes via net to your local machine. Read gdb documentation if need to know more/
You can do exactly the same - just open the remote terminal , run gdbserver, start gdb and you are done :)
The port option in Arduino Uno IDE is not accessible.
I have win7 32bit, I have tried the installation of driver file arduino.inf, but still it is not working
Probably because windows did not recognize any com ports. Go to device manager and look for COM ports. Check if it shows up there or not.
If not, then that means windows did not recognize it and there is a connection problem
We develop C++ code primarily on a headless linux x64 server with VI. We are provided with windows desktops and I was wondering how others in similar situation work? Do you just use windows to remote into linux box or is there a way to develop on windows.
Two solutions that come to my mind are:
Run a linux VM on windows desktop.
Cygwin. (not sure about it).
Any others?
There is a VIM port for windows. As an everyday user I can say that the experience is seamless, except for using windows path separators.
There are other options to consider:
MSYS supplies you with a set of GNU tools compiled natively for windows, including a shell, ssh/scp
MinGW gets you a Windows port of gcc.
UnxUtilx is another set of GNU tool ports, but with no recent activity.
As others have mentioned, putty gets you ssh/scp, purpose-built for windows.
The only C++ app I currently develop is Qt based and cross platform so I tend to develop in Windows using Visual Studio and then test on linux. For testing on linux I mostly use putty, vi and make but if I need to use a debugger I use nemiver and xming with putty exporting the x session to the PC for xming to render.
Do you just use windows to remote into linux box or is there a way to develop on windows. -- yes mostly I do that.
winscp is a tool that lets you do your text-editing locally in your editor of choice, whether it be emacs for windows or gedit or notepad, and save remotely.
When I worked in an environment like that, I installed Cygwin/X and putty on my windows box. You use putty to connect to the Linux box with the Connection --> SSH --> X11 --> "Enable X11 forwarding" turned on. You
Install Cygwin including Cygwin/X http://x.cygwin.com/ — download the installer, make sure the xinit package is selected in the things to install, and hit go!
Install PuTTY http://www.chiark.greenend.org.uk/~sgtatham/putty/ and enable X forwarding in your session settings. PuTTY will automagically set your DISPLAY environment variable correctly.
Start your X server on Windows (Start -> Programs -> Cygwin/X -> XWin Server ) — you may want to copy this to your Startup group so it runs whenever you log in.
Use PuTTY to connect to your *nix box and fire up an X Windows program — remember to "amp it off" http://www.catb.org/jargon/html/A/amp-off.html.
You can use whatever X programs are available on the Linux machine seamlessly on your local client desktop. You can do it with Eclipse or gvim or kate.
Another thing I've had good luck with is using Samba on the Linux box to share my source tree, and then mapping a drive in Windows to that share, using native Windows tools to edit it.
I recently downloaded new linux kernel source code and compiled on ubuntu. After my system is not recognizing any usb devices. Is there any changes required to compiling procedure or make files in order to enable USB host?
Please help me to get out of this problem. Thanks.
It is possible for the USB support to be disabled though incorrect or incomplete configuration.
You didn't mention how you configured the kernel though.
A good point to start is the existing configuration for the default Ubuntu kernel. There should be a config file in boot, like /boot/config-3.1.0-1-amd64.
Copy that file to your kernel directory as .config, then use make oldconfig to update the configuration.
When installing the kernel take care to create the corresponding initrd as well.
I use a headless (i.e. no screen) remote ubuntu server x64 for developping a C++ application (with no UI either).
I want to conveniently (IDE like, not command line) debug this program from windows (7/64), with Eclipse if possible. I have a windows share between the two and full root access on both machines.
So far I have heard of two solutions :
Remote gdb
Remote X server
I have worked on solution 1 : built a cross gdb, copied my program and libs on windows. I'm able to remote-gdb from cygwin command line, but not from eclipse (stuck at "launching... 85%" with no error message nor log)
I have also worked on solution 2 : installed xauth, set X forwarding, installed xming on my windows, set DISPLAY on the linux box. But no effect "can't open DISPLAY xxx" with no easy troubleshoot.
When googling for those problems, I only find outdated pages or different problems.
Did anyone do it ? Can you share advices or fresh pointers on how to remote debug a C++ linux app from Windows ?
I suggest to install an X11 server on your Windows machine (e.g. Xming perhaps?) and to do ssh -X with some X11 client applications (like emacs, ddd if needed, xterm) on your Linux server. Don't use a complex thing like Eclipse. You could just use emacs (remotely on the Linux server, displaying on the Windows desktop X11 server)...
Once emacs works well (running on the remote Linux server, displaying on the Windows desktop X11 server), you can run gdb inside it.
To get ssh -X working, you need to configure it appropriately. Maybe you forgot that step. To test it, just use ssh -X yourlinuxhost xterm, and work on configuration till that step works.
Of course you could also install Linux on your laptop or desktop, perhaps inside a virtual machine above your Windows.
NB. I never used Windows, but I do know that some X11 servers exist for it.
There is a eclipse plugin RSE (Remote System Explorer), it can pretty much do what you are expecting. The code base can be in linux server, eclipses uses telnet / ssh to login. Execution again can happen on a server, native gdb is used to debug.
You can use the following simple plugin for Eclipse.
http://marketplace.eclipse.org/content/direct-remote-c-debugging
It needs just ssh connection to the server and it cares about anything else