public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [commit] symfile.c (simple_overlay_update): Check for null return.
@ 2011-03-05  0:56 Michael Snyder
  2011-03-07 11:07 ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2011-03-05  0:56 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 13 bytes --]

checked in.


[-- Attachment #2: null14.txt --]
[-- Type: text/plain, Size: 1701 bytes --]

2011-03-04  Michael Snyder  <msnyder@vmware.com>

	* symfile.c (simple_overlay_update): Check for null return value
	from lookup_minimal_symbol.

Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.307
diff -u -p -r1.307 symfile.c
--- symfile.c	26 Feb 2011 02:07:09 -0000	1.307
+++ symfile.c	5 Mar 2011 00:51:07 -0000
@@ -3432,15 +3432,24 @@ simple_overlay_update (struct obj_sectio
   if (osect)
     /* Have we got a cached copy of the target's overlay table?  */
     if (cache_ovly_table != NULL)
-      /* Does its cached location match what's currently in the symtab?  */
-      if (cache_ovly_table_base ==
-	  SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table",
-						       NULL, NULL)))
-	/* Then go ahead and try to look up this single section in the
-	   cache.  */
-	if (simple_overlay_update_1 (osect))
-	  /* Found it!  We're done.  */
-	  return;
+      {
+	/* Does its cached location match what's currently in the
+	   symtab?  */
+	struct minimal_symbol *minsym
+	  = lookup_minimal_symbol ("_ovly_table", NULL, NULL);
+
+	if (minsym == NULL)
+	  error (_("Error reading inferior's overlay table: couldn't "
+		   "find `_ovly_table' array\n"
+		   "in inferior.  Use `overlay manual' mode."));
+	
+	if (cache_ovly_table_base == SYMBOL_VALUE_ADDRESS (minsym))
+	  /* Then go ahead and try to look up this single section in
+	     the cache.  */
+	  if (simple_overlay_update_1 (osect))
+	    /* Found it!  We're done.  */
+	    return;
+      }
 
   /* Cached table no good: need to read the entire table anew.
      Or else we want all the sections, in which case it's actually

^ permalink raw reply	[flat|nested] 8+ messages in thread

* can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.")
  2011-03-05  0:56 [commit] symfile.c (simple_overlay_update): Check for null return Michael Snyder
@ 2011-03-07 11:07 ` Joel Brobecker
  2011-03-07 11:30   ` can we avoid using contractions in GDB messages? Eli Zaretskii
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Joel Brobecker @ 2011-03-07 11:07 UTC (permalink / raw)
  To: gdb-patches

Just a suggestion. It's really a detail, and I won't push for us
to adopt this suggestion, but:

> +	if (minsym == NULL)
> +	  error (_("Error reading inferior's overlay table: couldn't "
> +		   "find `_ovly_table' array\n"
> +		   "in inferior.  Use `overlay manual' mode."));

I'm not very fond of contractions in error messages (or any message
printed by GDB). I know there is plenty of "prior art" of our use
of contractions in the output, but I just think it looks better to
spell words completely.  For the future, can we agree on avoiding
contractions?

-- 
Joel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can we avoid using contractions in GDB messages?
  2011-03-07 11:07 ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Joel Brobecker
@ 2011-03-07 11:30   ` Eli Zaretskii
  2011-03-07 12:14     ` Joel Brobecker
  2011-03-07 19:07   ` Michael Snyder
  2011-03-07 21:58   ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Mike Frysinger
  2 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2011-03-07 11:30 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

> Date: Mon, 7 Mar 2011 14:51:58 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> 
> > +	if (minsym == NULL)
> > +	  error (_("Error reading inferior's overlay table: couldn't "
> > +		   "find `_ovly_table' array\n"
> > +		   "in inferior.  Use `overlay manual' mode."));
> 
> I'm not very fond of contractions in error messages (or any message
> printed by GDB). I know there is plenty of "prior art" of our use
> of contractions in the output, but I just think it looks better to
> spell words completely.  For the future, can we agree on avoiding
> contractions?

You mean, use "could not" instead of "couldn't"?  Why is that an
issue?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can we avoid using contractions in GDB messages?
  2011-03-07 11:30   ` can we avoid using contractions in GDB messages? Eli Zaretskii
@ 2011-03-07 12:14     ` Joel Brobecker
  0 siblings, 0 replies; 8+ messages in thread
From: Joel Brobecker @ 2011-03-07 12:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

> You mean, use "could not" instead of "couldn't"?  Why is that an
> issue?

Yes. I personally think it does not look good - we use these in
spoken English, but books, articles, and IMO software should not
be using them (makes me feel like the author was too lazy to write
the entire word).

-- 
Joel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can we avoid using contractions in GDB messages?
  2011-03-07 11:07 ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Joel Brobecker
  2011-03-07 11:30   ` can we avoid using contractions in GDB messages? Eli Zaretskii
@ 2011-03-07 19:07   ` Michael Snyder
  2011-03-07 19:19     ` Paul Koning
  2011-03-07 21:58   ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Mike Frysinger
  2 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2011-03-07 19:07 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel Brobecker wrote:
> Just a suggestion. It's really a detail, and I won't push for us
> to adopt this suggestion, but:
> 
>> +	if (minsym == NULL)
>> +	  error (_("Error reading inferior's overlay table: couldn't "
>> +		   "find `_ovly_table' array\n"
>> +		   "in inferior.  Use `overlay manual' mode."));
> 
> I'm not very fond of contractions in error messages (or any message
> printed by GDB). I know there is plenty of "prior art" of our use
> of contractions in the output, but I just think it looks better to
> spell words completely.  For the future, can we agree on avoiding
> contractions?
> 

My $0.02 -- I don't think there's anything wrong with contractions.
They're a part of standard English.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can we avoid using contractions in GDB messages?
  2011-03-07 19:07   ` Michael Snyder
@ 2011-03-07 19:19     ` Paul Koning
  2011-03-08  4:54       ` Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Koning @ 2011-03-07 19:19 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Joel Brobecker, gdb-patches


On Mar 7, 2011, at 1:55 PM, Michael Snyder wrote:

> Joel Brobecker wrote:
>> Just a suggestion. It's really a detail, and I won't push for us
>> to adopt this suggestion, but:
>>> +	if (minsym == NULL)
>>> +	  error (_("Error reading inferior's overlay table: couldn't "
>>> +		   "find `_ovly_table' array\n"
>>> +		   "in inferior.  Use `overlay manual' mode."));
>> I'm not very fond of contractions in error messages (or any message
>> printed by GDB). I know there is plenty of "prior art" of our use
>> of contractions in the output, but I just think it looks better to
>> spell words completely.  For the future, can we agree on avoiding
>> contractions?
> 
> My $0.02 -- I don't think there's anything wrong with contractions.
> They're a part of standard English.

True.  But they are less familiar to those who are not native speakers.

	paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.")
  2011-03-07 11:07 ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Joel Brobecker
  2011-03-07 11:30   ` can we avoid using contractions in GDB messages? Eli Zaretskii
  2011-03-07 19:07   ` Michael Snyder
@ 2011-03-07 21:58   ` Mike Frysinger
  2 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-03-07 21:58 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

[-- Attachment #1: Type: Text/Plain, Size: 1399 bytes --]

On Monday, March 07, 2011 05:51:58 Joel Brobecker wrote:
> Just a suggestion. It's really a detail, and I won't push for us
> 
> to adopt this suggestion, but:
> > +	if (minsym == NULL)
> > +	  error (_("Error reading inferior's overlay table: couldn't "
> > +		   "find `_ovly_table' array\n"
> > +		   "in inferior.  Use `overlay manual' mode."));
> 
> I'm not very fond of contractions in error messages (or any message
> printed by GDB). I know there is plenty of "prior art" of our use
> of contractions in the output, but I just think it looks better to
> spell words completely.

personally, i think contractions are fine when used correctly.  while i am a 
lazy english speaker, "should not" makes it sound like a formal statement.  i 
also just watched a hindi movie where the subtitles were kind of bad, but for 
the opposite reason ... they used contractions everywhere even when native 
speakers wouldn't (because it sounds weird).

what about "cannot" vs "can not" ?  obviously "can't" is out via this new 
rule, but i don't see a problem with "cannot" ...

i think some people read "maybe" as a contraction of "may be", but i see a 
subtle difference between them.

> For the future, can we agree on avoiding contractions?

in order to make it stick, it really needs to be a rule that the autoscanning 
script checks for (similar to style issues).
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: can we avoid using contractions in GDB messages?
  2011-03-07 19:19     ` Paul Koning
@ 2011-03-08  4:54       ` Joel Brobecker
  0 siblings, 0 replies; 8+ messages in thread
From: Joel Brobecker @ 2011-03-08  4:54 UTC (permalink / raw)
  To: Paul Koning; +Cc: Michael Snyder, gdb-patches

> > My $0.02 -- I don't think there's anything wrong with contractions.
> > They're a part of standard English.
> 
> True.  But they are less familiar to those who are not native speakers.

OK, I think I might have been a little extreme, then, in my judgement
of contractions. I don't think it's question of familiarity, since
I remember learning about them fairly early on, if not in my first
English lesson. Interesting discussion, though :).

-- 
Joel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-03-08  4:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-05  0:56 [commit] symfile.c (simple_overlay_update): Check for null return Michael Snyder
2011-03-07 11:07 ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Joel Brobecker
2011-03-07 11:30   ` can we avoid using contractions in GDB messages? Eli Zaretskii
2011-03-07 12:14     ` Joel Brobecker
2011-03-07 19:07   ` Michael Snyder
2011-03-07 19:19     ` Paul Koning
2011-03-08  4:54       ` Joel Brobecker
2011-03-07 21:58   ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).