This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [SH][PATCH] Disable ABI frame sniffer
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 10 Nov 2005 06:41:37 +0200
- Subject: Re: [SH][PATCH] Disable ABI frame sniffer
- References: <43722DEF.8060300@st.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Wed, 09 Nov 2005 17:12:15 +0000
> From: Andrew STUBBS <andrew.stubbs@st.com>
>
> It is useful to disable this sniffer because it has an irritating habit
> of causing (non-fatal) errors when it runs out of frames. Specifically
> it often says 'Previous frame identical to this frame (corrupt stack?)'.
>
> This message is worrying if you do not know what it means, but it is
> normally easily ignored. Unfortunately, the problem is more serious when
> used in conjunction with 'thread apply' as the first error kills the
> output from the rest of the threads. This command is used by some GUIs
> to populate their displays.
I think this explanation should be in the manual, because it explains
very clearly when this command is useful.
> + add_setshow_boolean_cmd ("abi-sniffer", class_obscure,
> + &backtrace_abi_sniffer, "\
> +Set whether backtraces should use the ABI where there is no debug info.", "\
> +Show whether backtraces should use the ABI where there is no debug info.", "\
> +Normally there is debug information from which to construct a backtrace\n\
> +but sometimes is is not available (e.g. in assembly code). In this case the\n\
> +ABI sniffer can attempt to construct a backtrace. It is disabled by default\n\
> +because it can cause inconvenient errors. Note that it does not disable the\n\
> +Dwarf debug information sniffer.",
These strings should be in _(), to allow for their translation to
other languages. See the other examples of using
add_setshow_boolean_cmd in GDB's sources.
> Index: src/gdb/doc/gdb.texinfo
> ===================================================================
> --- src.orig/gdb/doc/gdb.texinfo 2005-11-01 11:43:29.000000000 +0000
> +++ src/gdb/doc/gdb.texinfo 2005-11-01 12:56:00.000000000 +0000
> @@ -14790,8 +14790,21 @@ commands:
> @item regs
> @kindex regs@r{, Super-H}
> Show the values of all Super-H registers.
> +
> +@item set backtrace abi-sniffer
> +@kindex set backtrace abi-sniffer
> +This command enables or disables the SH ABI-based frame sniffer. This
> +`sniffer' attempts to find the frames of a backtrace when there is no
> +debug information (specifically CFI) to do the job properly. Sniffing
> +frames is problematic so it is often best to switch this @samp{off}. It
> +is @samp{on} by default.
> +
> +@item show backtrace abi-sniffer
> +@kindex show backtrace abi-sniffer
> +Show whether the abi-sniffer is enabled, or not.
This part is fine with me, provided that you fix the following
gotchas:
. Make sure there are 2 blanks after a period that ends a sentence.
. Use ``sniffer'' instead of `sniffer' (two quote characters).
. Replace the "Sniffing is problematic..." sentence with text similar
to the one you included in your message that explains when this
command would be useful.
> @end table
>
> +
> @node WinCE
Please don't add this gratuitous whitespace.