This is the mail archive of the gdb-patches@sourceware.org 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]

[PATCH] Fix inconsistency of code and comments in init_psymbol_list


Hi,
I happen to read the following part in psymtab.c:init_psymbol_list,

  /* Current best guess is that approximately a twentieth
     of the total symbols (in a debugging file) are global or static
     oriented symbols.  */

  objfile->global_psymbols.size = total_symbols / 10;
  objfile->static_psymbols.size = total_symbols / 10;

and think the code is inconsistent to the comment (twentieth vs. '/ 10').
It should be "tenth" instead of "twentieth" in comment.  Of course,
we can update constant 10 to 20, but it is safe to change comment rather
than the code.

These lines of code has been in GDB for many years, even prior to
importing to CVS repository, so I don't find any clue from the history.
OK?

gdb:

2012-12-26  Yao Qi  <yao@codesourcery.com>

	* psymtab.c (init_psymbol_list): Fix a typo in comment.
---
 gdb/psymtab.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 409f96b..0c62679 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1710,7 +1710,7 @@ init_psymbol_list (struct objfile *objfile, int total_symbols)
       xfree (objfile->static_psymbols.list);
     }
 
-  /* Current best guess is that approximately a twentieth
+  /* Current best guess is that approximately a tenth
      of the total symbols (in a debugging file) are global or static
      oriented symbols.  */
 
-- 
1.7.7.6


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