2008-07-02 10:28:16     Debugging using bfin-linux-uclibc

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-07-02 10:28:16     Debugging using bfin-linux-uclibc

Juhi Sinha (INDIA)

Message: 58223   

 

We want to use internal memory of blackfin to store the data and Instructions by using the sections L1_code,L1_data_a and  so on.

We have tried doing that by following the link below:

http://docs.blackfin.uclinux.org/doku.php?id=using_l1_memory

 

We used the following command :

 

bfin-linux-uclibc-gcc -pie -Wl,-sep-code -Wl,-code-in-l1,-z,now -Wl,-data-in-l1 test.c -o test

 

Our code:

 

----------------------------------------------------------------------------

 

#include <stdio.h>

#include <stdlib.h>

int array1[100]={5,5,6,6,0,0,4,2,1,5,9,0,7,5,5,7,64,4,0,0,0,0,0};

int main()

{

    int a=3,b=4,c=7;

    int array2[20]={1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0};

    printf("a = %d , b = %d , c = %d \n",a,b,c);

    c = a + b;

    printf("new value of  c = %d\n",c);

    b=6;

return 2;

}

 

--------------------------------------------------------------------------------

 

When we debug :

 

-------------------------------------------------------------------------------------------------

(gdb) target remote 10.7.133.73:3456

Remote debugging using 10.7.133.73:3456

0x00491180 in ?? ()

(gdb) break main

Breakpoint 1 at 0xffa02310: file main.c, line 14.

(gdb) next

Cannot find bounds of current function

(gdb) next

Cannot find bounds of current function

(gdb) x/100w &array1

0xff900494 <array1>:    Cannot access memory at address 0xff900494

(gdb) x/20w &array2

No symbol "array2" in current context.

(gdb) next

Cannot find bounds of current function

 

(gdb) x/100w &array1

0xff900494 <array1>:    Cannot access memory at address 0xff900494

(gdb) x/20w &array2

No symbol "array2" in current context.

(gdb) continue

Continuing.

Ignoring packet error, continuing...

Reply contains invalid hex digit 116

 

-------------------------------------------------------------------------------------------------------

 

We could not debug the above program.But we are able to run the code using ' root:/> ./main '  directly.

 

Please help us with this !

 

 

 

 

 

QuoteReplyEditDelete

 

 

2008-07-02 10:39:24     Re: Debugging using bfin-linux-uclibc

Mike Frysinger (UNITED STATES)

Message: 58224   

 

debugging with userspace code in L1 does not currently work.  debug your code in external memory first and then move it to L1.

Attachments

    Outcomes