problems about mcore-elf-gdb

leiming blackhorse_linux@sina.com
Mon Aug 26 18:08:00 GMT 2002


Mr.Bill Gatliff:
    I have turned on the LEDs and the test program is to light it up ten times. Also,I have succeeded runing the program in the gdb-mcore(GNU gdb 4.17  MTC-4.6) ,which is provided by motorola Corp. .
   When I debug the test program  in mcore-elf-gdb(GNU gdb 5.2) , 
I think the problem took place in the very time,at which the "text section,data section and rodata section" have been downloaded into the target board  but it seems the gdb or picobug can't known how to do or do the next step errorly.
  I¡¡really need your help.Please give me a direct.
  thank you!


leiming  

----- Original Message -----
From:"William A. Gatliff" <bgat@billgatliff.com>
To:leiming <blackhorse_linux@sina.com>
Subject:Re: problems about  mcore-elf-gdb
Date:Tue, 27 Aug 2002 01:51:57 +0800
 >Do you have any LEDs you could turn on?  Turn them in on various places in the code, and see how far you're getting before it crashes.
 >
 >HTH,
 >
 >
 >b.g.
 >
 >On Mon, Aug 26, 2002 at 04:42:41PM +0800, leiming wrote:
 >> Mr.Bill Gatliff:
 >>    
 >>    Last time I¡¡have still not solved the problem which mcore-elf-gdb(ver 5.2) can not do remote debuging correctly with the monitor Picobug,though I modified the linker script.
 >>   I link object with command "ld-MCORE -o testgnu.elf -N -Ttext 0x8100c000 -Tdata 0x8100d000 -defsym __SP_INIT=0x8100f000 -e _start init.o main.o m2107_led.o  -L%GCC_MCORE_BASE%libgcc-libmcore-elfegcs-2.91.60 -lc -liberty -lm -lg"  .The init.o is the initialize routine to be used for the sample and the source code follows.
 >>       
 >> //// File: init.s                                  
 >> 	.export	_start                                     
 >> _start:                                                  
 >> 	lrw	r1,__SP_INIT  
 >> 	mov	r0,r1         
 >> 	jbsr	main                                        
 >>                               
 >>         .export __init        
 >>         .align  2             
 >> __init:                       
 >>         subi    r0,8          
 >>         stw     r15,(r0,0)    
 >>                               
 >> // Return from __init         
 >>                               
 >>         ldw     r15,(r0,0)    
 >>         addi    r0,8          
 >>         jmp     r15           
 >>         .export __fini        
 >>         .align  2             
 >> __fini:                       
 >>         subi    r0,8          
 >>         stw     r15,(r0,0)    
 >>                               
 >> // Return from __fini         
 >>                               
 >>         ldw     r15,(r0,0)    
 >>         addi    r0,8          
 >>         jmp     r15           
 >>                               
 >>         .export __main        
 >>         .align  2             
 >> __main:                       
 >>         subi    r0,8          
 >>         stw     r15,(r0,0)    
 >>         ldw     r15,(r0,0)    
 >>         addi    r0,8          
 >>         jmp     r15           
 >> 
 >>  
 >> Please help me analyse the problem again.
 >> Thanks a lot for your before  directions!
 >>    
 >> leiming
 >> blackhorse_linux@sina.com
 >> 
 >> ----- Original Message -----
 >> From:"William A. Gatliff" <bgat@saturn.open-widgets.com>
 >> To:leiming <blackhorse_linux@sina.com>
 >> Subject:Re: Re: Re: problems about the mcore-elf-gdb
 >> Date:Tue, 9 Jul 2002 23:20:11 +0800
 >>  >Leiming:
 >>  >
 >>  >
 >>  >
 >>  >Well, if your stub's stack frame is at 8100c000b, then you'll have to
 >>  >either move it, or move your application.  That'd be by modifying the
 >>  >linker scripts for said application.
 >>  >
 >>  >
 >>  >b.g.
 >>  >
 >>  >On Tue, Jul 09, 2002 at 09:57:48AM +0800, leiming wrote:
 >>  >> 
 >>  >> Can you tell me how to solve the problem?
 >>  >> Thanks!
 >>  >>  
 >>  >> 
 >>  >> Leiming
 >>  >> ----- Original Message -----
 >>  >> From:"William A. Gatliff" <bgat@saturn.open-widgets.com>
 >>  >> To:leiming <blackhorse_linux@sina.com>
 >>  >> Subject:Re: Re: problems about the mcore-elf-gdb
 >>  >> Date:Mon, 8 Jul 2002 21:39:51 +0800
 >>  >>  >You don't have something important like, say, your stub's stack frame,
 >>  >>  >located around 8100C000B, do you?
 >>  >>  >
 >>  >>  >:^)
 >>  >>  >
 >>  >>  >
 >>  >>  >b.g.
 >>  >>  >
 >>  >>  >On Fri, Jul 05, 2002 at 02:43:44PM +0800, leiming wrote:
 >>  >>  >> 
 >>  >>  >>  Hi!
 >>  >>  >>  I have set debug remote 1 in the mcore-gdb console hosted in cygwin.The result follows and please help me analysis it
 >>  >>  >> 
 >>  >>  >> (gdb) set debug remote 1
 >>  >>  >> (gdb) target picobug com1
 >>  >>  >> read -->
 >>  >> <--
 >>  >>  >> read -->
 >>  >> <--
 >>  >>  >> read -->picobug> nobr
 >>  >> <--
 >>  >>  >> read -->
 >>  >> <--
 >>  >>  >> read -->picobug> Remote target picobug connected to com1
 >>  >> <--
 >>  >>  >> read -->
 >>  >> <--
 >>  >>  >> read -->picobug> rd
 >>  >> <--
 >>  >>  >> read -->
 >>  >> <--
 >>  >>  >> read -->     pc 8100c000      epc 80010a94      fpc 01002005
 >>  >> <--
 >>  >>  >> read -->    psr 80000000     epsr 80000001     fpsr 08000200
 >>  >> <--
 >>  >>  >> read -->ss0-ss4 bad0beef 81003000 20000800 00000000 00008100      vbr 81002c00
 >>  >> <--
 >>  >>  >> read -->  r0-r7 bad0beef 00000000 81003000 80013f90 81001fb4 8001402f 00000014 0
 >>  >>  >> 0000000
 >>  >> <--
 >>  >>  >> read --> r8-r15 81000024 80010040 0000000f 810037c9 810037c4 810037c9 81002f94 8
 >>  >>  >> 0010852
 >>  >> <--
 >>  >>  >> read -->picobug> 0x8100c000 in ?? ()
 >>  >>  >> (gdb) load testgnu.elf
 >>  >>  >> lo
 >>  >> <--
 >>  >>  >> sent -->S0030000FC
 >>  >> .text       : 0x8100c000 .. 0x8100c170  <--
 >>  >>  >> sent -->S30E8100C000710B12107F0B00002464
 >>  >> <--
 >>  >>  >> sent -->S30E8100C009709F008F00207000CFAA
 >>  >> <--
 >>  >>  >> sent -->S30E8100C012000024709F008F0020BC
 >>  >> <--
 >>  >>  >> sent -->S30E8100C01B7000CF000024709F0023
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0248F00207000CF0000811D
 >>  >> <--
 >>  >>  >> sent -->S30E8100C02D00F0008100C03424F00A
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0369F20983012087F1C2C12
 >>  >> <--
 >>  >>  >> sent -->S30E8100C03F8260037F1B60079708EC
 >>  >> <--
 >>  >>  >> sent -->S30E8100C048870822A7E001F01560CA
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0510260137F177F1760124C
 >>  >> <--
 >>  >>  >> sent -->S30E8100C05A60137F157F15602260D9
 >>  >> <--
 >>  >>  >> sent -->S30E8100C063137F137F136032601311
 >>  >> <--
 >>  >>  >> sent -->S30E8100C06C7F117F118708127620ED
 >>  >> <--
 >>  >>  >> sent -->S30E8100C075069608F7E712808F2078
 >>  >> <--
 >>  >>  >> sent -->S30E8100C07E883020F000CF24F098EF
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0872012086007970887085A
 >>  >> <--
 >>  >>  >> sent -->S30E8100C090760A0D76E801F00587B8
 >>  >> <--
 >>  >>  >> sent -->S30E8100C09908127620069608F7F6D6
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0A21280882020F000CF00F5
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0AB008100C0208100C0BCA7
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0B48100C0840000C34F2500
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0BD70984012081226123710
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0C61266B6081277B71877E5
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0CF2697186007B7888718C7
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0D8A607B688A78812762E08
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0E1F61267B788A7082C86C0
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0EA0F67E009A7182A17E087
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0F30360F7B788F0026007CB
 >>  >> <--
 >>  >>  >> sent -->S30E8100C0FCB788F01DA7082A17E890
 >>  >> <--
 >>  >>  >> sent -->S30E8100C1050E2217E8032A07E80659
 >>  >> <--
 >>  >>  >> sent -->S30E8100C10EF0152A27E80B2A37E80F
 >>  >> <--
 >>  >>  >> sent -->S30E8100C1170DF01087186016B607B9
 >>  >> <--
 >>  >>  >> sent -->S30E8100C120F00C87186026B607F0C1
 >>  >> <--
 >>  >>  >> sent -->S30E8100C1290887186046B607F00488
 >>  >> <--
 >>  >>  >> sent -->S30E8100C13287186086B607F0001239
 >>  >> <--
 >>  >>  >> sent -->S30E8100C13B808840217000CF24F0B8
 >>  >> <--
 >>  >>  >> sent -->S30E8100C144982012087709970887F3
 >>  >> <--
 >>  >>  >> sent -->S30E8100C14D08A60712672EE7127697
 >>  >> <--
 >>  >>  >> sent -->S30E8100C156B648A74801071212F050
 >>  >> <--
 >>  >>  >> sent -->S30E8100C15F001280882020F000CF37
 >>  >> <--
 >>  >>  >> sent -->S30D8100C168817FFFFD817FFFFC51
 >>  >>  >> .data   : 0x8100d000 .. 0x8100d000
 >>  >>  >> .rodata : 0x8100c170 .. 0x8100c170
 >>  >>  >> <--
 >>  >>  >> sent -->S7058100C000B9
 >>  >> <--
 >>  >>  >> sent -->
 >>  >> 
 >>  >> Transfer rate: 2944 bits in <1 sec, 368 bytes/write.
 >>  >>  >> Timeout reading from remote system.
 >>  >>  >> (gdb)
 >>  >>  >> 
 >>  >>  >> 
 >>  >>  >> 
 >>  >>  >> 
 >>  >>  >> 
 >>  >>  >> 
 >>  >>  >> 
 >>  >>  >> 
 >>  >>  >> 
 >>  >>  >>  >
 >>  >>  >>  >> When I run mcore-elf-gdb to debug my mcore-elf program in the
 >>  >>  >>  >> "target sim" mode,I can get designed result.When I am ready to
 >>  >>  >>  >> cross-debug the program,I also can connect to the target
 >>  >>  >>  >> machine(mcore) with the command "target picobug com1",but I can't
 >>  >>  >>  >> download it to the target machine."Picobug" is the monitor runing in
 >>  >>  >>  >> the mcore target machine and is supported by the gdb.
 >>  >>  >>  >> 
 >>  >>  >>  >> who can help me to solve the problem?
 >>  >>  >>  >
 >>  >>  >>  >You can!  :^)
 >>  >>  >>  >
 >>  >>  >>  >(gdb) set debug remote 1
 >>  >>  >>  >
 >>  >>  >>  >Then try the download again, and take a look at where it bombs out.
 >>  >>  >>  >That'll give us more of an idea where to look.
 >>  >>  >>  >
 >>  >>  >>  >Erp, it just occurred to me that picobug may not do a log file, or may
 >>  >>  >>  >use a different command to activate it.  Try to figure that out,
 >>  >>  >>  >because the alternative is for someone to replicate your setup and run
 >>  >>  >>  >mcore-elf-gdb under gdb...
 >>  >>  >>  >
 >>  >>  >>  >
 >>  >>  >>  >Cheers,
 >>  >>  >>  >
 >>  >>  >>  >b.g.
 >>  >>  >>  >--
 >>  >>  >>  >Bill Gatliff
 >>  >>  >>  >bgat@billgatliff.com
 >>  >>  >>  >
 >>  >>  >>  >
 >>  >>  >> 
 >>  >>  >> ______________________________________
 >>  >>  >> 
 >>  >>  >> ===================================================================
 >>  >>  >> ÐÂÀËÃâ·Ñµç×ÓÓÊÏä (http://mail.sina.com.cn)
 >>  >>  >> ÐÂÀË·ÖÀàÐÅÏ¢£º¶þÊÖÊг¡×ßÒ»×ߣ¬¸Ã³öÊÖʱ¾Í³öÊÖ£¡ (http://classad.sina.com.cn/2shou/)
 >>  >>  >
 >>  >>  >-- 
 >>  >>  >Bill Gatliff
 >>  >>  >bgat@billgatliff.com
 >>  >>  >
 >>  >>  >
 >>  >> 
 >>  >> ______________________________________
 >>  >> 
 >>  >> ===================================================================
 >>  >> ÐÂÀËÃâ·Ñµç×ÓÓÊÏä (http://mail.sina.com.cn)
 >>  >> ÐÂÀË·ÖÀàÐÅÏ¢£º¶þÊÖÊг¡×ßÒ»×ߣ¬¸Ã³öÊÖʱ¾Í³öÊÖ£¡ (http://classad.sina.com.cn/2shou/)
 >>  >
 >>  >-- 
 >>  >Bill Gatliff
 >>  >bgat@billgatliff.com
 >>  >
 >>  >
 >> 
 >> ______________________________________
 >> 
 >> ===================================================================
 >> ÐÂÀËÃâ·Ñµç×ÓÓÊÏä (http://mail.sina.com.cn)
 >> ÐÂÀË·ÖÀàÐÅÏ¢£º¶þÊÖÊг¡×ßÒ»×ߣ¬¸Ã³öÊÖʱ¾Í³öÊÖ£¡ (http://classad.sina.com.cn/2shou/)
 >> ÏÂÔØÐÂÀËÊÖ»úÁåÉùͼƬ ÿÌìÓÐËĴλú»áÖÐ´ó½± (http://sms.sina.com.cn/act/aug.html)
 >> 20ÍòÌìÄϺ£±±Ë§¸çÃÀüµÈÄ㿪ʼ¡°ÐÂÀËÂþÇéÔµ¡±£¡ (http://love.sina.com.cn/)
 >
 >-- 
 >Bill Gatliff
 >bgat@billgatliff.com
 >
 >

______________________________________

===================================================================
ÐÂÀËÃâ·Ñµç×ÓÓÊÏä (http://mail.sina.com.cn)
ÐÂÀË·ÖÀàÐÅÏ¢£º¶þÊÖÊг¡×ßÒ»×ߣ¬¸Ã³öÊÖʱ¾Í³öÊÖ£¡ (http://classad.sina.com.cn/2shou/)
ÏÂÔØÐÂÀËÊÖ»úÁåÉùͼƬ ÿÌìÓÐËĴλú»áÖÐ´ó½± (http://sms.sina.com.cn/act/aug.html)
20ÍòÌìÄϺ£±±Ë§¸çÃÀüµÈÄ㿪ʼ¡°ÐÂÀËÂþÇéÔµ¡±£¡ (http://love.sina.com.cn/)



More information about the Gdb mailing list