Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
3,776 Views

Nios II Debugger problem

When I try to debug the simple_socket_server app in Nios II SBT for Eclipse I get the following error: 

 

.gdbinit: No such file or directory. 

Reading symbols from C:/NEEK_Qsys/Ethernet3/neek_ethernet_fred2_good50_Copy/software/NEEK_example_sss_flash/NEEK_example_sss_flash.elf...done. 

Stopped due to shared library event 

 

 

Can someone please explain what I am doing wrong?
0 Kudos
17 Replies
Altera_Forum
Honored Contributor I
153 Views

Exactly my question too!! 

 

The ".gdbinit: No such file or directory" message has been coming up for months, but never caused any problems. As of recently however, I also started getting "Stopped due to shared library event" during execution, and then the processor resets. Usually it does that several times before it finally executes the program to the end. 

 

Thinking it may have something to do with the debugger, I run the program in Release config, and it still does the resetting...
Altera_Forum
Honored Contributor I
153 Views

It's my problem too... The solve exists?

Altera_Forum
Honored Contributor I
153 Views

I have the same problem! Any resolves?

Altera_Forum
Honored Contributor I
153 Views

Try running Nios II Software Build Tools for Eclipse "as administrator" to see if that helps. 

 

In Windows Start Menu, click on All Programs, then open the Altera folder. Select Nios II EDS 11.0sp1 (or whichever version you are running) then right-click on nios iisoftware build tools for eclipse and select run as administrator. Windows will probably ask you if this is OK, just say yes. The SBT will now have administrative privileges so sharing files will not be an issue. 

 

Good luck!
Altera_Forum
Honored Contributor I
153 Views

Thanks for the suggestion, but there was no change..  

 

The problem is still there even if the the debugger is not in use, but in that case the cpu just hangs. With the debugger I get the error msg and it resets.
Altera_Forum
Honored Contributor I
153 Views

Is this a custom board or a development kit? 

 

Have you been able to run any code on the Nios II? 

 

Are you using the Nios II Terminal to monitor the software?
Altera_Forum
Honored Contributor I
153 Views

It is a custom board. 

 

Most code runs. The problem has been gradually more frequent until during software development until it could be considered more or less constant. Note that the break does not occur at a given point in time. It is random but often around the time of and IRQ event. 

 

The board has a serial interface with which a can see resets when the debugger issues the "Stopped due to shared library event" message. If the debugger is not attached the code just freezes. 

 

Since this seems to be a common problem (google) I was hoping there would be a "standard" fix. It feels like some area of memory is accessed in some erroneous manner. What library is referred to?
Altera_Forum
Honored Contributor I
153 Views

This is getting way out of my area of expertise. Perhaps someone else on the forum will chime in with more info. 

 

I'm thinking your problem may be an issue with Eclipse rather than your design. 

 

I found this entry in the eclipse.org forum, which may shed some light on your situation: 

 

http://www.eclipse.org/forums/index.php/m/503935/ 

 

 

Good luck...
Altera_Forum
Honored Contributor I
153 Views

fheineman: Thanks for your help! Did the "Run as admin" solve your problem? 

 

Ive seen some posts where the problem has gone away when people have edited thier .gdbinit file. However, I dont know how to edit it. What paths do I set? I am running the "Nios II 11.1 Software Build Tools for Eclipse" under Windows. But the paths Ive seen people use are Linux paths. Cygwin is installed together with Eclipse, perhaps the builds are done under a Linux environment? Is so to what files are one to point out with the paths, one might ask... 

 

postman,chnaideur: Are you still having the problem? If not, what solved it?
Altera_Forum
Honored Contributor I
153 Views

 

--- Quote Start ---  

Did the "Run as admin" solve your problem?  

--- Quote End ---  

 

 

NO! I gave up on that problem and stopped trying to use the debugger. I have to run my Nios II code out of external flash memory, so I can't really use the debugger anyway. Plus it just adds another layer of uncertainty (and aggravation) to the debugging process. Instead I insert printf() statements at key locations in the code to monitor the software. 

 

 

--- Quote Start ---  

 

Ive seen some posts where the problem has gone away when people have edited thier .gdbinit file. However, I dont know how to edit it. What paths do I set?  

--- Quote End ---  

 

 

I don't think you really need a .gdbinit file, but I don't know for sure.
Altera_Forum
Honored Contributor I
153 Views

Hmm, so without the debugger your code does not reset? That is interesting... I'll try different debug levels and also removing the debugger on monday! :) 

 

Thanks!
Altera_Forum
Honored Contributor I
153 Views

 

--- Quote Start ---  

Hmm, so without the debugger your code does not reset? That is interesting... I'll try different debug levels and also removing the debugger on monday! :) 

 

--- Quote End ---  

 

 

Yes, my code runs fine without the debugger. This is a custom board on which I have the Cyclone III FPGA logic being booted from an EPCS16 and the Nios II code booting from external flash memory. I just got the whole thing up and running with the Interniche NicheStack running both telnet and FTP services, both of which are interfaces to an on-board SD Card socket. Quite a chore, I must say... 

 

Good luck with your system on Monday.
Altera_Forum
Honored Contributor I
153 Views

karlxmar: I managed to get my code running by making sure that no segmentation faults were happening... easier said than done, as the chip would just reset without indicating where the fault actually occurred, thus I had to breakpoint/printf my way to the error source. 

 

I don't know much about the debugger and I am sure there must be a way you are supposed to do it (perhaps something to do with the exception stack?), in which case I haven't found it yet!
Altera_Forum
Honored Contributor I
153 Views

IIRC you can enable a 'misaligned address trap' and also an 'invalid address trap' (these may be on the 'hidden' options menu though). 

These should cause an exception (interrupt) be triggered if you access an illegal (enough) address. 

Writing an exception handler to save the info and report it to the host is a SMOP. Probably easier if you don't have any 'normal' interrupts.
Altera_Forum
Honored Contributor I
153 Views

I've seen this problem before using Qsys / Quartus 12.1 - the signal to the JTAG UART reset line should come only from the NIOS JTAG reset line. All other resets should be removed from that line.

Altera_Forum
Honored Contributor I
153 Views

For the solution of this problem I removed project directories /db and /incremental_db. Close and restart Quartus II.

Altera_Forum
Honored Contributor I
153 Views

For me the problem came up when i copied the project and changed the frequency of my CPU. The solution was to clean and rebuilt the QuartusII project!

Reply