LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: "Robert Cragie" <rcc@j...>
    Date: Thu, 14 Aug 2003 11:31:13 +0100
    Subject: [openrisc] Debugging application
    Top

    I have got GDB running with my target OK now - all I needed to do was put a
    breakpoint() call in at cyg_start, thanks for that, Gary. I can single step
    OK but I cannot inspect data properly for some reason.
    
    The versions of the debugger and the compiler are as follows:
    
    GNU gdb 5.0
    Copyright 2000 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "--host=i686-pc-linux-gnu --target=or32-elf".
    
    or32-elf-gcc (GCC) 3.2.3
    Copyright (C) 2002 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    The application was compiled with:
    
    or32-elf-gcc -g -I../include hello.c -L../lib -o hello -Ttarget.ld -nostdlib
    
    I get the following:
    
    569         HAL_BREAKPOINT(_breakinst);
    (gdb) step
    Sending packet: $Hc0#db...Ack
    Packet received:
    Sending packet: $s#73...Ack
    Packet received: T0540:000063ec;01:000093dc;
    Sending packet: $s#73...Ack
    Packet received: T0540:000013fc;01:000093e0;
    Sending packet: $g#67...Ack
    Packet received:
    000093dc000093e0000000ff000000ff9100001400000002000083fc00000001000000010000
    13fc000000000000000000000000000000000000000000000000000000000000000000000000
    0000000000000000000000000000000000000000000000000000000000000000000000000000
    0000000000000000000000000000000013fc00008201
    cyg_start () at hello.c:72
    72              ulMask = 1;
    (gdb) step
    Sending packet: $s#73...Ack
    Packet received: T0540:00001400;01:000093e0;
    Sending packet: $s#73...Ack
    Packet received: T0540:00001404;01:000093e0;
    Sending packet: $g#67...Ack
    Packet received:
    000093dc000093e0000000ff000000019100001400000002000083fc00000001000000010000
    13fc000000000000000000000000000000000000000000000000000000000000000000000000
    0000000000000000000000000000000000000000000000000000000000000000000000000000
    00000000000000000000000000000000140400008201
    73              for (ulOffset = 0; ulOffset <= 5; ulOffset++)
    (gdb) print ulMask
    Sending packet: $mcf,4#96...Ack
    Packet received: 00000000
    $1 = 0
    (gdb) print my_data
    Address of symbol "my_data" is unknown.
    (gdb) print _my_data
    Sending packet: $m835c,4#d0...Ack
    Packet received: 00000002
    $2 = 2
    (gdb)
    
    Code snippet:
    
    int my_data = 2;
    void cyg_start(void)
    {
        unsigned long ulMask;
    
        breakpoint();
    
        for(;;)
        {
            ulMask = 1;
    [snip]
    
    So the data in the auto variable 'ulMask' should be 1 and is being reported
    as '0', it cannot find the address of 'my_data' but correctly reports the
    contents if I specify it as '_my_data' as it appears in the symbol table.
    
    Is it possible that there is an incompatibility with GCC 3.2.3 and GDB 5.0?
    GDB 5.0 is rather old now. If so, do I need to try to use a later version of
    GDB with OpenRISC additions?
    
    I'd appreciate any help on this matter.
    
    Robert Cragie, Design Engineer
    _______________________________________________________________
    Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
    http://www.jennic.com  Tel: +44 (0) 114 281 2655
    _______________________________________________________________
    
    
    
    

    Follow upAuthor
    Re: [openrisc] Debugging applicationScott Furman

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.