Altera_Forum
Honored Contributor
14 years agoconnect to gdb stub for rtems rt os
Hi,
I have been using the altera nios2-elf-gdb to debug over the usbblaster interface but this debugger knows nothing of the OS and it can be a limiting factor when working in complex programs with many threads. Therefore, I implemented a gdb stub which knows about the RTEMS RT OS that I am using. I decided that I would communicate with this gdb stub using a JTAG UART which I have added to the design. All of this mostly works and I can connect to it with "target remote | nios2-terminal --instance 1 --quiet --flush" in gdb, but unfortunately when gdb needs to break into the program it sends ascii 3, or ^C, but this causes the nios2-terminal to stop running (typically linux programs stop when they see ^C on the standard input). So..., here is the question, can one somehow connect directly to the jtag uart via the altera jtag server using TCP from gdb, or some program that I write? Is the protocol spoken by the altera jtag server documented? Is the source code for the nios2-terminal or nios2-gdb-server available so that I can make the necessary revisions (adding a signal handler for SIGINT? Does anyone know of a better way. I did also try using stty to change the interrupt character code but this hasn't been entirely successful because the nios2-terminal never stops when gdb stops and must be manually killed. I suspect that perhaps "target remote | program" in gdb is mostly intended for simulations debugging and for linux kernel debugging, and that with remote targets gdb typically expects to directly connect to the target via a serial port or to a tcp port. Any suggestions are appriciated, Thanks, Jeff