diff mbox

[U-Boot,v2] Adds general Freescale external debugger support

Message ID 1296381492-31346-1-git-send-email-tie-fei.zang@freescale.com
State Superseded, archived
Headers show

Commit Message

Zang Roy-R61911 Jan. 30, 2011, 9:58 a.m. UTC
This patch adds general Freescale powerpc external debugger support.
Patch is tested on 85xx/QorIQ platforms in u-boot with CodeWarrior.
CONFIG_EXT_DEBUGGER should be defined if the u-boot needs to be
debugged by external debugger.
To use the  external debug funciton, the make command can be just as
make CONFIG_EXT_DEBUGGER=1
or define CONFIG_EXT_DEBUGGER in the board header file.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
---
Consider the comment from Wolfgang Denk
http://lists.denx.de/pipermail/u-boot/2010-October/080689.html

 README                 |    4 ++++
 arch/powerpc/config.mk |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

Comments

Wolfgang Denk Jan. 30, 2011, 7:43 p.m. UTC | #1
Dear Roy Zang,

In message <1296381492-31346-1-git-send-email-tie-fei.zang@freescale.com> you wrote:
> This patch adds general Freescale powerpc external debugger support.
> Patch is tested on 85xx/QorIQ platforms in u-boot with CodeWarrior.
> CONFIG_EXT_DEBUGGER should be defined if the u-boot needs to be
> debugged by external debugger.
> To use the  external debug funciton, the make command can be just as
> make CONFIG_EXT_DEBUGGER=1
> or define CONFIG_EXT_DEBUGGER in the board header file.

How exactly do you define "external debugger"?  Does that mean that
there is an "internal debugger"?  Are you thinking of "bedbug" here?

And in which way is this specific to "Freescale external debuggers"
as you describe it in the Subject?

I don't see where this is specific to the Power architecture either -
expect that you only tested it there.

My understanding is that you enable debug settings for the GNU
debugger.

Do these need to be architecture specific? Probably not.

Do these need to be enabled by a new #define?  What would be the
disadvantages of having these options always enabled, for all
architectures?


Best regards,

Wolfgang Denk
Michael Schwingen Jan. 30, 2011, 10:50 p.m. UTC | #2
Am 01/30/2011 08:43 PM, schrieb Wolfgang Denk:
>
> I don't see where this is specific to the Power architecture either -
> expect that you only tested it there.
>
> My understanding is that you enable debug settings for the GNU
> debugger.
>
> Do these need to be architecture specific? Probably not.
I do remember that we needed architecture-dependent debug options on a
system I worked on in the past, because the preferred debug format was
different on different platforms (all using gcc/binutils/gdb).

> Do these need to be enabled by a new #define?  What would be the
> disadvantages of having these options always enabled, for all
> architectures?
Always having debug info in the ELF file should not cause problems IMHO,
and one set of settings per platform should be enough.

cu
Michael
Wolfgang Denk Jan. 31, 2011, 10:43 a.m. UTC | #3
Dear Michael Schwingen,

In message <4D45EB1D.4020104@discworld.dascon.de> you wrote:
>
> > Do these need to be architecture specific? Probably not.
> I do remember that we needed architecture-dependent debug options on a
> system I worked on in the past, because the preferred debug format was
> different on different platforms (all using gcc/binutils/gdb).

Can you please be a bit more specific here?


Best regards,

Wolfgang Denk
Michael Schwingen Jan. 31, 2011, 11:17 a.m. UTC | #4
Wolfgang Denk wrote:
> Dear Michael Schwingen,
>
> In message <4D45EB1D.4020104@discworld.dascon.de> you wrote:
>   
>>> Do these need to be architecture specific? Probably not.
>>>       
>> I do remember that we needed architecture-dependent debug options on a
>> system I worked on in the past, because the preferred debug format was
>> different on different platforms (all using gcc/binutils/gdb).
>>     
>
> Can you please be a bit more specific here?
>   
I can only tell from memory, since this was some years ago - IIRC, we 
needed dwarf debug info on some platforms and stabs on others. I can't 
provide exact details, since the current toolchains work fine without 
such tweaking - I only wanted to point out that if you need to specify 
the exact debug format, then it might be platform-specific.

A simple "-g" should be fine in the common area.

