* [PATCH iproute2] Enable use of extra debugging information
@ 2016-06-21 23:27 David Ahern
2016-06-22 8:36 ` Jakub Sitnicki
2016-06-27 17:52 ` Stephen Hemminger
0 siblings, 2 replies; 4+ messages in thread
From: David Ahern @ 2016-06-21 23:27 UTC (permalink / raw)
To: netdev; +Cc: stephen, David Ahern
Add -g flag to builds if DEBUG parameter is set. Improves
debugging with gdb.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Makefile b/Makefile
index 15c81ecfdca3..8e006759079d 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,11 @@ HOSTCC = gcc
DEFINES += -D_GNU_SOURCE
# Turn on transparent support for LFS
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+ifdef DEBUG
+CCOPTS = -g
+else
CCOPTS = -O2
+endif
WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] Enable use of extra debugging information
2016-06-21 23:27 [PATCH iproute2] Enable use of extra debugging information David Ahern
@ 2016-06-22 8:36 ` Jakub Sitnicki
2016-06-22 16:55 ` David Ahern
2016-06-27 17:52 ` Stephen Hemminger
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Sitnicki @ 2016-06-22 8:36 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, stephen
Hi David,
On Wed, Jun 22, 2016 at 01:27 AM CEST, David Ahern <dsa@cumulusnetworks.com> wrote:
> Add -g flag to builds if DEBUG parameter is set. Improves
> debugging with gdb.
>
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
> ---
> Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 15c81ecfdca3..8e006759079d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -39,7 +39,11 @@ HOSTCC = gcc
> DEFINES += -D_GNU_SOURCE
> # Turn on transparent support for LFS
> DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> +ifdef DEBUG
> +CCOPTS = -g
> +else
> CCOPTS = -O2
> +endif
> WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
> WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
This implies a change of optimization level to -O0 when building with
DEBUG set, doesn't it? Was it intentional?
Perhaps it would be less surprising to explicitly set -O0, if that was
your intention. Just a thought.
Thanks,
Jakub
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] Enable use of extra debugging information
2016-06-22 8:36 ` Jakub Sitnicki
@ 2016-06-22 16:55 ` David Ahern
0 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2016-06-22 16:55 UTC (permalink / raw)
To: Jakub Sitnicki; +Cc: netdev, stephen
On 6/22/16 2:36 AM, Jakub Sitnicki wrote:
>> diff --git a/Makefile b/Makefile
>> index 15c81ecfdca3..8e006759079d 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -39,7 +39,11 @@ HOSTCC = gcc
>> DEFINES += -D_GNU_SOURCE
>> # Turn on transparent support for LFS
>> DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
>> +ifdef DEBUG
>> +CCOPTS = -g
>> +else
>> CCOPTS = -O2
>> +endif
>> WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
>> WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
>
> This implies a change of optimization level to -O0 when building with
> DEBUG set, doesn't it? Was it intentional?
yes it is intentional.
> Perhaps it would be less surprising to explicitly set -O0, if that was
> your intention. Just a thought.
>
> Thanks,
> Jakub
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] Enable use of extra debugging information
2016-06-21 23:27 [PATCH iproute2] Enable use of extra debugging information David Ahern
2016-06-22 8:36 ` Jakub Sitnicki
@ 2016-06-27 17:52 ` Stephen Hemminger
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2016-06-27 17:52 UTC (permalink / raw)
To: David Ahern; +Cc: netdev
On Tue, 21 Jun 2016 16:27:09 -0700
David Ahern <dsa@cumulusnetworks.com> wrote:
> Add -g flag to builds if DEBUG parameter is set. Improves
> debugging with gdb.
>
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
I would rather not put this in the upstream repo.
Developers are free to modify flags as they see fit when debugging.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-27 17:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 23:27 [PATCH iproute2] Enable use of extra debugging information David Ahern
2016-06-22 8:36 ` Jakub Sitnicki
2016-06-22 16:55 ` David Ahern
2016-06-27 17:52 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.