decode_variable's use of not_found_ptr

Greg Law greglaw@greglaw.net
Sat Apr 22 13:00:00 GMT 2006


Hi all,

I tried to send this to gdb-prs, but to no avail - hopefully mmore luck 
here.

Anyway, sometimes when I restart a program. I get error messages telling 
me that a breakpoint in a shared library can't be found:

     Error in re-setting breakpoint 2:
     Function "foo" not defined.
     Error in re-setting breakpoint 2:
     Function "foo" not defined.
     Error in re-setting breakpoint 2:
     Function "foo" not defined.
     Error in re-setting breakpoint 2:
     Function "foo" not defined.
     Error in re-setting breakpoint 2:
     Function "foo" not defined.
     Error in re-setting breakpoint 2:
     Function "foo" not defined.
     Error in re-setting breakpoint 2:
     Function "foo" not defined.

I've had a quick look at the source, and the message seems to be coming 
from decode_variable()

The comment for this function says:

/* Decode a linespec that's a variable.  If FILE_SYMTAB is non-NULL,
    look in that symtab's static variables first.  If NOT_FOUND_PTR is
    not NULL and the function cannot be found, store boolean true in the
    location pointed to and do not issue an error message.  */


but at the bottom of the function it says:


  if (not_found_ptr)
    *not_found_ptr = 1;
  throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy);


Now, I must confess gdb's internal exception mechanism is deeply 
mysterious to me, but that code looks to me like it doesn't do what the 
comment claims.  i.e. if not_found_ptr is non-NULL, it still issues the 
error message.

What's wrong - my reading of the code, or the code?

Cheers,

Greg



More information about the Gdb mailing list