2011-03-23 03:17:55     gdb debugging

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

2011-03-23 03:17:55     gdb debugging

Mahalakshmi M (INDIA)

Message: 99156   

 

Hi,

 

I am working on gbd debugging and i am new to it. While connecting i am getting SIGTRAP and SIGBUS error before hitting 1st breakpoint in main() and gdb got exited. Please find the log below.Can u please suggest ways to overome this.

 

 

 

root:/> gdbserver 172.16.15.47:1234 ./AD004 gp.bdb &

235

root:/> Process ./AD004 created; pid = 236

Listening on port 1234

Remote debugging from host 172.16.4.17

Data access misaligned address violation

- Attempted misaligned data memory or data cache access.

Deferred Exception context

CURRENT PROCESS:

COMM=AD004 PID=236

CPU = 0

TEXT = 0x00400000-0x006297e4        DATA = 0x060007e4-0x06e9e13c

BSS = 0x06e9e13c-0x07520000  USER-STACK = 0x0753fea0

 

return address: [0x00443030]; contents of:

0x00443010:  3218  6807  e13c  0000  e13d  0000  e13e  0000

0x00443020:  e13f  0000  3246  9001  3050  6f26  bdb2  b177

0x00443030: [e41b] 1d81  b0f3  e41b  1a48  b133  e418  00b8

0x00443040:  e2ff  f91c  3218  3002  67e0  05f4  3200  3229

 

ADSP-BF533-0.6 594(MHz CCLK) 118(MHz SCLK) (mpu off)

Linux version 2.6.28.10-ADI-2009R1

Built with gcc version 4.1.2 (ADI svn)

 

SEQUENCER STATUS:               Tainted: P

SEQSTAT: 00060024  IPEND: 0030  SYSCFG: 0006

  EXCAUSE   : 0x24

  interrupts disabled

  physical IVG5 asserted : <0xffa00bd0> { _evt_ivhw + 0x0 }

RETE: <0x00000000> /* Maybe null pointer? */

RETN: <0x008da000> /* kernel dynamic memory */

RETX: <0x00000480> /* Maybe fixed code section */

RETS: <0x0044300e> [ /AD004 + 0x4300e ]

PC  : <0x00443030> [ /AD004 + 0x43030 ]

DCPLB_FAULT_ADDR: <0x0040c020> [ /AD004 + 0xc020 ]

ICPLB_FAULT_ADDR: <0x00443030> [ /AD004 + 0x43030 ]

 

PROCESSOR STATE:

R0 : 00405701    R1 : 00000002    R2 : 0753fea4    R3 : 00000002

R4 : 075011b0    R5 : 0753ff70    R6 : 0753ff50    R7 : 008d2178

P0 : 0753fea4    P1 : 00000000    P2 : 0753ff70    P3 : 00405701

P4 : 00442fe0    P5 : 008d2188    FP : 00000000    SP : 008d9f24

LB0: 07506361    LT0: 07506354    LC0: 00000000

LB1: 0044314b    LT1: 00443144    LC1: 00000000

B0 : 00000000    L0 : 00000000    M0 : ffffffe8    I0 : 076e77f0

B1 : 00000000    L1 : 00000000    M1 : 00000000    I1 : 076e77f4

B2 : 00000000    L2 : 00000000    M2 : 00000000    I2 : 00000000

B3 : 00000000    L3 : 00000000    M3 : 00000000    I3 : 00000000

A0.w: 00000000   A0.x: 00000000   A1.w: 00000000   A1.x: 00000000

USP : 0753fe84  ASTAT: 02002000

 

Hardware Trace:

   0 Target : <0x00083c70> { _trap_c + 0x0 }

     Source : <0xffa0062a> { _exception_to_level5 + 0x9e } CALL pcrel

   1 Target : <0xffa0058c> { _exception_to_level5 + 0x0 }

     Source : <0xffa0046c> { _bfin_return_from_exception + 0x18 } RTX

   2 Target : <0xffa00454> { _bfin_return_from_exception + 0x0 }

     Source : <0xffa004e2> { _ex_trap_c + 0x46 } JUMP.S

   3 Target : <0xffa0049c> { _ex_trap_c + 0x0 }

     Source : <0xffa006f4> { _trap + 0x58 } JUMP (P4)

   4 Target : <0xffa0069c> { _trap + 0x0 }

     Source : <0x0044302e> [ /AD004 + 0x4302e ] 0xb177

   5 Target : <0x0044300e> [ /AD004 + 0x4300e ]

     Source : <0x004431ba> [ /AD004 + 0x431ba ] RTS

   6 Target : <0x004431ac> [ /AD004 + 0x431ac ]

     Source : <0x004431e6> [ /AD004 + 0x431e6 ] JUMP.S

   7 Target : <0x004431e4> [ /AD004 + 0x431e4 ]

     Source : <0x00443178> [ /AD004 + 0x43178 ] IF !CC JUMP

   8 Target : <0x0044313a> [ /AD004 + 0x4313a ]

     Source : <0x004431c0> [ /AD004 + 0x431c0 ] IF CC JUMP

   9 Target : <0x004431bc> [ /AD004 + 0x431bc ]

     Source : <0x0044310a> [ /AD004 + 0x4310a ] IF !CC JUMP

  10 Target : <0x00443101> [ /AD004 + 0x43101 ]

     Source : <0x00443122> [ /AD004 + 0x43122 ] IF CC JUMP

  11 Target : <0x00443120> [ /AD004 + 0x43120 ]

     Source : <0x004430fe> [ /AD004 + 0x430fe ] JUMP.S

  12 Target : <0x004430b2> [ /AD004 + 0x430b2 ]

     Source : <0x004431de> [ /AD004 + 0x431de ] JUMP.S

  13 Target : <0x004431dc> [ /AD004 + 0x431dc ]

     Source : <0x00443082> [ /AD004 + 0x43082 ] IF !CC JUMP

  14 Target : <0x00443060> [ /AD004 + 0x43060 ]

     Source : <0x00443152> [ /AD004 + 0x43152 ] IF CC JUMP

  15 Target : <0x0044314c> [ /AD004 + 0x4314c ]

     Source : <0x00443090> [ /AD004 + 0x43090 ] IF !CC JUMP

Userspace Stack

Stack info:

SP: [0x0753fe84] <0x0753fe84> [ AD004 + 0x1fe84 ]

Memory from 0x0753fe80 to 07540000

0753fe80:<0044300e>[008d2188] 00442fe0  008d2178  0753ff50  0753fea0  008d2178  0753ff70

0753fea0: 00000002  0753ff99  0753ffa1  00000000  0753ffb1  0753ffb8  0753ffc6  0753ffe9

0753fec0: 00000000  00000010  00000000  00000006  00001000  00000011  00000064  00000003

0753fee0: 00400034  00000004  00000020  00000005  00000007  00000007  07500000  00000008

0753ff00: 00000000  00000009  00442fe0  0000000b  00000000  0000000c  00000000  0000000d

0753ff20: 00000000  0000000e  00000000  00000017  00000000  0000001f  0001fff4  00000000

0753ff40: 00000000  00000000  00000000  00000000  00020000  07500000  00000000  0000702c

0753ff60: 008d202c  0000b02c  00000450  00000000  00020000  00400000  00000000  002297e4

0753ff80: 060007e4  0022d7e4  00e9d958  00000000  00000000  00000000  412f2e00  34303044

0753ffa0: 68506700  70696c69  504e5f73  6264622e  4d4f4800  002f3d45  4c454853  622f3d4c

0753ffc0: 732f6e69  41500068  2f3d4854  3a6e6962  7273752f  6e69622f  62732f3a  2f3a6e69

0753ffe0: 2f727375  6e696273  52455400  696c3d4d  0078756e  44412f2e  00343030  00000000

07540000: 464c457f

Return addresses in stack:

    address : <0x0044300e> [ /AD004 + 0x4300e ]

 

Child terminated with signal = 7

 

Child terminated with signal = 0x7 (SIGBUS)

GDBserver exiting

 

 

 

In my host i am getting the following message.

 

Function Prologue not recognised. pc will point to ENTRY_POINT of the function

Function Prologue not recognised. pc will point to ENTRY_POINT of the functio

QuoteReplyEditDelete

 

 

2011-03-23 03:35:40     Re: gdb debugging

Jayaprabhu Nadarajan (INDIA)

Message: 99160   

 

Hi,

 

Looks like your application is getting crashed. Did you try "*addr2line -f -e AD004 0x4302e" which will point to the function which is responsible for the trap.

 

For avoiding SIGTRAP you can give the following command once you connect your host to the target.

 

"handle SIG32 nostop noprint pass"

 

Regards,

 

Jp

QuoteReplyEditDelete

 

 

2011-03-23 04:50:17     Re: gdb debugging

Mahalakshmi M (INDIA)

Message: 99161   

 

Thank u. I checked this address it got crashed before entering main in "__start"

 

Can u please suggest ur view on this?

QuoteReplyEditDelete

 

 

2011-03-23 06:09:27     Re: gdb debugging

Mahalakshmi M (INDIA)

Message: 99162   

 

Issue got solved.My toolchain is 2009R1 and i builed my appln in 2008R1 . After building my application with 2009R1 the problem is resolved.

 

Now i can able to keep break point till  thread creation.After that if i keep breakpoint inside that thread run function[MainThread()]  it is not hitting that break point instead it ignores that breakpoint and my application is running.

 

main()

 

{

   pthread_attr_init(&Thread_Attribute);

        pthread_attr_setstacksize(&Thread_Attribute, UI_STACKSIZE);

        pthread_attr_setschedpolicy(&Thread_Attribute,SCHED_RR);

        st_Scheduler_Parameter.sched_priority = UI_PRIORITY;

        pthread_attr_setschedparam(&Thread_Attribute,&st_Scheduler_Parameter);

 

        pthread_create(&PThread_ID, &Thread_Attribute, &MainThread, NULL);

 

        while(1)

        {

                usleep(5000000);//let the main not exit

        }

 

}

 

 

Kindly provide ur views ?

QuoteReplyEditDelete

 

 

2011-03-23 06:31:35     Re: gdb debugging

Jayaprabhu Nadarajan (INDIA)

Message: 99163   

 

Are you using two different makefile ?

 

Are you compiling with -g option i.e with Debug symbols

 

Regards,

 

JP

QuoteReplyEditDelete

 

 

2011-03-23 06:48:27     Re: gdb debugging

Mahalakshmi M (INDIA)

Message: 99164   

 

yes i am using -g option.

 

COMPILE_OPTS =  -g $(INCLUDES) -I. -O0 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -DDMR_DEVICE $(UCLINUX_COMPILE_OPTIONS) $(UCLINUX_INCLUDE_PATH) -IDMP/include  -DUCLINUXBASE=1

Attachments

    Outcomes