From: Andrew Cagney <cagney@gnu.org>
To: Andreas Schwab <schwab@suse.de>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Don't error out when variable not available
Date: Tue, 04 Jan 2005 22:20:00 -0000 [thread overview]
Message-ID: <41DB169A.8040103@gnu.org> (raw)
In-Reply-To: <m3wtuvqyly.fsf@igel.m5r.de>
Andreas Schwab wrote:
> With the introduction of DWARF location lists it became impossible to get
> the full list of local variables of a function when any of them is not
> available. This is especially annoying when the first local or function
> parameter is missing. Here is an attempt at correcting this. It is
> suboptimal because it still prints the error message including the newline
> which badly messes up the output. Any idea how to fix that properly?
The code to catch these errors and print the message as part of the
output has long been on my (and I suspect others) wish list. It should,
in addition to solving your problem, mean that gdb handles the general
case printing for instance:
(gdb) print struct_s
$1 = { a = <memory error>, b = "hi" }
(gdb)
instead of
$1 = { a = memory error
(gdb)
Have a look at catch_exceptions_with_msg. It was added to handle the
problem of needing to catch the error message (you might need to wiggle
the interface though).
Adding more special case code, as was done with your other patch, isn't
the way to go.
Andrew
> 2005-01-02 Andreas Schwab <schwab@suse.de>
>
> * findvar.c (read_var_value_no_error, read_var_value_no_error_1)
> (struct read_var_value_args): New.
> * value.h (read_var_value_no_error): Declare it.
> * printcmd.c (print_variable_value): Use read_var_value_no_error.
> * stack.c (print_frame_args): Likewise.
next prev parent reply other threads:[~2005-01-04 22:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-02 22:13 Andreas Schwab
2005-01-02 22:57 ` Daniel Jacobowitz
2005-01-02 23:49 ` Andreas Schwab
2005-01-03 0:49 ` Daniel Jacobowitz
2005-01-03 13:41 ` Andreas Schwab
2005-01-04 22:20 ` Andrew Cagney [this message]
2005-01-05 19:23 ` Andreas Schwab
2005-02-28 20:53 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41DB169A.8040103@gnu.org \
--to=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox