This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [commit] Ignore SEGVs from win32 IsBad* functions


On Sun, Mar 27, 2005 at 12:53:25PM +0200, Eli Zaretskii wrote:
> > Date: Sun, 27 Mar 2005 00:20:52 -0500
> > From: Christopher Faylor <cgf@gnu.org>
> > 
> > +      {
> > +	char *fn;
> > +	if (find_pc_partial_function ((CORE_ADDR) current_event.u.Exception
> > +				      .ExceptionRecord.ExceptionAddress,
> > +				      &fn, NULL, NULL)
> > +	    && strncmp (fn, "KERNEL32!IsBad", strlen ("KERNEL32!IsBad")) == 0)
> > +	  return 0;
> > +      }
> 
> Nitpicking: won't it be cleaner to have a single string
> "KERNEL32!IsBad", instead of mentioning it twice, and to use sizeof
> instead of strlen?

The only thing this saves you is the chance of typos; recent GCC
versions will not only combine the strings, but also fold strlen to a
constant.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]