Bertrik Sikken | 29 May 2012 18:20
Picon
Favicon

Default compilation with -g?

Hi all,

While debugging a problem using our shiny new ARM backtrace feature,
I noticed that by default, we're not building with -g (= include
debugging information in the binary). This means that with the
default build, I can't get the source code line from the backtrace
addresses (with arm-elf-eabi-addr2line)

How about enabling option -g by default?

I don't think it adds anything to the binary that runs on the
targets, but perhaps a bit to the intermediate results on the
build clients.

With kind regards,
Bertrik

Rafaël Carré | 29 May 2012 18:34
Favicon

Re: Default compilation with -g?

Le 29/05/2012 12:20, Bertrik Sikken a écrit :
> Hi all,
> 
> While debugging a problem using our shiny new ARM backtrace feature,
> I noticed that by default, we're not building with -g (= include
> debugging information in the binary). This means that with the
> default build, I can't get the source code line from the backtrace
> addresses (with arm-elf-eabi-addr2line)
> 
> How about enabling option -g by default?
> 
> I don't think it adds anything to the binary that runs on the
> targets, but perhaps a bit to the intermediate results on the
> build clients.
> 
> With kind regards,
> Bertrik

I made a comparison with and without -g (with ccache disabled for that
test).

rockbox.sansa is identical in both cases

Without -g:

make -j8  293,60s user 17,61s system 690% cpu 45,075 total
$ du -chs .
34M	.

With -g:
(Continue reading)

Thomas Martitz | 29 May 2012 23:30
Favicon
Gravatar

Re: Default compilation with -g?

Am 29.05.2012 18:34, schrieb Rafaël Carré:
> Without -g:
>
> make -j8  293,60s user 17,61s system 690% cpu 45,075 total
> $ du -chs .
> 34M	.
>
> With -g:
> make -j8  321,22s user 19,88s system 688% cpu 49,556 total
> $ du -chs .
> 99M	.

My SSD will not like this :'( I'm also suprised compile time is impacted 
negatively. Good idea otherwise.

Best regards.

Frank Gevaerts | 29 May 2012 20:49
Picon

Re: Default compilation with -g?

On Tue, May 29, 2012 at 06:20:48PM +0200, Bertrik Sikken wrote:
> How about enabling option -g by default?

I'm in favour.

Frank

--

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

Michael Sparmann | 29 May 2012 22:22
Picon

Re: Default compilation with -g?

Am 29.05.2012 20:49, schrieb Frank Gevaerts:
> On Tue, May 29, 2012 at 06:20:48PM +0200, Bertrik Sikken wrote:
>> How about enabling option -g by default?
> 
> I'm in favour.
> 
> Frank
> 

+1


Gmane