cu
Michael
Zang Roy-R61911 March 7, 2011, 7:18 a.m. UTC | #5
> -----Original Message-----
> From: Michael Schwingen [mailto:rincewind@discworld.dascon.de]
> Sent: Monday, January 31, 2011 6:50 AM
> To: Wolfgang Denk
> Cc: Zang Roy-R61911; u-boot@lists.denx.de; Kumar Gala; Wood Scott-B07421
> Subject: Re: [U-Boot] [PATCH v2] Adds general Freescale external debugger
> support
> 
[snip]

> > Do these need to be enabled by a new #define?  What would be the
> > disadvantages of having these options always enabled, for all
> > architectures?
> Always having debug info in the ELF file should not cause problems IMHO,
> and one set of settings per platform should be enough.
Including the debug information, size should be consideration.
Roy
Zang Roy-R61911 March 7, 2011, 7:24 a.m. UTC | #6
> -----Original Message-----
> From: Michael Schwingen [mailto:rincewind@discworld.dascon.de]
> Sent: Monday, January 31, 2011 19:18 PM
> To: Wolfgang Denk
> Cc: Zang Roy-R61911; u-boot@lists.denx.de; Kumar Gala; Wood Scott-B07421
> Subject: Re: [U-Boot] [PATCH v2] Adds general Freescale external debugger
> support
> 
> Wolfgang Denk wrote:
> > Dear Michael Schwingen,
> >
> > In message <4D45EB1D.4020104@discworld.dascon.de> you wrote:
> >
> >>> Do these need to be architecture specific? Probably not.
> >>>
> >> I do remember that we needed architecture-dependent debug options on a
> >> system I worked on in the past, because the preferred debug format was
> >> different on different platforms (all using gcc/binutils/gdb).
> >>
> >
> > Can you please be a bit more specific here?
> >
> I can only tell from memory, since this was some years ago - IIRC, we
> needed dwarf debug info on some platforms and stabs on others. I can't
> provide exact details, since the current toolchains work fine without
> such tweaking - I only wanted to point out that if you need to specify
> the exact debug format, then it might be platform-specific.
> 
> A simple "-g" should be fine in the common area.
Hi, Wolfgang
Considering the name, how about 
CONFIG_POWERPC_GNU_DEBUGGER?
thanks.
Roy
Scott Wood March 7, 2011, 7:05 p.m. UTC | #7
On Mon, 7 Mar 2011 01:18:28 -0600
Zang Roy-R61911 <R61911@freescale.com> wrote:

> 
> 
> > -----Original Message-----
> > From: Michael Schwingen [mailto:rincewind@discworld.dascon.de]
> > Sent: Monday, January 31, 2011 6:50 AM
> > To: Wolfgang Denk
> > Cc: Zang Roy-R61911; u-boot@lists.denx.de; Kumar Gala; Wood Scott-B07421
> > Subject: Re: [U-Boot] [PATCH v2] Adds general Freescale external debugger
> > support
> > 
> [snip]
> 
> > > Do these need to be enabled by a new #define?  What would be the
> > > disadvantages of having these options always enabled, for all
> > > architectures?
> > Always having debug info in the ELF file should not cause problems IMHO,
> > and one set of settings per platform should be enough.
> Including the debug information, size should be consideration.

It doesn't get included in the .bin which is flashed on the target --
you're worried about the developer's hard disk being too small?

-Scott
diff mbox

Patch

diff --git a/README b/README
index 755d17c..6162fa6 100644
--- a/README
+++ b/README
@@ -2885,6 +2885,10 @@  Low Level (hardware related) configuration options:
 		that is executed before the actual U-Boot. E.g. when
 		compiling a NAND SPL.
 
+- CONFIG_EXT_DEBUGGER
+		Adds external debugger support. Extra build option will be
+		added to support external debugger.
+
 Building the Software:
 ======================
 
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index 2912604..9af9647 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -53,3 +53,6 @@  endif
 ifeq ($(CROSS_COMPILE),powerpc-openbsd-)
 PLATFORM_CPPFLAGS+= -D__PPC__
 endif
+ifdef CONFIG_EXT_DEBUGGER
+PLATFORM_CPPFLAGS+= -ggdb -Wa,-gdwarf2
+endif