* decode_variable's use of not_found_ptr
@ 2006-04-22 13:00 Greg Law
2006-04-22 16:32 ` Dave Korn
2006-04-23 15:57 ` Daniel Jacobowitz
0 siblings, 2 replies; 8+ messages in thread
From: Greg Law @ 2006-04-22 13:00 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: decode_variable's use of not_found_ptr
2006-04-22 13:00 decode_variable's use of not_found_ptr Greg Law
@ 2006-04-22 16:32 ` Dave Korn
2006-04-22 21:21 ` Dave Korn
2006-04-22 21:36 ` Greg Law
2006-04-23 15:57 ` Daniel Jacobowitz
1 sibling, 2 replies; 8+ messages in thread
From: Dave Korn @ 2006-04-22 16:32 UTC (permalink / raw)
To: 'Greg Law', gdb
On 22 April 2006 09:06, Greg Law wrote:
> 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?
Well, the code doesn't do what the comment says, that's true. You can try
putting an 'else' between those lines, but don't forget that you'll now have
to add a return statement for when the error isn't thrown, and you'll have to
return NULL since the lookup has failed, and there may be some call sites that
aren't expecting to receive a NULL return because they've never had to before
because the error was previously always being thrown, so there may be knock-on
effects....
You could also try looking at the history of the file in CVS, see if that
comment was ever accurate; it's the sort of error that can easily creep in
during minor code tidyups.
cheers,
DaveK
--
Can't think of a witty .sigline today....
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: decode_variable's use of not_found_ptr
2006-04-22 16:32 ` Dave Korn
@ 2006-04-22 21:21 ` Dave Korn
2006-04-22 21:36 ` Greg Law
1 sibling, 0 replies; 8+ messages in thread
From: Dave Korn @ 2006-04-22 21:21 UTC (permalink / raw)
To: 'Greg Law', gdb
On 22 April 2006 13:24, Dave Korn wrote:
>
> You could also try looking at the history of the file in CVS, see if that
> comment was ever accurate; it's the sort of error that can easily creep in
> during minor code tidyups.
To clarify, what I mean is that the comment may have once been accurate and
then some minor refactoring got the if..else legs confused with/without braces
at some point in the past; not that someone misedited the comment!
cheers,
DaveK
--
Can't think of a witty .sigline today....
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: decode_variable's use of not_found_ptr
2006-04-22 16:32 ` Dave Korn
2006-04-22 21:21 ` Dave Korn
@ 2006-04-22 21:36 ` Greg Law
2006-04-23 10:22 ` Nick Roberts
1 sibling, 1 reply; 8+ messages in thread
From: Greg Law @ 2006-04-22 21:36 UTC (permalink / raw)
Cc: gdb
Dave Korn wrote:
> On 22 April 2006 09:06, Greg Law wrote:
>
>
>
>> 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?
>
>
>
> Well, the code doesn't do what the comment says, that's true. You
can try
> putting an 'else' between those lines, but don't forget that you'll
now have
> to add a return statement for when the error isn't thrown, and you'll
have to
> return NULL since the lookup has failed, and there may be some call
sites that
> aren't expecting to receive a NULL return because they've never had
to before
> because the error was previously always being thrown, so there may be
knock-on
> effects....
Can't return NULL as the function returns a structure by copy.
>
> You could also try looking at the history of the file in CVS, see
if that
> comment was ever accurate; it's the sort of error that can easily
creep in
> during minor code tidyups.
Had a quick look at 6.3's code, and that is indeed different:
if (not_found_ptr)
{
*not_found_ptr = 1;
/* The caller has indicated that it wishes quiet notification of any
error where the function or file is not found. A call to
error_silent causes an error to occur, but it does not issue
the supplied message. The message can be manually output by
the caller, if desired. This is used, for example, when
attempting to set breakpoints for functions in shared libraries
that have not yet been loaded. */
error_silent ("Function \"%s\" not defined.", copy);
}
For some reason the error_silent seems to have got chopped in version
6.4. I'll submit a problem report.
g
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: decode_variable's use of not_found_ptr
2006-04-22 21:36 ` Greg Law
@ 2006-04-23 10:22 ` Nick Roberts
0 siblings, 0 replies; 8+ messages in thread
From: Nick Roberts @ 2006-04-23 10:22 UTC (permalink / raw)
To: Greg Law; +Cc: gdb
> >> 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?
I think this part is right and the clue is in the macro NOT_FOUND_ERROR.
> Had a quick look at 6.3's code, and that is indeed different:
>
> if (not_found_ptr)
> {
> *not_found_ptr = 1;
> /* The caller has indicated that it wishes quiet notification of any
> error where the function or file is not found. A call to
> error_silent causes an error to occur, but it does not issue
> the supplied message. The message can be manually output by
> the caller, if desired. This is used, for example, when
> attempting to set breakpoints for functions in shared libraries
> that have not yet been loaded. */
> error_silent ("Function \"%s\" not defined.", copy);
> }
>
> For some reason the error_silent seems to have got chopped in version
> 6.4. I'll submit a problem report.
Looking at the Changelog error_silent has been deleted and replaced with
throw_error. I think the problem is elsewhere, in break_command_1
in breakpoint.c maybe:
case NOT_FOUND_ERROR:
/* If called to resolve pending breakpoint, just return
error code. */
if (pending_bp)
return e.reason;
exception_print (gdb_stderr, e);
I guess that pending_bp is NULL in your case and you need to debug GDB to see
why.
It would probably also help (those more knowledgable than me) if you said how
your GDB has been configured.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: decode_variable's use of not_found_ptr
2006-04-22 13:00 decode_variable's use of not_found_ptr Greg Law
2006-04-22 16:32 ` Dave Korn
@ 2006-04-23 15:57 ` Daniel Jacobowitz
2006-04-24 6:05 ` Greg Law
1 sibling, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2006-04-23 15:57 UTC (permalink / raw)
To: Greg Law; +Cc: gdb
On Sat, Apr 22, 2006 at 09:06:16AM +0100, Greg Law wrote:
> 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()
You've been hunting around trying to figure out how this function was
recently changed to cause this problem. I think you're looking up the
wrong tree - have you tried an earlier version? This message has been
around for as long as I can remember (which isn't to say that it
shouldn't be fixed). The pending_bp and not_found_ptr stuff is much
more recent and for a different situation.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: decode_variable's use of not_found_ptr
2006-04-23 15:57 ` Daniel Jacobowitz
@ 2006-04-24 6:05 ` Greg Law
2006-04-24 6:13 ` Daniel Jacobowitz
0 siblings, 1 reply; 8+ messages in thread
From: Greg Law @ 2006-04-24 6:05 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
Daniel Jacobowitz wrote:
>On Sat, Apr 22, 2006 at 09:06:16AM +0100, Greg Law wrote:
>
>
>>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()
>>
>>
>
>You've been hunting around trying to figure out how this function was
>recently changed to cause this problem. I think you're looking up the
>wrong tree - have you tried an earlier version?
>
Yes - 6.3 doesn't have this issue.
g
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-04-23 15:57 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-22 13:00 decode_variable's use of not_found_ptr Greg Law
2006-04-22 16:32 ` Dave Korn
2006-04-22 21:21 ` Dave Korn
2006-04-22 21:36 ` Greg Law
2006-04-23 10:22 ` Nick Roberts
2006-04-23 15:57 ` Daniel Jacobowitz
2006-04-24 6:05 ` Greg Law
2006-04-24 6:13 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox