public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Trying to Debug Ecos using GDB
@ 2006-04-12 20:40 Fahd Abidi
  2006-04-12 20:45 ` Andrew Lunn
  2006-04-12 21:58 ` Grant Edwards
  0 siblings, 2 replies; 11+ messages in thread
From: Fahd Abidi @ 2006-04-12 20:40 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

I'm trying to create a test case where I will use a BDI2000 JTAG
emulator to debug the ecos kernel, for that I need an image that has all
the symbols built in. I will then strip the executable to create an
image that does not have any debug symbols to load onto the target, that
way I can debug the kernel thru a JTAG probe. The larger image with
debug symbols is used only on the host GDB and the stipped executable
sits on the target.

Is this possible? Is there any way to tell the linker to leave the debug
symbols in place?

Thanks,

Fahd
 


-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Andrew Lunn
Sent: Wednesday, April 12, 2006 4:30 PM
To: Fahd Abidi
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Trying to Debug Ecos using GDB


On Wed, Apr 12, 2006 at 04:23:48PM -0400, Fahd Abidi wrote:
> Thank you very much for that tip. I used an example hello world 
> application and linked it to ecos and have an executable image that 
> can be opened with GDB.
> 
> But now it seems like the executable image only has the symbols built 
> in for my hello.c program and no other kernel source files are 
> present. How can I build the application + library so that debug 
> information for the entire kernel is also present?

Why would you want to do that? 

eCos is designed for embedded systems where memory is short. So linking
to the application leaves out everything that is not used.

        Andrew

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




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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Trying to Debug Ecos using GDB
  2006-04-12 20:40 [ECOS] Trying to Debug Ecos using GDB Fahd Abidi
@ 2006-04-12 20:45 ` Andrew Lunn
  2006-04-12 21:59   ` [ECOS] " Grant Edwards
  2006-04-12 21:58 ` Grant Edwards
  1 sibling, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2006-04-12 20:45 UTC (permalink / raw)
  To: Fahd Abidi; +Cc: ecos-discuss

On Wed, Apr 12, 2006 at 04:46:21PM -0400, Fahd Abidi wrote:
> I'm trying to create a test case where I will use a BDI2000 JTAG
> emulator to debug the ecos kernel, for that I need an image that has all
> the symbols built in. I will then strip the executable to create an
> image that does not have any debug symbols to load onto the target, that
> way I can debug the kernel thru a JTAG probe. The larger image with
> debug symbols is used only on the host GDB and the stipped executable
> sits on the target.
> 
> Is this possible? Is there any way to tell the linker to leave the debug
> symbols in place?

After linking with the application to form an image The debug symbols
will be in place, but just symbols you need. The debug information for
symbols that are not in the image will not be in the image.

There is also no need to strip the image before loading it onto the
target. Your BDI2000 will be able to parse the elf image and download
only what is needed onto the target, ie it won't download the debug
information.

        Andrew

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ECOS] Re: Trying to Debug Ecos using GDB
  2006-04-12 20:40 [ECOS] Trying to Debug Ecos using GDB Fahd Abidi
  2006-04-12 20:45 ` Andrew Lunn
@ 2006-04-12 21:58 ` Grant Edwards
  1 sibling, 0 replies; 11+ messages in thread
From: Grant Edwards @ 2006-04-12 21:58 UTC (permalink / raw)
  To: ecos-discuss

In gmane.os.ecos.general, you wrote:

> I'm trying to create a test case where I will use a BDI2000 JTAG
> emulator to debug the ecos kernel, for that I need an image that has all
> the symbols built in.

You just have to change the compile flags somewhere.

> I will then strip the executable to create an image that does
> not have any debug symbols to load onto the target,

You don't need to do that.  The debug symbols don't take up
target memory.

> that way I can debug the kernel thru a JTAG probe. The larger
> image with debug symbols is used only on the host GDB and the
> stipped executable sits on the target.

If you're running from RAM, all you have to do is connect via
the JTAG port and load the program using GDB.  GDB will "strip"
the image as it's being loaded into target memory.

> Is this possible? Is there any way to tell the linker to leave
> the debug symbols in place?

IIRC, the trick was to get them there in the first place, but
I may be remembering incorrectly.

-- 
Grant Edwards                   grante             Yow!  .. If I cover this
                                  at               entire WALL with MAZOLA,
                               visi.com            wdo I have to give my AGENT
                                                   ten per cent??

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ECOS] Re: Trying to Debug Ecos using GDB
  2006-04-12 20:45 ` Andrew Lunn
