* [PATCH] Use -fno-omit-frame-pointer in addition to -g
@ 2008-03-06 15:55 Samuel Thibault
2008-03-06 16:01 ` [PATCH2] Don't optimize function calls with -g Samuel Thibault
0 siblings, 1 reply; 5+ messages in thread
From: Samuel Thibault @ 2008-03-06 15:55 UTC (permalink / raw)
To: xen-devel
Use -fno-omit-frame-pointer in addition to -g
as that permits to use simple stack walk while debugging
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
diff -r fb74347d80c3 Config.mk
--- a/Config.mk Wed Mar 05 12:20:40 2008 +0000
+++ b/Config.mk Thu Mar 06 15:52:14 2008 +0000
@@ -55,7 +55,7 @@ endef
endef
ifeq ($(debug),y)
-CFLAGS += -g
+CFLAGS += -g -fno-omit-frame-pointer
endif
CFLAGS += -fno-strict-aliasing
diff -r fb74347d80c3 extras/mini-os/minios.mk
--- a/extras/mini-os/minios.mk Wed Mar 05 12:20:40 2008 +0000
+++ b/extras/mini-os/minios.mk Thu Mar 06 15:52:14 2008 +0000
@@ -15,7 +15,7 @@ DEF_LDFLAGS =
DEF_LDFLAGS =
ifeq ($(debug),y)
-DEF_CFLAGS += -g
+DEF_CFLAGS += -g -fno-omit-frame-pointer
else
DEF_CFLAGS += -O3
endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH2] Don't optimize function calls with -g
2008-03-06 15:55 [PATCH] Use -fno-omit-frame-pointer in addition to -g Samuel Thibault
@ 2008-03-06 16:01 ` Samuel Thibault
2008-03-07 13:36 ` Keir Fraser
0 siblings, 1 reply; 5+ messages in thread
From: Samuel Thibault @ 2008-03-06 16:01 UTC (permalink / raw)
To: xen-devel
Samuel Thibault, le Thu 06 Mar 2008 15:55:09 +0000, a écrit :
> Use -fno-omit-frame-pointer in addition to -g
> as that permits to use simple stack walk while debugging
Even better:
Don't optimize function calls with -g
-fno-omit-frame-pointer to easily walk the stack
-fno-optimize-sibling-calls to not miss a step
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
diff -r fb74347d80c3 Config.mk
--- a/Config.mk Wed Mar 05 12:20:40 2008 +0000
+++ b/Config.mk Thu Mar 06 15:57:53 2008 +0000
@@ -55,7 +55,7 @@ endef
endef
ifeq ($(debug),y)
-CFLAGS += -g
+CFLAGS += -g -fno-omit-frame-pointer -fno-optimize-sibling-calls
endif
CFLAGS += -fno-strict-aliasing
diff -r fb74347d80c3 extras/mini-os/minios.mk
--- a/extras/mini-os/minios.mk Wed Mar 05 12:20:40 2008 +0000
+++ b/extras/mini-os/minios.mk Thu Mar 06 15:57:53 2008 +0000
@@ -15,7 +15,7 @@ DEF_LDFLAGS =
DEF_LDFLAGS =
ifeq ($(debug),y)
-DEF_CFLAGS += -g
+DEF_CFLAGS += -g -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
DEF_CFLAGS += -O3
endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH2] Don't optimize function calls with -g
2008-03-06 16:01 ` [PATCH2] Don't optimize function calls with -g Samuel Thibault
@ 2008-03-07 13:36 ` Keir Fraser
2008-03-07 14:21 ` Samuel Thibault
2008-03-07 14:58 ` [PATCH3] " Samuel Thibault
0 siblings, 2 replies; 5+ messages in thread
From: Keir Fraser @ 2008-03-07 13:36 UTC (permalink / raw)
To: Samuel Thibault, xen-devel
Should be in config/StdGNU.mk and config/SunOS.mk. Is optimize-sibling-calls
a gcc option that is supported in all our supported gcc versions? Note that
we do CFLAGS ?= ... in StdGNU.mk and SunOS.mk right now. Probably these
should be changed to +=. That still allows extra CFLAGS to be passed in on
the make command line, but avoids the weird subservience of these
debug-related CFLAG additions.
Whether SunOS should really have different usage of omit-frame-pointer is
open to argument. The Sun guys like to have frame pointers always, and it
seems that is basically a general policy across Solaris binaries, so I let
them have that difference.
-- Keir
On 6/3/08 16:01, "Samuel Thibault" <samuel.thibault@eu.citrix.com> wrote:
> Samuel Thibault, le Thu 06 Mar 2008 15:55:09 +0000, a écrit :
>> Use -fno-omit-frame-pointer in addition to -g
>> as that permits to use simple stack walk while debugging
>
> Even better:
>
>
>
> Don't optimize function calls with -g
> -fno-omit-frame-pointer to easily walk the stack
> -fno-optimize-sibling-calls to not miss a step
>
> Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
>
> diff -r fb74347d80c3 Config.mk
> --- a/Config.mk Wed Mar 05 12:20:40 2008 +0000
> +++ b/Config.mk Thu Mar 06 15:57:53 2008 +0000
> @@ -55,7 +55,7 @@ endef
> endef
>
> ifeq ($(debug),y)
> -CFLAGS += -g
> +CFLAGS += -g -fno-omit-frame-pointer -fno-optimize-sibling-calls
> endif
>
> CFLAGS += -fno-strict-aliasing
> diff -r fb74347d80c3 extras/mini-os/minios.mk
> --- a/extras/mini-os/minios.mk Wed Mar 05 12:20:40 2008 +0000
> +++ b/extras/mini-os/minios.mk Thu Mar 06 15:57:53 2008 +0000
> @@ -15,7 +15,7 @@ DEF_LDFLAGS =
> DEF_LDFLAGS =
>
> ifeq ($(debug),y)
> -DEF_CFLAGS += -g
> +DEF_CFLAGS += -g -fno-omit-frame-pointer -fno-optimize-sibling-calls
> else
> DEF_CFLAGS += -O3
> endif
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH2] Don't optimize function calls with -g
2008-03-07 13:36 ` Keir Fraser
@ 2008-03-07 14:21 ` Samuel Thibault
2008-03-07 14:58 ` [PATCH3] " Samuel Thibault
1 sibling, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2008-03-07 14:21 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
Keir Fraser, le Fri 07 Mar 2008 13:36:31 +0000, a écrit :
> Is optimize-sibling-calls a gcc option that is supported in all our
> supported gcc versions?
It is available at least from gcc 3.3
Samuel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH3] Don't optimize function calls with -g
2008-03-07 13:36 ` Keir Fraser
2008-03-07 14:21 ` Samuel Thibault
@ 2008-03-07 14:58 ` Samuel Thibault
1 sibling, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2008-03-07 14:58 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
Keir Fraser, le Fri 07 Mar 2008 13:36:31 +0000, a écrit :
> Note that we do CFLAGS ?= ... in StdGNU.mk and SunOS.mk right
> now. Probably these should be changed to +=.
Ooh, that's why I missed the already existing -fno-omit-frame-pointer
there.
> Whether SunOS should really have different usage of omit-frame-pointer is
> open to argument.
Ok, I'll leave it to people who actually run a SunOS system :)
Don't optimize function calls on GNU systems with debug=y
by enforcing the addition of -fno-omit-frame-pointer, and adding
-fno-optimize-sibling-calls.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
diff -r fb74347d80c3 config/StdGNU.mk
--- a/config/StdGNU.mk Wed Mar 05 12:20:40 2008 +0000
+++ b/config/StdGNU.mk Fri Mar 07 14:54:43 2008 +0000
@@ -45,5 +45,5 @@ CFLAGS ?= -O2 -fomit-frame-pointer
CFLAGS ?= -O2 -fomit-frame-pointer
else
# Less than -O1 produces bad code and large stack frames
-CFLAGS ?= -O1 -fno-omit-frame-pointer
+CFLAGS += -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls
endif
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-03-07 14:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06 15:55 [PATCH] Use -fno-omit-frame-pointer in addition to -g Samuel Thibault
2008-03-06 16:01 ` [PATCH2] Don't optimize function calls with -g Samuel Thibault
2008-03-07 13:36 ` Keir Fraser
2008-03-07 14:21 ` Samuel Thibault
2008-03-07 14:58 ` [PATCH3] " Samuel Thibault
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.