public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: "Jérémy Alles" <jeremy.alles@orange-ftgroup.com>
Cc: 'eCos Discussion' <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Configuring an eCos application to debug it using GDB
Date: Thu, 27 Mar 2008 14:02:00 -0000	[thread overview]
Message-ID: <47EB8F63.50609@mlbassoc.com> (raw)
In-Reply-To: <200803270827.m2R8Rp2U005231@smtp.silicomp.fr>

Jérémy Alles wrote:
> Hi,
>  
> 	I'm trying to configure properly my eCos application in order to
> debug it using GDB (over Ethernet). I'm using an AT91 based development kit
> with Redboot already flashed on it (by someone else in my company). My board
> has IP 192.168.1.20, and I can successfully connect to it from arm-elf-gdb.
>     
> 	The problem is I think that I'm missing something in my
> configuration (ecos.ecc), as when my application starts, it returns 54321
> and not something like $O3534313231#56+. That is why I think i'm doing
> something wrong.

Where/when did you get this?

If you load and run your application directly from RedBoot, then when
you print (via diag_printf()) to the console, the mangling is disabled
and you'll see the actual string.

If you load and start your application via GDB (even if it's RedBoot
providing the GDB support), then mangling is enabled and the strings
are sent through the GDB protocol.  Only if you somehow got eCos
confused and it thought there was a GDB agent on the console would
you ever see the $O..#.. line.

> 
> jalles@jalles1475:~/local_repository/drivers/led$ arm-elf-gdb
> GNU gdb 5.3 (eCosCentric)
> Copyright 2002 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=arm-elf".
> (gdb) target remote 192.168.1.20:9000
> Remote debugging using 192.168.1.20:9000
> 0x10027580 in ?? ()
> (gdb) load main.elf
> Loading section .rom_vectors, size 0x40 lma 0x20040000
> Loading section .text, size 0x6948 lma 0x20040040
> Loading section .rodata, size 0x284 lma 0x20046988
> Loading section .data, size 0x6cc lma 0x20046c0c
> Start address 0x20040040, load size 29400
> Transfer rate: 235200 bits/sec, 294 bytes/write.
> (gdb) c
> Continuing.
> 
> 	Moreover, if I want to use a break point, the load command is not
> enough:
> 
> (gdb) load main.elf
> Loading section .rom_vectors, size 0x40 lma 0x20040000
> Loading section .text, size 0x7f07c lma 0x20040040
> Loading section .rodata, size 0x4f5d4 lma 0x200bf0bc
> Loading section .data, size 0x5264 lma 0x2010e690
> Start address 0x20040040, load size 866548
> Transfer rate: 407787 bits/sec, 299 bytes/write.
> (gdb) b main
> No symbol table is loaded.  Use the "file" command.
> 
> 	Whereas I build my application using the -g option... Any idea ?

You've not told GDB about the symbols.  It's much better to
start GDB like this:

   $ arm-elf-gdb main.elf
   (gdb) target remote XYZ:9000
   (gdb) load
   (gdb) b main
   (gdb) cont


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  parent reply	other threads:[~2008-03-27 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27  8:45 Jérémy Alles
2008-03-27  9:02 ` Andrew Lunn
2008-03-27 14:02 ` Gary Thomas [this message]
2008-03-27 14:55   ` Jérémy Alles
2008-03-27 15:27     ` Gary Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47EB8F63.50609@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=jeremy.alles@orange-ftgroup.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).