@ 2006-04-12 21:59   ` Grant Edwards
  0 siblings, 0 replies; 11+ messages in thread
From: Grant Edwards @ 2006-04-12 21:59 UTC (permalink / raw)
  To: ecos-discuss

In gmane.os.ecos.general, you wrote:
> On Wed, Apr 12, 2006 at 04:46:21PM -0400, Fahd Abidi wrote:
>> I'm trying to create a test case where I will use a BDI2000 JTAG
>> emulator to debug the ecos kernel, for that I need an image that has all
>> the symbols built in. I will then strip the executable to create an
>> image that does not have any debug symbols to load onto the target, that
>> way I can debug the kernel thru a JTAG probe. The larger image with
>> debug symbols is used only on the host GDB and the stipped executable
>> sits on the target.
>> 
>> Is this possible? Is there any way to tell the linker to leave the debug
>> symbols in place?
>
> After linking with the application to form an image The debug symbols
> will be in place, but just symbols you need. The debug information for
> symbols that are not in the image will not be in the image.

Is the kernel built with debug symbols enabled?  I recall
having to tweak on something to get that enabled.

-- 
Grant Edwards                   grante             Yow!  Do you guys know we
                                  at               just passed thru a BLACK
                               visi.com            HOLE in space?

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Trying to Debug Ecos using GDB
  2006-04-12 20:59 [ECOS] " Fahd Abidi
@ 2006-04-12 21:11 ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2006-04-12 21:11 UTC (permalink / raw)
  To: Fahd Abidi; +Cc: ecos-discuss

On Wed, Apr 12, 2006 at 05:05:17PM -0400, Fahd Abidi wrote:
> So you're saying that I won't be able to build an executable that
> contains symbol information from the ecos kernel? Just the symbol
> information from the application that I created?

The symbols for the parts of eCos you use will be include in the final
image. So if you use parts of the kernel, the debug symbols for those
parts will be included.
 
> In other words the debug symbols from the libtarget.a library will not
> get carried over into hello.o during linking?

I think you mean hello.elf or how ever you can it. It will not be
hello.o since that is the object code for hello.c. 

As i keep saying, the debug symbols for the parts of eCos you use will
be in the final image.

        Andrew

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [ECOS] Trying to Debug Ecos using GDB
@ 2006-04-12 20:59 Fahd Abidi
  2006-04-12 21:11 ` Andrew Lunn
  0 siblings, 1 reply; 11+ messages in thread
From: Fahd Abidi @ 2006-04-12 20:59 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

So you're saying that I won't be able to build an executable that
contains symbol information from the ecos kernel? Just the symbol
information from the application that I created?

In other words the debug symbols from the libtarget.a library will not
get carried over into hello.o during linking?

Thanks,

Fahd
 


-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Andrew Lunn
Sent: Wednesday, April 12, 2006 5:00 PM
To: Fahd Abidi
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Trying to Debug Ecos using GDB


On Wed, Apr 12, 2006 at 04:46:21PM -0400, Fahd Abidi wrote:
> I'm trying to create a test case where I will use a BDI2000 JTAG 
> emulator to debug the ecos kernel, for that I need an image that has 
> all the symbols built in. I will then strip the executable to create 
> an image that does not have any debug symbols to load onto the target,

> that way I can debug the kernel thru a JTAG probe. The larger image 
> with debug symbols is used only on the host GDB and the stipped 
> executable sits on the target.
> 
> Is this possible? Is there any way to tell the linker to leave the 
> debug symbols in place?

After linking with the application to form an image The debug symbols
will be in place, but just symbols you need. The debug information for
symbols that are not in the image will not be in the image.

