Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Dave Korn" <dave.korn@artimi.com>
To: "'Greg Law'" <greglaw@greglaw.net>, 	<gdb@sourceware.org>
Subject: RE: decode_variable's use of not_found_ptr
Date: Sat, 22 Apr 2006 16:32:00 -0000	[thread overview]
Message-ID: <02e201c66607$98e13ca0$a501a8c0@CAM.ARTIMI.COM> (raw)
In-Reply-To: <4449E3F8.3020408@greglaw.net>

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....


  reply	other threads:[~2006-04-22 12:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-22 13:00 Greg Law
2006-04-22 16:32 ` Dave Korn [this message]
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

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='02e201c66607$98e13ca0$a501a8c0@CAM.ARTIMI.COM' \
    --to=dave.korn@artimi.com \
    --cc=gdb@sourceware.org \
    --cc=greglaw@greglaw.net \
    /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