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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Problem with debugging assembly code with NIOS II

Altera_Forum
Honored Contributor II
1,144 Views

I have an assembly file that looks like the following: 

#include "nios2.h"# include "system.h"# include "cpu_const.h"     .extern    tmp_space       .section .text 1        .global _cpu_task_start 2   _cpu_task_start: 3        movia    r22, tmp_space 4        movia    r23, REGISTERS_OFFSET 5 _cpu_task_loop: 6        ldbio    r21,status_offset(r23)     7        andi    r2,r21,status_rec_bit 8        beq    r2,r0, koniec_rec     ...................        and so on 

 

And I have c code witch calls this function 

9        _cpu_task_start(); 

 

Everything compiling and linking ok. It seems to work ok too. But if I try to debug it with NIOS II IDE, I can't debug assembly function. 

When debugger stops on line 9, debugging work fine, I see source code window and disassembly window. When I try to do “Step Into” debugger stops at the first line, but I can see it only on disassembly window, the source code window still remain on line 9  

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

Disassembly window 

0x01000594 <_cpu_task_start>:    movhi r22,257 

0x01000598 <_cpu_task_start+4>:  addi  r22,r22,11376 

0x0100059c <_cpu_task_start+8>:  movhi r23,160 

0x010005a0 <_cpu_task_start+12>: addi  r23,r23,512[/b] 

--- Quote End ---  

 

In this way, I only can debug first two line of assembly code, line no. 6 is unreachable.  

(Debugger dont stop, if I suspend, it stops in C code, much more ahead). 

If I set a breakpoint in line 7, the debugger stops in entirely different function “alt_irq_init”. 

It seems for me, that debugger doesn&#39;t see my test.s file. 

 

Pleas help, what can I do to debug it in normal way.  

The assembly part of start up code is debugging fine. 

I&#39;ll be appreciate for any advice. 

 

I use NIOS V5.0. 

 

Regards 

Darek
0 Kudos
0 Replies
Reply