There is also no need to strip the image before loading it onto the
target. Your BDI2000 will be able to parse the elf image and download
only what is needed onto the target, ie it won't download the debug
information.

        Andrew

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




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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Trying to Debug Ecos using GDB
  2006-04-12 20:18 Fahd Abidi
@ 2006-04-12 20:20 ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2006-04-12 20:20 UTC (permalink / raw)
  To: Fahd Abidi; +Cc: ecos-discuss

On Wed, Apr 12, 2006 at 04:23:48PM -0400, Fahd Abidi wrote:
> Thank you very much for that tip. I used an example hello world
> application and linked it to ecos and have an executable image that can
> be opened with GDB.
> 
> But now it seems like the executable image only has the symbols built in
> for my hello.c program and no other kernel source files are present. How
> can I build the application + library so that debug information for the
> entire kernel is also present?

Why would you want to do that? 

eCos is designed for embedded systems where memory is short. So
linking to the application leaves out everything that is not used.

        Andrew

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [ECOS] Trying to Debug Ecos using GDB
@ 2006-04-12 20:18 Fahd Abidi
  2006-04-12 20:20 ` Andrew Lunn
  0 siblings, 1 reply; 11+ messages in thread
From: Fahd Abidi @ 2006-04-12 20:18 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Thank you very much for that tip. I used an example hello world
application and linked it to ecos and have an executable image that can
be opened with GDB.

But now it seems like the executable image only has the symbols built in
for my hello.c program and no other kernel source files are present. How
can I build the application + library so that debug information for the
entire kernel is also present?

The resulting executable is only 2mb in size, the library with symbols
was 17mb, so obviously during the linking process all the debug symbols
got removed from the ecos kernel.

Thanks,

Fahd
 


-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Andrew Lunn
Sent: Wednesday, April 12, 2006 3:00 PM
To: Fahd Abidi
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Trying to Debug Ecos using GDB


On Wed, Apr 12, 2006 at 01:39:24PM -0400, Fahd Abidi wrote:
> Hello,
> 
> I am using a BDI2000 JTAG emulator and am trying to debug the ecos 
> kernel at its startup and low level functions. I am getting stuck and 
> a very early point In the process, the Kernel Builds fine using the 
> cygwin based tools I got from ecos.sourceware.org and I have a 
> libtarget.a file created that has debug symbols in it. However I have 
> been unable to read the debug symbols from the file into gdb.
> 
> Using objdup -g to display the debug info says that the .o files 
> included have no recognized debugging info.
> 
> However using objdump-S shows that I do have source code intermixed 
> with the disassembly so it does find source code and hence must have 
> the debug info built in.
> 
> Using objcopy to strip the debug symbols takes the 16mb libtarget.a 
> file to 1.7mb so I am convinced the debug symbols are in the file.
> 
> If I try and open libtarget.a with GDB6.3&4 I get an error saying 
> "error not in executable format".

This is correct. libtarget.a is a library, not an application. 

You need to link the library to your application to form a complete
system image. Then boot that image.

        Andrew

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




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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Trying to Debug Ecos using GDB
  2006-04-12 17:33 Fahd Abidi
  2006-04-12 18:17 ` oli
@ 2006-04-12 18:49 ` Andrew Lunn
  1 sibling, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2006-04-12 18:49 UTC (permalink / raw)
  To: Fahd Abidi; +Cc: ecos-discuss

On Wed, Apr 12, 2006 at 01:39:24PM -0400, Fahd Abidi wrote:
> Hello,
> 
> I am using a BDI2000 JTAG emulator and am trying to debug the ecos
> kernel at its startup and low level functions. I am getting stuck and a
> very early point In the process, the Kernel Builds fine using the cygwin
> based tools I got from ecos.sourceware.org and I have a libtarget.a file
> created that has debug symbols in it. However I have been unable to read
> the debug symbols from the file into gdb.
> 
> Using objdup -g to display the debug info says that the .o files
> included have no recognized debugging info.
> 
> However using objdump-S shows that I do have source code intermixed with
> the disassembly so it does find source code and hence must have the
> debug info built in.
> 
> Using objcopy to strip the debug symbols takes the 16mb libtarget.a file
> to 1.7mb so I am convinced the debug symbols are in the file.
> 
> If I try and open libtarget.a with GDB6.3&4 I get an error saying "error
> not in executable format".

This is correct. libtarget.a is a library, not an application. 

You need to link the library to your application to form a complete
system image. Then boot that image.

        Andrew

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Trying to Debug Ecos using GDB
  2006-04-12 17:33 Fahd Abidi
@ 2006-04-12 18:17 ` oli
  2006-04-12 18:49 ` Andrew Lunn
  1 sibling, 0 replies; 11+ messages in thread
From: oli @ 2006-04-12 18:17 UTC (permalink / raw)
  To: Fahd Abidi; +Cc: ecos-discuss

For me it works like this:

cygwin> arm-elf-gdb test.elf
gdb> target remote IP_OF_BDI2k:2001

The informations are in the .elf file...

Oliver


Fahd Abidi schrieb:
> Hello,
>
> I am using a BDI2000 JTAG emulator and am trying to debug the ecos
> kernel at its startup and low level functions. I am getting stuck and a
> very early point In the process, the Kernel Builds fine using the cygwin
> based tools I got from ecos.sourceware.org and I have a libtarget.a file
> created that has debug symbols in it. However I have been unable to read
> the debug symbols from the file into gdb.
>
> Using objdup -g to display the debug info says that the .o files
> included have no recognized debugging info.
>
> However using objdump-S shows that I do have source code intermixed with
> the disassembly so it does find source code and hence must have the
> debug info built in.
>
> Using objcopy to strip the debug symbols takes the 16mb libtarget.a file
> to 1.7mb so I am convinced the debug symbols are in the file.
>
> If I try and open libtarget.a with GDB6.3&4 I get an error saying "error
> not in executable format".
>
> I am a newbie to ecos so maybe I am not clear on how to get to opening
> and viewing the kernel and its code in GDB. Any tips and assistance
> would be greatly appreciated.
>
> Fahd
>  
>
>   

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ECOS] Trying to Debug Ecos using GDB
@ 2006-04-12 17:33 Fahd Abidi
  2006-04-12 18:17 ` oli
  2006-04-12 18:49 ` Andrew Lunn
  0 siblings, 2 replies; 11+ messages in thread
From: Fahd Abidi @ 2006-04-12 17:33 UTC (permalink / raw)
  To: ecos-discuss

Hello,

I am using a BDI2000 JTAG emulator and am trying to debug the ecos
kernel at its startup and low level functions. I am getting stuck and a
very early point In the process, the Kernel Builds fine using the cygwin
based tools I got from ecos.sourceware.org and I have a libtarget.a file
created that has debug symbols in it. However I have been unable to read
the debug symbols from the file into gdb.

Using objdup -g to display the debug info says that the .o files
included have no recognized debugging info.

However using objdump-S shows that I do have source code intermixed with
the disassembly so it does find source code and hence must have the
debug info built in.

Using objcopy to strip the debug symbols takes the 16mb libtarget.a file
to 1.7mb so I am convinced the debug symbols are in the file.

If I try and open libtarget.a with GDB6.3&4 I get an error saying "error
not in executable format".

I am a newbie to ecos so maybe I am not clear on how to get to opening
and viewing the kernel and its code in GDB. Any tips and assistance
would be greatly appreciated.

Fahd
 

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-04-12 21:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-12 20:40 [ECOS] Trying to Debug Ecos using GDB Fahd Abidi
2006-04-12 20:45 ` Andrew Lunn
2006-04-12 21:59   ` [ECOS] " Grant Edwards
2006-04-12 21:58 ` Grant Edwards
  -- strict thread matches above, loose matches on Subject: below --
2006-04-12 20:59 [ECOS] " Fahd Abidi
2006-04-12 21:11 ` Andrew Lunn
2006-04-12 20:18 Fahd Abidi
2006-04-12 20:20 ` Andrew Lunn
2006-04-12 17:33 Fahd Abidi
2006-04-12 18:17 ` oli
2006-04-12 18:49 ` Andrew Lunn

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).