Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

Debugging user space app on uClinux with MMU "hangs" system

Altera_Forum
Honored Contributor II
1,084 Views

Dear all,  

 

I'm trying to debug a user space application on my uClinux/NIOS2 system with MMU, following the instructions in the NIOS Wiki under www(dot)nioswiki(dot)com/OperatingSystems/UClinux/DebugApps (*)  

 

I'm using gdbserver on the target and gcc/gdb from "toolchain-mmu" in the MMU distribution of uClinux, namely "nios2-linux-gnu-gcc" and "nios2-linux-gnu-gdb". Debugging shall be done over TCP/IP via Ethernet.  

 

At first, everything seems to work fine: 

I can start the debuggee via "gdbserver", connect to the target via gdb's "target remote <ip>" command and I can also set breakpoints. AFer that, I start the debuggee by using gdb's "continue" command. 

 

The problem is, that the entire system seems to hang as soon as the sowftware stops on the first breakpoint. In the documentation mentioned above, I found the following: 

 

 

--- Quote Start ---  

This nios2-linux-uclibc-insight uses ptrace support of Linux kernel. When it hits a breakpoint, all the other processes still running. this is very different from the nios2-elf-insight, where all processes are stopped 

--- Quote End ---  

Since I'm not using the uclibc version of gdb/gcc: does that mean that really all processes are stopped once a breakpoint is hit? This would really be a problem since I have at least on critical process (a watchdog trigger) running on the target which must never been stopped even when debugging an application. And what about the kernel drivers (ethernet)? Are they stopped too? 

 

Bottom line: has anyone managed to debug user space apps using the toolchain in the MMU distribution? Any help is greatly appreciated. 

 

Kind regards, 

Gerald 

 

 

(*) Sorry for the weird link notation. For some reason, newusers are not allowed to post weblinks.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
403 Views

Please add solibs prefix, see 

 

http://www.alterawiki.com/wiki/debug_user_space
0 Kudos
Altera_Forum
Honored Contributor II
403 Views

Thanks alot, Hippo!  

Now I can debug with gdb running on Ubuntu-Linux which is great! 

 

Working with the NIOS2 gdb under Windows/cygwin however does not work yet. I'm using an Altera toolchain as installed in  

 

C:\altera\91\nios2eds\bin\nios2-gnutools\H-i686-pc-cygwin\bin 

 

Is there a similar trick I can use on Windows or shall I just forget about debugging under Windows/cygwin? 

 

Kind regards, 

Gerald
0 Kudos
Reply