This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/ob]
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 11 Dec 2001 14:41:52 -0500
- Subject: Re: [patch/ob]
- References: <3C164DDD.5020904@cygnus.com>
On Tue, Dec 11, 2001 at 10:18:05AM -0800, Andrew Cagney wrote:
> Just FYI,
>
> I've checked the attached in as, er, obvious. It fixes a
> -Wuninitialized warning.
I agree with the "er, obvious".
Would there be anything wrong with:
> *************** value_fn_field (value_ptr *arg1p, struct
> *** 971,983 ****
> struct minimal_symbol *msym;
adding = NULL to the line above?
>
> sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
> ! if (!sym)
> {
> msym = lookup_minimal_symbol (physname, NULL, NULL);
> }
> -
> - if (!sym && !msym)
> - return NULL;
>
> v = allocate_value (ftype);
> if (sym)
> --- 972,988 ----
> struct minimal_symbol *msym;
>
> sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
> ! if (sym != NULL)
> {
> + msym = NULL;
> + }
> + else
> + {
> + gdb_assert (sym == NULL);
This assert in particular bugs me. Adding asserts that the compiler
can obviously eliminate, since sym isn't volatile...
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer