Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [ARI] Remove all editCase warnings
@ 2010-05-04 23:25 Pierre Muller
  2010-05-04 23:32 ` Stan Shebs
  2010-05-04 23:44 ` Pedro Alves
  0 siblings, 2 replies; 14+ messages in thread
From: Pierre Muller @ 2010-05-04 23:25 UTC (permalink / raw)
  To: gdb-patches

  This patch handles the 18 occurrences of the editCase function rule.

  I lowercased most functions, with two exceptions:
  - in sol-thread.c, ps_lgetLDT is said to be required 
by solaris libthread_db.
  - in windows-nat.c, for a bunch of dummy replacements
of DLL functions that only exist in some versions.
  In those two cases, I added a /* ARI: editCase function */
to tell ARI not to mention this.

  Is this patch reviewable as is,
or should I resubmit each file
individually?



Pierre Muller
Pascal language support maintainer for GDB
as ARI maintainer.
 

2010-05-05  Pierre Muller  <muller@ics.u-strasbg.fr>

	ARI: Fix editCase.
	* ada-lang.c (ada_remove_Xbn_suffix): Rename to...
	(ada_remove_xbn_suffix): ...this.
	(find_old_style_renaming_symbol): Adapt to name change above.
	* addrmap.c (splay_compare_CORE_ADDR_ptr): Rename to...
	(splay_compare_core_addr_ptr): ...this.
	(addrmap_create_mutable): Adapt to name change above.
	* hppa-tdep.c (hppa_extract_5R_store): Rename to...
	(hppa_extract_r_store): ...this.
	(inst_saves_gr): Adapt to name change above.
	(inst_saves_fr): Adapt to name change above.
	* hppa-tdep.h (hppa_extract_5R_store): Rename to...
	(hppa_extract_r_store): ...this.
	* ia64-tdep.c (slotN_contents): Rename to...
	(slotn_contents): ...this.
	(replace_slotN_contents): Rename to...
	(replace_slotn_contents): ...this.
	(fetch_instruction): Adapt to name changes above.
	(ia64_memory_insert_breakpoint): Likewise.
	(ia64_memory_remove_breakpoint): Likewise.
	(ia64_breakpoint_from_pc): Likewise.
	* procfs.c (proc_get_LDT_entry): Rename to...
	(proc_get_ldt_entry): ...this.
	(procfs_find_LDT_entry): Rename to...
	(procfs_find_ldt_entry): ...this.
	* remote.c (set_remote_protocol_Z_packet_cmd): Rename to...
	(set_remote_protocol_z_packet_cmd): ...this.
	(show_remote_protocol_Z_packet_cmd): Rename to...
	(show_remote_protocol_z_packet_cmd): ...this.
	(store_register_using_P): Rename to...
	(store_register_using_p): ...this.
	(store_register_using_G): Rename to...
	(store_register_using_g): ...this.
	(remote_store_registers): Adapt to name changes above.
	(watchpoint_to_Z_packet): Rename to...
	(watchpoint_to_z_packet): ...this.
	(remote_insert_watchpoint): Adapt to name chage above.
	(remote_remove_watchpoint): Likewise.
	(_initialize_remote): Adapt to name changes above.
	* sol-thread.c (ps_lgetLDT): Add ARI comment for editCase.
	Adapt to name change in procfs.c source.
	* windows-nat.c (_initialize_check_for_gdb_ini): Add ARI
	comment to all windows API replacement functions.

Index: src/gdb/ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.258
diff -u -p -r1.258 ada-lang.c
--- src/gdb/ada-lang.c	2 May 2010 21:14:59 -0000	1.258
+++ src/gdb/ada-lang.c	4 May 2010 22:14:55 -0000
@@ -855,7 +855,7 @@ ada_remove_po_subprogram_suffix (const c
 /* Remove trailing X[bn]* suffixes (indicating names in package bodies).
*/
 
 static void
-ada_remove_Xbn_suffix (const char *encoded, int *len)
+ada_remove_xbn_suffix (const char *encoded, int *len)
 {
   int i = *len - 1;
 
@@ -6471,7 +6471,7 @@ find_old_style_renaming_symbol (const ch
       /* Strip the suffix if necessary.  */
       ada_remove_trailing_digits (function_name, &function_name_len);
       ada_remove_po_subprogram_suffix (function_name, &function_name_len);
-      ada_remove_Xbn_suffix (function_name, &function_name_len);
+      ada_remove_xbn_suffix (function_name, &function_name_len);
 
       /* Library-level functions are a special case, as GNAT adds
          a ``_ada_'' prefix to the function name to avoid namespace
Index: src/gdb/addrmap.c
===================================================================
RCS file: /cvs/src/src/gdb/addrmap.c,v
retrieving revision 1.7
diff -u -p -r1.7 addrmap.c
--- src/gdb/addrmap.c	1 Jan 2010 07:31:29 -0000	1.7
+++ src/gdb/addrmap.c	4 May 2010 22:14:56 -0000
@@ -491,7 +491,7 @@ splay_obstack_free (void *obj, void *clo
 
 /* Compare keys as CORE_ADDR * values.  */
 static int
-splay_compare_CORE_ADDR_ptr (splay_tree_key ak, splay_tree_key bk)
+splay_compare_core_addr_ptr (splay_tree_key ak, splay_tree_key bk)
 {
   CORE_ADDR a = * (CORE_ADDR *) ak;
   CORE_ADDR b = * (CORE_ADDR *) bk;
@@ -519,7 +519,7 @@ addrmap_create_mutable (struct obstack *
      free list has to be initialized before we create the tree.  */
   map->free_nodes = NULL;
 
-  map->tree = splay_tree_new_with_allocator (splay_compare_CORE_ADDR_ptr,
+  map->tree = splay_tree_new_with_allocator (splay_compare_core_addr_ptr,
                                              NULL, /* no delete key */
                                              NULL, /* no delete value */
                                              splay_obstack_alloc,
Index: src/gdb/hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.273
diff -u -p -r1.273 hppa-tdep.c
--- src/gdb/hppa-tdep.c	19 Jan 2010 09:39:12 -0000	1.273
+++ src/gdb/hppa-tdep.c	4 May 2010 22:14:57 -0000
@@ -115,7 +115,7 @@ hppa_extract_5r_store (unsigned word)
 /* extract the immediate field from a {sr}sm instruction */
 
 unsigned
-hppa_extract_5R_store (unsigned word)
+hppa_extract_5_r_store (unsigned word)
 {
   return (word >> 16 & MASK_5);
 }
@@ -1390,17 +1390,17 @@ inst_saves_gr (unsigned long inst)
       || (inst >> 26) == 0x1f
       || ((inst >> 26) == 0x1f
 	  && ((inst >> 6) == 0xa)))
-    return hppa_extract_5R_store (inst);
+    return hppa_extract_5_r_store (inst);
 
   /* Does it look like a std?  */
   if ((inst >> 26) == 0x1c
       || ((inst >> 26) == 0x03
 	  && ((inst >> 6) & 0xf) == 0xb))
-    return hppa_extract_5R_store (inst);
+    return hppa_extract_5_r_store (inst);
 
   /* Does it look like a stwm?  GCC & HPC may use this in prologues. */
   if ((inst >> 26) == 0x1b)
-    return hppa_extract_5R_store (inst);
+    return hppa_extract_5_r_store (inst);
 
   /* Does it look like sth or stb?  HPC versions 9.0 and later use these
      too.  */
@@ -1408,7 +1408,7 @@ inst_saves_gr (unsigned long inst)
       || ((inst >> 26) == 0x3
 	  && (((inst >> 6) & 0xf) == 0x8
 	      || (inst >> 6) & 0xf) == 0x9))
-    return hppa_extract_5R_store (inst);
+    return hppa_extract_5_r_store (inst);
 
   return 0;
 }
@@ -1428,12 +1428,12 @@ inst_saves_fr (unsigned long inst)
   if ((inst & 0xfc00dfc0) == 0x2c001200)
     return hppa_extract_5r_store (inst);
   if ((inst & 0xfc000002) == 0x70000002)
-    return hppa_extract_5R_store (inst);
+    return hppa_extract_5_r_store (inst);
   /* is this an FSTW ? */
   if ((inst & 0xfc00df80) == 0x24001200)
     return hppa_extract_5r_store (inst);
   if ((inst & 0xfc000002) == 0x7c000000)
-    return hppa_extract_5R_store (inst);
+    return hppa_extract_5_r_store (inst);
   return 0;
 }
 
Index: src/gdb/hppa-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.h,v
retrieving revision 1.39
diff -u -p -r1.39 hppa-tdep.h
--- src/gdb/hppa-tdep.h	1 Jan 2010 07:31:33 -0000	1.39
+++ src/gdb/hppa-tdep.h	4 May 2010 22:41:17 -0000
@@ -218,7 +218,7 @@ extern const struct objfile_data *hppa_o
 
 int hppa_get_field (unsigned word, int from, int to);
 int hppa_extract_5_load (unsigned int);
-unsigned hppa_extract_5R_store (unsigned int);
+unsigned hppa_extract_5_r_store (unsigned int);
 unsigned hppa_extract_5r_store (unsigned int);
 int hppa_extract_17 (unsigned int);
 int hppa_extract_21 (unsigned);
Index: src/gdb/ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.205
diff -u -p -r1.205 ia64-tdep.c
--- src/gdb/ia64-tdep.c	1 Jan 2010 07:31:36 -0000	1.205
+++ src/gdb/ia64-tdep.c	4 May 2010 22:14:58 -0000
@@ -447,7 +447,7 @@ replace_bit_field (char *bundle, long lo
    and instruction bundle */
 
 static long long
-slotN_contents (char *bundle, int slotnum)
+slotn_contents (char *bundle, int slotnum)
 {
   return extract_bit_field (bundle, 5+41*slotnum, 41);
 }
@@ -455,7 +455,7 @@ slotN_contents (char *bundle, int slotnu
 /* Store an instruction in an instruction bundle */
 
 static void
-replace_slotN_contents (char *bundle, long long instr, int slotnum)
+replace_slotn_contents (char *bundle, long long instr, int slotnum)
 {
   replace_bit_field (bundle, instr, 5+41*slotnum, 41);
 }
@@ -534,7 +534,7 @@ fetch_instruction (CORE_ADDR addr, instr
   if (val != 0)
     return 0;
 
-  *instr = slotN_contents (bundle, slotnum);
+  *instr = slotn_contents (bundle, slotnum);
   template = extract_bit_field (bundle, 0, 5);
   *it = template_encoding_table[(int)template][slotnum];
 
@@ -705,12 +705,12 @@ ia64_memory_insert_breakpoint (struct gd
      reinserted by bp_loc_is_permanent.  Multiple breakpoints at the same
      location cannot induce the internal error as they are optimized into
      a single instance by update_global_location_list.  */
-  instr_breakpoint = slotN_contents (bundle, slotnum);
+  instr_breakpoint = slotn_contents (bundle, slotnum);
   if (instr_breakpoint == IA64_BREAKPOINT)
     internal_error (__FILE__, __LINE__,
 		    _("Address %s already contains a breakpoint."),
 		    paddress (gdbarch, bp_tgt->placed_address));
-  replace_slotN_contents (bundle, IA64_BREAKPOINT, slotnum);
+  replace_slotn_contents (bundle, IA64_BREAKPOINT, slotnum);
 
   bp_tgt->placed_size = bp_tgt->shadow_len;
 
@@ -779,7 +779,7 @@ ia64_memory_remove_breakpoint (struct gd
   gdb_assert (bp_tgt->placed_size == BUNDLE_LEN - shadow_slotnum);
   gdb_assert (bp_tgt->placed_size == bp_tgt->shadow_len);
 
-  instr_breakpoint = slotN_contents (bundle_mem, slotnum);
+  instr_breakpoint = slotn_contents (bundle_mem, slotnum);
   if (instr_breakpoint != IA64_BREAKPOINT)
     {
       warning (_("Cannot remove breakpoint at address %s, "
@@ -794,11 +794,11 @@ ia64_memory_remove_breakpoint (struct gd
   memcpy (bundle_saved, bundle_mem, BUNDLE_LEN);
   memcpy (bundle_saved + shadow_slotnum, bp_tgt->shadow_contents,
 	  bp_tgt->shadow_len);
-  instr_saved = slotN_contents (bundle_saved, slotnum);
+  instr_saved = slotn_contents (bundle_saved, slotnum);
 
   /* In BUNDLE_MEM, be careful to modify only the bits belonging to SLOTNUM
      and not any of the other ones that are stored in SHADOW_CONTENTS.  */
-  replace_slotN_contents (bundle_mem, instr_saved, slotnum);
+  replace_slotn_contents (bundle_mem, instr_saved, slotnum);
   val = target_write_memory (addr, bundle_mem, BUNDLE_LEN);
 
   do_cleanups (cleanup);
@@ -862,9 +862,9 @@ ia64_breakpoint_from_pc (struct gdbarch 
   /* A break instruction has its all its opcode bits cleared except for
      the parameter value.  For L+X slot pair we are at the X slot (slot 2)
so
      we should not touch the L slot - the upper 41 bits of the parameter.
*/
-  instr_fetched = slotN_contents (bundle, slotnum);
+  instr_fetched = slotn_contents (bundle, slotnum);
   instr_fetched &= 0x1003ffffc0LL;
-  replace_slotN_contents (bundle, instr_fetched, slotnum);
+  replace_slotn_contents (bundle, instr_fetched, slotnum);
 
   return bundle + shadow_slotnum;
 }
Index: src/gdb/procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.131
diff -u -p -r1.131 procfs.c
--- src/gdb/procfs.c	20 Apr 2010 22:36:35 -0000	1.131
+++ src/gdb/procfs.c	4 May 2010 22:15:00 -0000
@@ -2974,7 +2974,7 @@ proc_set_watchpoint (procinfo *pi, CORE_
 #include <sys/sysi86.h>
 
 /*
- * Function: proc_get_LDT_entry
+ * Function: proc_get_ldt_entry
  *
  * Inputs:
  *   procinfo *pi;
@@ -2987,7 +2987,7 @@ proc_set_watchpoint (procinfo *pi, CORE_
  */
 
 struct ssd *
-proc_get_LDT_entry (procinfo *pi, int key)
+proc_get_ldt_entry (procinfo *pi, int key)
 {
   static struct ssd *ldt_entry = NULL;
 #ifdef NEW_PROC_API
@@ -3004,7 +3004,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
   sprintf (pathname, "/proc/%d/ldt", pi->pid);
   if ((fd = open_with_retry (pathname, O_RDONLY)) < 0)
     {
-      proc_warn (pi, "proc_get_LDT_entry (open)", __LINE__);
+      proc_warn (pi, "proc_get_ldt_entry (open)", __LINE__);
       return NULL;
     }
   /* Make sure it gets closed again! */
@@ -3031,7 +3031,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
   /* Get the number of LDT entries.  */
   if (ioctl (pi->ctl_fd, PIOCNLDT, &nldt) < 0)
     {
-      proc_warn (pi, "proc_get_LDT_entry (PIOCNLDT)", __LINE__);
+      proc_warn (pi, "proc_get_ldt_entry (PIOCNLDT)", __LINE__);
       return NULL;
     }
 
@@ -3047,7 +3047,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
   /* Read the whole table in one gulp.  */
   if (ioctl (pi->ctl_fd, PIOCLDT, ldt_entry) < 0)
     {
-      proc_warn (pi, "proc_get_LDT_entry (PIOCLDT)", __LINE__);
+      proc_warn (pi, "proc_get_ldt_entry (PIOCLDT)", __LINE__);
       return NULL;
     }
 
@@ -3062,7 +3062,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
 }
 
 /*
- * Function: procfs_find_LDT_entry
+ * Function: procfs_find_ldt_entry
  *
  * Input:
  *   ptid_t ptid;	// The GDB-style pid-plus-LWP.
@@ -3072,7 +3072,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
  */
 
 struct ssd *
-procfs_find_LDT_entry (ptid_t ptid)
+procfs_find_ldt_entry (ptid_t ptid)
 {
   gdb_gregset_t *gregs;
   int            key;
@@ -3081,14 +3081,14 @@ procfs_find_LDT_entry (ptid_t ptid)
   /* Find procinfo for the lwp. */
   if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL)
     {
-      warning (_("procfs_find_LDT_entry: could not find procinfo for
%d:%ld."),
+      warning (_("procfs_find_ldt_entry: could not find procinfo for
%d:%ld."),
 	       PIDGET (ptid), TIDGET (ptid));
       return NULL;
     }
   /* get its general registers. */
   if ((gregs = proc_get_gregs (pi)) == NULL)
     {
-      warning (_("procfs_find_LDT_entry: could not read gregs for
%d:%ld."),
+      warning (_("procfs_find_ldt_entry: could not read gregs for
%d:%ld."),
 	       PIDGET (ptid), TIDGET (ptid));
       return NULL;
     }
@@ -3096,7 +3096,7 @@ procfs_find_LDT_entry (ptid_t ptid)
   key = (*gregs)[GS] & 0xffff;
 
   /* Find the matching entry and return it. */
-  return proc_get_LDT_entry (pi, key);
+  return proc_get_ldt_entry (pi, key);
 }
 
 #endif
Index: src/gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.403
diff -u -p -r1.403 remote.c
--- src/gdb/remote.c	3 May 2010 02:13:01 -0000	1.403
+++ src/gdb/remote.c	4 May 2010 22:15:03 -0000
@@ -1217,7 +1217,7 @@ enum Z_packet_type
 static enum auto_boolean remote_Z_packet_detect;
 
 static void
-set_remote_protocol_Z_packet_cmd (char *args, int from_tty,
+set_remote_protocol_z_packet_cmd (char *args, int from_tty,
 				  struct cmd_list_element *c)
 {
   int i;
@@ -1229,7 +1229,7 @@ set_remote_protocol_Z_packet_cmd (char *
 }
 
 static void
-show_remote_protocol_Z_packet_cmd (struct ui_file *file, int from_tty,
+show_remote_protocol_z_packet_cmd (struct ui_file *file, int from_tty,
 				   struct cmd_list_element *c,
 				   const char *value)
 {
@@ -3482,7 +3482,7 @@ static char *remote_support_xml;
 /* Register string appended to "xmlRegisters=" in qSupported query.  */
 
 void
-register_remote_support_xml (const char *xml ATTRIBUTE_UNUSED)
+register_remote_support_xml (const char *xml)
 {
 #if defined(HAVE_LIBEXPAT)
   if (remote_support_xml == NULL)
@@ -5612,7 +5612,7 @@ remote_prepare_to_store (struct regcache
    packet was not recognized.  */
 
 static int
-store_register_using_P (const struct regcache *regcache, 
+store_register_using_p (const struct regcache *regcache, 
 			struct packet_reg *reg)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -5653,7 +5653,7 @@ store_register_using_P (const struct reg
    contents of the register cache buffer.  FIXME: ignores errors.  */
 
 static void
-store_registers_using_G (const struct regcache *regcache)
+store_registers_using_g (const struct regcache *regcache)
 {
   struct remote_state *rs = get_remote_state ();
   struct remote_arch_state *rsa = get_remote_arch_state ();
@@ -5709,7 +5709,7 @@ remote_store_registers (struct target_op
 	 possible; we often change only a small number of registers.
 	 Sometimes we change a larger number; we'd need help from a
 	 higher layer to know to use 'G'.  */
-      if (store_register_using_P (regcache, reg))
+      if (store_register_using_p (regcache, reg))
 	return;
 
       /* For now, don't complain if we have no way to write the
@@ -5719,15 +5719,15 @@ remote_store_registers (struct target_op
       if (!reg->in_g_packet)
 	return;
 
-      store_registers_using_G (regcache);
+      store_registers_using_g (regcache);
       return;
     }
 
-  store_registers_using_G (regcache);
+  store_registers_using_g (regcache);
 
   for (i = 0; i < gdbarch_num_regs (get_regcache_arch (regcache)); i++)
     if (!rsa->regs[i].in_g_packet)
-      if (!store_register_using_P (regcache, &rsa->regs[i]))
+      if (!store_register_using_p (regcache, &rsa->regs[i]))
 	/* See above for why we do not issue an error here.  */
 	continue;
 }
@@ -7387,7 +7387,7 @@ remote_remove_breakpoint (struct gdbarch
 }
 
 static int
-watchpoint_to_Z_packet (int type)
+watchpoint_to_z_packet (int type)
 {
   switch (type)
     {
@@ -7411,7 +7411,7 @@ remote_insert_watchpoint (CORE_ADDR addr
 {
   struct remote_state *rs = get_remote_state ();
   char *p;
-  enum Z_packet_type packet = watchpoint_to_Z_packet (type);
+  enum Z_packet_type packet = watchpoint_to_z_packet (type);
 
   if (remote_protocol_packets[PACKET_Z0 + packet].support ==
PACKET_DISABLE)
     return 1;
@@ -7444,7 +7444,7 @@ remote_remove_watchpoint (CORE_ADDR addr
 {
   struct remote_state *rs = get_remote_state ();
   char *p;
-  enum Z_packet_type packet = watchpoint_to_Z_packet (type);
+  enum Z_packet_type packet = watchpoint_to_z_packet (type);
 
   if (remote_protocol_packets[PACKET_Z0 + packet].support ==
PACKET_DISABLE)
     return -1;
@@ -10445,8 +10445,8 @@ Set use of remote protocol `Z' packets")
 Show use of remote protocol `Z' packets "), _("\
 When set, GDB will attempt to use the remote breakpoint and watchpoint\n\
 packets."),
-				set_remote_protocol_Z_packet_cmd,
-				show_remote_protocol_Z_packet_cmd, /* FIXME:
i18n: Use of remote protocol `Z' packets is %s.  */
+				set_remote_protocol_z_packet_cmd,
+				show_remote_protocol_z_packet_cmd, /* FIXME:
i18n: Use of remote protocol `Z' packets is %s.  */
 				&remote_set_cmdlist, &remote_show_cmdlist);
 
   add_prefix_cmd ("remote", class_files, remote_command, _("\
Index: src/gdb/sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.78
diff -u -p -r1.78 sol-thread.c
--- src/gdb/sol-thread.c	1 Jan 2010 07:31:41 -0000	1.78
+++ src/gdb/sol-thread.c	4 May 2010 22:33:29 -0000
@@ -1107,11 +1107,11 @@ ps_pdmodel (gdb_ps_prochandle_t ph, int 
    of libthread_db would fail because of ps_lgetLDT being undefined.  */
 
 ps_err_e
-ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid, /* ARI: editCase
function */
 	    struct ssd *pldt)
 {
   /* NOTE: only used on Solaris, therefore OK to refer to procfs.c.  */
-  extern struct ssd *procfs_find_LDT_entry (ptid_t);
+  extern struct ssd *procfs_find_ldt_entry (ptid_t);
   struct ssd *ret;
 
   /* FIXME: can't I get the process ID from the prochandle or
@@ -1120,7 +1120,7 @@ ps_lgetLDT (gdb_ps_prochandle_t ph, lwpi
   if (PIDGET (inferior_ptid) <= 0 || lwpid <= 0)
     return PS_BADLID;
 
-  ret = procfs_find_LDT_entry (BUILD_LWP (lwpid, PIDGET (inferior_ptid)));
+  ret = procfs_find_ldt_entry (BUILD_LWP (lwpid, PIDGET (inferior_ptid)));
   if (ret)
     {
       memcpy (pldt, ret, sizeof (struct ssd));
Index: src/gdb/windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.208
diff -u -p -r1.208 windows-nat.c
--- src/gdb/windows-nat.c	16 Apr 2010 07:49:35 -0000	1.208
+++ src/gdb/windows-nat.c	4 May 2010 22:15:04 -0000
@@ -2522,50 +2522,53 @@ _initialize_check_for_gdb_ini (void)
 }
 
 /* Define dummy functions which always return error for the rare cases
where
-   these functions could not be found. */
+   these functions could not be found.
+   Those functions mix upper and lowercase characters as they follow
+   the name in the windows API.
+   We use ARI comment to avoid a warining on A.R.I. page.  */
 static BOOL WINAPI
-bad_DebugActiveProcessStop (DWORD w)
+bad_DebugActiveProcessStop (DWORD w) /* ARI: editCase function */
 {
   return FALSE;
 }
 static BOOL WINAPI
-bad_DebugBreakProcess (HANDLE w)
+bad_DebugBreakProcess (HANDLE w) /* ARI: editCase function */
 {
   return FALSE;
 }
 static BOOL WINAPI
-bad_DebugSetProcessKillOnExit (BOOL w)
+bad_DebugSetProcessKillOnExit (BOOL w) /* ARI: editCase function */
 {
   return FALSE;
 }
 static BOOL WINAPI
-bad_EnumProcessModules (HANDLE w, HMODULE *x, DWORD y, LPDWORD z)
+bad_EnumProcessModules (HANDLE w, HMODULE *x, DWORD y, LPDWORD z) /* ARI:
editCase function */
 {
   return FALSE;
 }
 
 #ifdef __USEWIDE
 static DWORD WINAPI
-bad_GetModuleFileNameExW (HANDLE w, HMODULE x, LPWSTR y, DWORD z)
+bad_GetModuleFileNameExW (HANDLE w, HMODULE x, LPWSTR y, DWORD z) /* ARI:
editCase function */
 {
   return 0;
 }
 #else
 static DWORD WINAPI
-bad_GetModuleFileNameExA (HANDLE w, HMODULE x, LPSTR y, DWORD z)
+bad_GetModuleFileNameExA (HANDLE w, HMODULE x, LPSTR y, DWORD z) /* ARI:
editCase function */
 {
   return 0;
 }
 #endif
 
 static BOOL WINAPI
-bad_GetModuleInformation (HANDLE w, HMODULE x, LPMODULEINFO y, DWORD z)
+bad_GetModuleInformation (HANDLE w, HMODULE x, LPMODULEINFO y, DWORD z) /*
ARI: editCase function */
 {
   return FALSE;
 }
 
 static BOOL WINAPI
-bad_OpenProcessToken (HANDLE w, DWORD x, PHANDLE y)
+bad_OpenProcessToken (HANDLE w, DWORD x, PHANDLE y) /* ARI: editCase
function */
 {
   return FALSE;
 }



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

* Re: [ARI] Remove all editCase warnings
  2010-05-04 23:25 [ARI] Remove all editCase warnings Pierre Muller
@ 2010-05-04 23:32 ` Stan Shebs
  2010-05-04 23:44 ` Pedro Alves
  1 sibling, 0 replies; 14+ messages in thread
From: Stan Shebs @ 2010-05-04 23:32 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

Pierre Muller wrote:
>   	* remote.c (set_remote_protocol_Z_packet_cmd): Rename to...
> 	(set_remote_protocol_z_packet_cmd): ...this.
> 	(show_remote_protocol_Z_packet_cmd): Rename to...
> 	(show_remote_protocol_z_packet_cmd): ...this.
> 	(store_register_using_P): Rename to...
> 	(store_register_using_p): ...this.
> 	(store_register_using_G): Rename to...
> 	(store_register_using_g): ...this.
> 	(remote_store_registers): Adapt to name changes above.
> 	(watchpoint_to_Z_packet): Rename to...
> 	(watchpoint_to_z_packet): ...this.
> 	(remote_insert_watchpoint): Adapt to name chage above.
> 	(remote_remove_watchpoint): Likewise.
> 	(_initialize_remote): Adapt to name changes above.
> 	

Let's make an exception for these, because the upper-case letters in the 
names refer to specific packets, and for some of these packets there are 
other packets that use the corresponding lower-case letter.  So there is 
some major confusion potential with this change.

Stan


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

* Re: [ARI] Remove all editCase warnings
  2010-05-04 23:25 [ARI] Remove all editCase warnings Pierre Muller
  2010-05-04 23:32 ` Stan Shebs
@ 2010-05-04 23:44 ` Pedro Alves
  2010-05-04 23:51   ` Michael Snyder
  2010-05-05  9:03   ` Pierre Muller
  1 sibling, 2 replies; 14+ messages in thread
From: Pedro Alves @ 2010-05-04 23:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pierre Muller

On Wednesday 05 May 2010 00:25:48, Pierre Muller wrote:
>         ARI: Fix editCase.
>         * ada-lang.c (ada_remove_Xbn_suffix): Rename to...
>         (ada_remove_xbn_suffix): ...this.

The function really removes "X", not "x".

>         * addrmap.c (splay_compare_CORE_ADDR_ptr): Rename to...
>         (splay_compare_core_addr_ptr): ...this.

errr.  Don't care.

>         * hppa-tdep.c (hppa_extract_5R_store): Rename to...
>         (hppa_extract_r_store): ...this.

I don't know this code at all, but I wouldn't be suprised
if the 5r vs 5R had meaning to someone knowing hppa.  (there's
a "5r" variant of this function above the "5R" variant.)  E.g.,:

 int hppa_extract_5_load (unsigned int);
 unsigned hppa_extract_5R_store (unsigned int);
 unsigned hppa_extract_5r_store (unsigned int);

>         * ia64-tdep.c (slotN_contents): Rename to...
>         (slotn_contents): ...this.
>         (replace_slotN_contents): Rename to...
>         (replace_slotn_contents): ...this.

No comments.  But I bet whoever wrote this was well aware
of our coding conventions and still chose an uppercase N.


>         * remote.c (set_remote_protocol_Z_packet_cmd): Rename to...
>         (set_remote_protocol_z_packet_cmd): ...this.
>         (show_remote_protocol_Z_packet_cmd): Rename to...
>         (show_remote_protocol_z_packet_cmd): ...this.
>         (store_register_using_P): Rename to...
>         (store_register_using_p): ...this.
>         (store_register_using_G): Rename to...
>         (store_register_using_g): ...this.
>         (remote_store_registers): Adapt to name changes above.
>         (watchpoint_to_Z_packet): Rename to...
>         (watchpoint_to_z_packet): ...this.

I'd rather not.  Z, z, P, G, g, are all distinct packets, uppercase
having the opposite effect of lowercase.  Example, you really store
with G, not g, which is for fetches (note the `fetch_registers_using_g'
function).

>         * sol-thread.c (ps_lgetLDT): Add ARI comment for editCase.
>         Adapt to name change in procfs.c source.

I'd bet this spelling was the reason for the `procfs_find_LDT_entry'
spelling in procfs.c.  ps_lgetLDT is the main caller
of `procfs_find_LDT_entry'.

>         * windows-nat.c (_initialize_check_for_gdb_ini): Add ARI
>         comment to all windows API replacement functions.

Honestly, I think this rule is one of those that generates
work for not such a great reason.  IMO, code review enough catches
all the bad cases before they get to the tree.

-- 
Pedro Alves


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

* Re: [ARI] Remove all editCase warnings
  2010-05-04 23:44 ` Pedro Alves
@ 2010-05-04 23:51   ` Michael Snyder
  2010-05-05  9:03   ` Pierre Muller
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Snyder @ 2010-05-04 23:51 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Pierre Muller

Pedro Alves wrote:
> On Wednesday 05 May 2010 00:25:48, Pierre Muller wrote:
>>         ARI: Fix editCase.

> 
>>         * remote.c (set_remote_protocol_Z_packet_cmd): Rename to...
>>         (set_remote_protocol_z_packet_cmd): ...this.
>>         (show_remote_protocol_Z_packet_cmd): Rename to...
>>         (show_remote_protocol_z_packet_cmd): ...this.
>>         (store_register_using_P): Rename to...
>>         (store_register_using_p): ...this.
>>         (store_register_using_G): Rename to...
>>         (store_register_using_g): ...this.
>>         (remote_store_registers): Adapt to name changes above.
>>         (watchpoint_to_Z_packet): Rename to...
>>         (watchpoint_to_z_packet): ...this.
> 
> I'd rather not.  Z, z, P, G, g, are all distinct packets, uppercase
> having the opposite effect of lowercase.  Example, you really store
> with G, not g, which is for fetches (note the `fetch_registers_using_g'
> function).

I agree with Pedro and Stan.


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

* RE: [ARI] Remove all editCase warnings
  2010-05-04 23:44 ` Pedro Alves
  2010-05-04 23:51   ` Michael Snyder
@ 2010-05-05  9:03   ` Pierre Muller
  2010-05-05 14:54     ` Joel Brobecker
  2010-05-05 15:11     ` Pedro Alves
  1 sibling, 2 replies; 14+ messages in thread
From: Pierre Muller @ 2010-05-05  9:03 UTC (permalink / raw)
  To: 'Pedro Alves', gdb-patches

> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : Wednesday, May 05, 2010 1:44 AM
> À : gdb-patches@sourceware.org
> Cc : Pierre Muller
> Objet : Re: [ARI] Remove all editCase warnings
> 
> On Wednesday 05 May 2010 00:25:48, Pierre Muller wrote:
> >         ARI: Fix editCase.
> >         * ada-lang.c (ada_remove_Xbn_suffix): Rename to...
> >         (ada_remove_xbn_suffix): ...this.
> 
> The function really removes "X", not "x".

  You are right.
 
> >         * addrmap.c (splay_compare_CORE_ADDR_ptr): Rename to...
> >         (splay_compare_core_addr_ptr): ...this.
> 
> errr.  Don't care.

  I also don't really care...
 
> >         * hppa-tdep.c (hppa_extract_5R_store): Rename to...
> >         (hppa_extract_r_store): ...this.
> 
> I don't know this code at all, but I wouldn't be suprised
> if the 5r vs 5R had meaning to someone knowing hppa.  (there's
  You are also most probably right.
> a "5r" variant of this function above the "5R" variant.)  E.g.,:
  I view that, that is why I used 5_r to replace 5R and not simply 5r... 
>  int hppa_extract_5_load (unsigned int);
>  unsigned hppa_extract_5R_store (unsigned int);
>  unsigned hppa_extract_5r_store (unsigned int);
  
  
 
> >         * ia64-tdep.c (slotN_contents): Rename to...
> >         (slotn_contents): ...this.
> >         (replace_slotN_contents): Rename to...
> >         (replace_slotn_contents): ...this.
> 
> No comments.  But I bet whoever wrote this was well aware
> of our coding conventions and still chose an uppercase N.

  That's 
> 
> >         * remote.c (set_remote_protocol_Z_packet_cmd): Rename to...
> >         (set_remote_protocol_z_packet_cmd): ...this.
> >         (show_remote_protocol_Z_packet_cmd): Rename to...
> >         (show_remote_protocol_z_packet_cmd): ...this.
> >         (store_register_using_P): Rename to...
> >         (store_register_using_p): ...this.
> >         (store_register_using_G): Rename to...
> >         (store_register_using_g): ...this.
> >         (remote_store_registers): Adapt to name changes above.
> >         (watchpoint_to_Z_packet): Rename to...
> >         (watchpoint_to_z_packet): ...this.
> 
> I'd rather not.  Z, z, P, G, g, are all distinct packets, uppercase
> having the opposite effect of lowercase.  Example, you really store
> with G, not g, which is for fetches (note the `fetch_registers_using_g'
> function).

   Here I completely agree, I forgot that there were
lowercase g and z packets.
 
> >         * sol-thread.c (ps_lgetLDT): Add ARI comment for editCase.
> >         Adapt to name change in procfs.c source.
> 
> I'd bet this spelling was the reason for the `procfs_find_LDT_entry'
> spelling in procfs.c.  ps_lgetLDT is the main caller
> of `procfs_find_LDT_entry'. 
> >         * windows-nat.c (_initialize_check_for_gdb_ini): Add ARI
> >         comment to all windows API replacement functions.
> 
> Honestly, I think this rule is one of those that generates
> work for not such a great reason.  IMO, code review enough catches
> all the bad cases before they get to the tree.
 
  My idea was to get rid of all issues so that I could mark that
rule as a regression, and that it would thus get a much greater
impact if new code would use such mixed case function names.
  
  This way, we could either decide that the mixed case is not
necessary and lowercase the function name, or add an ARI comment to accept
that exception.

  I would tend to agree that adding an ARI comment is probably justified on
most of these 18 functions.
  The only ones I am not sure about are:
  - splay_compare_CORE_ADDR_ptr in addrmap.c
there are numerous other functions refereeing to CORE_ADDR type without
using uppercase:
$ grep "^[a-z_0-9]*core_addr" *
arch-utils.c:core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)
arch-utils.c:core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs)
arch-utils.c:core_addr_identity (struct gdbarch *gdbarch, CORE_ADDR addr)
proc-service.c:ps_addr_to_core_addr (psaddr_t addr)
proc-service.c:core_addr_to_ps_addr (CORE_ADDR addr)
ui-out.c:ui_out_field_core_addr (struct ui_out *uiout,
utils.c:core_addr_to_string (const CORE_ADDR addr)
utils.c:core_addr_to_string_nz (const CORE_ADDR addr)
utils.c:string_to_core_addr (const char *my_string)
  
  So I would like to eliminate that one.

  - the other two are
proc_get_LDT_entry and procfs_find_LDT_entry in procfs.c

these two functions are only called by 
ps_lgetLDT inside sol-thread.c, which is, according to the comment
required by libthread_db solaris library. 
  But I do not know if this also justifies propagating the uppercase use
to the called functions in procfs.c

  Please tell me how I should proceed.

Pierre



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

* Re: [ARI] Remove all editCase warnings
  2010-05-05  9:03   ` Pierre Muller
@ 2010-05-05 14:54     ` Joel Brobecker
  2010-05-05 15:11     ` Pedro Alves
  1 sibling, 0 replies; 14+ messages in thread
From: Joel Brobecker @ 2010-05-05 14:54 UTC (permalink / raw)
  To: Pierre Muller; +Cc: 'Pedro Alves', gdb-patches

I agree that this is one of these ARI rules which bring little benefit.
Or perhaps it was meant to catch CamelCase names rather than any
uppercase letter in function names? In any case, here are my 2 cents...


> > >         * ia64-tdep.c (slotN_contents): Rename to...
> > >         (slotn_contents): ...this.
> > >         (replace_slotN_contents): Rename to...
> > >         (replace_slotn_contents): ...this.
> > 
> > No comments.  But I bet whoever wrote this was well aware
> > of our coding conventions and still chose an uppercase N.

Wow, the file was introduced in March 2000, it's 10 years old!
In any case, it was introduced by Kevin Buettner.

If I was the author, I'd have no preference over N or n. But if we
change it to n, can we add an underscore? slot_n_contents and
replace_slot_n_contents? I think that will be slightly easier
to read...

>   - splay_compare_CORE_ADDR_ptr in addrmap.c
> there are numerous other functions refereeing to CORE_ADDR type without
> using uppercase:

It's fine to change it to splay_compare_core_addr_ptr AFAIAC.

>   - the other two are
> proc_get_LDT_entry and procfs_find_LDT_entry in procfs.c
> 
> these two functions are only called by 
> ps_lgetLDT inside sol-thread.c, which is, according to the comment
> required by libthread_db solaris library. 
>   But I do not know if this also justifies propagating the uppercase use
> to the called functions in procfs.c

No preference on my end.  We probably already have some routines that
use lowercase accronyms, so it wouldn't be something new. But it would
be fine to tolerate the use of uppercase accronyms too (IMO).

-- 
Joel


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

* Re: [ARI] Remove all editCase warnings
  2010-05-05  9:03   ` Pierre Muller
  2010-05-05 14:54     ` Joel Brobecker
@ 2010-05-05 15:11     ` Pedro Alves
  2010-05-05 16:09       ` Pierre Muller
  1 sibling, 1 reply; 14+ messages in thread
From: Pedro Alves @ 2010-05-05 15:11 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

On Wednesday 05 May 2010 10:03:23, Pierre Muller wrote:
>  
> > >         * hppa-tdep.c (hppa_extract_5R_store): Rename to...
> > >         (hppa_extract_r_store): ...this.
> > 
> > I don't know this code at all, but I wouldn't be suprised
> > if the 5r vs 5R had meaning to someone knowing hppa.  (there's
>   You are also most probably right.
> > a "5r" variant of this function above the "5R" variant.)  E.g.,:
>   I view that, that is why I used 5_r to replace 5R and not simply 5r... 
> >  int hppa_extract_5_load (unsigned int);
> >  unsigned hppa_extract_5R_store (unsigned int);
> >  unsigned hppa_extract_5r_store (unsigned int);

IMO, that's really much more error prone:

 unsigned hppa_extract_5_r_store (unsigned int);
 unsigned hppa_extract_5r_store (unsigned int);

Even easier to confuse the two...  Unless we have better, self
describing names (which would probably require someone knowing
hppa stepping in) let's leave this untouched.

> > Honestly, I think this rule is one of those that generates
> > work for not such a great reason.  IMO, code review enough catches
> > all the bad cases before they get to the tree.
>  
>   My idea was to get rid of all issues so that I could mark that
> rule as a regression, and that it would thus get a much greater
> impact if new code would use such mixed case function names.

What impact do you expect here?  Speaking for myself, if I review
a patch, and I see something uppercased, and I don't think it fits
right in the coding conventions, I'll say so during review.  If I feel
the uppercase is okay, I'll either remember to ask to uglify the
sources by adding an ARI expection marker, or, I'll more likely
forget it, and we'll get a nag email from the ARI script, causing
us have to do unproductive work to fix it.  Neither of the last two
options seems attractive to me.

>   The only ones I am not sure about are:
>   - splay_compare_CORE_ADDR_ptr in addrmap.c
> there are numerous other functions refereeing to CORE_ADDR type without
> using uppercase:
> $ grep "^[a-z_0-9]*core_addr" *
> arch-utils.c:core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)
> arch-utils.c:core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs)
> arch-utils.c:core_addr_identity (struct gdbarch *gdbarch, CORE_ADDR addr)
> proc-service.c:ps_addr_to_core_addr (psaddr_t addr)
> proc-service.c:core_addr_to_ps_addr (CORE_ADDR addr)
> ui-out.c:ui_out_field_core_addr (struct ui_out *uiout,
> utils.c:core_addr_to_string (const CORE_ADDR addr)
> utils.c:core_addr_to_string_nz (const CORE_ADDR addr)
> utils.c:string_to_core_addr (const char *my_string)
>   
>   So I would like to eliminate that one.

Okay, fine with me.

>   - the other two are
> proc_get_LDT_entry and procfs_find_LDT_entry in procfs.c
> 
> these two functions are only called by 
> ps_lgetLDT inside sol-thread.c, which is, according to the comment
> required by libthread_db solaris library. 
>   But I do not know if this also justifies propagating the uppercase use
> to the called functions in procfs.c

In this case, between having a distracting ARI marker in the code,
and lowercasing the function name, I prefer the latter.

-- 
Pedro Alves


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

* RE: [ARI] Remove all editCase warnings
  2010-05-05 15:11     ` Pedro Alves
@ 2010-05-05 16:09       ` Pierre Muller
  2010-05-05 16:55         ` Joel Brobecker
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Muller @ 2010-05-05 16:09 UTC (permalink / raw)
  To: 'Pedro Alves'; +Cc: gdb-patches

  After the feedback I got,
here is a second version of this ARI patch.
  Only three functions are lowercase, the
other ones get an ugly /* ARI: editCase function */
comment.
  I have to split some function declarations 
into more lines to avoid getting above the 80 char
line length limit.

  Is this OK?

Pierre Muller
as ARI maintainer


 

2010-05-05  Pierre Muller  <muller@ics.u-strasbg.fr>

	ARI: Fix editCase function rule warnings.
	* ada-lang.c (ada_remove_Xbn_suffix): Add ARI comment for editCase.
	* addrmap.c (splay_compare_CORE_ADDR_ptr): Rename to...
	(splay_compare_core_addr_ptr): ...this.
	(addrmap_create_mutable): Adapt to name change above.
	* hppa-tdep.c (hppa_extract_5R_store): Add ARI comment for editCase.
	* ia64-tdep.c (slotN_contents): Add ARI comment for editCase.
	(replace_slotN_contents): Likewise.
	* procfs.c (proc_get_LDT_entry): Rename to...
	(proc_get_ldt_entry): ...this.
	(procfs_find_LDT_entry): Rename to...
	(procfs_find_ldt_entry): ...this.
	* remote.c (set_remote_protocol_Z_packet_cmd): Add ARI comment for
	editCase.
	(show_remote_protocol_Z_packet_cmd): Likewise.
	(store_register_using_P): Likewise.
	(store_register_using_G): Likewise.
	(watchpoint_to_Z_packet): Likewise.
	* sol-thread.c (ps_lgetLDT): Add ARI comment for editCase.
	* windows-nat.c (bad_DebugActiveProcessStop): Add ARI comment for
	editCase.
	(bad_DebugBreakProcess): Likewise.
	(bad_DebugSetProcessKillOnExit): Likewise.
	(bad_EnumProcessModules): Likewise.
	(bad_GetModuleFileNameExW): Likewise.
	(bad_GetModuleFileNameExA): Likewise.
	(bad_GetModuleInformation): Likewise.
	(bad_OpenProcessToken): Likewise.


Index: src/gdb/ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.258
diff -u -p -r1.258 ada-lang.c
--- src/gdb/ada-lang.c	2 May 2010 21:14:59 -0000	1.258
+++ src/gdb/ada-lang.c	5 May 2010 15:42:06 -0000
@@ -855,7 +855,8 @@ ada_remove_po_subprogram_suffix (const c
 /* Remove trailing X[bn]* suffixes (indicating names in package bodies).
*/
 
 static void
-ada_remove_Xbn_suffix (const char *encoded, int *len)
+ada_remove_Xbn_suffix ( /* ARI: editCase function */
+		       const char *encoded, int *len)
 {
   int i = *len - 1;
 
Index: src/gdb/addrmap.c
===================================================================
RCS file: /cvs/src/src/gdb/addrmap.c,v
retrieving revision 1.7
diff -u -p -r1.7 addrmap.c
--- src/gdb/addrmap.c	1 Jan 2010 07:31:29 -0000	1.7
+++ src/gdb/addrmap.c	5 May 2010 15:42:06 -0000
@@ -491,7 +491,7 @@ splay_obstack_free (void *obj, void *clo
 
 /* Compare keys as CORE_ADDR * values.  */
 static int
-splay_compare_CORE_ADDR_ptr (splay_tree_key ak, splay_tree_key bk)
+splay_compare_core_addr_ptr (splay_tree_key ak, splay_tree_key bk)
 {
   CORE_ADDR a = * (CORE_ADDR *) ak;
   CORE_ADDR b = * (CORE_ADDR *) bk;
@@ -519,7 +519,7 @@ addrmap_create_mutable (struct obstack *
      free list has to be initialized before we create the tree.  */
   map->free_nodes = NULL;
 
-  map->tree = splay_tree_new_with_allocator (splay_compare_CORE_ADDR_ptr,
+  map->tree = splay_tree_new_with_allocator (splay_compare_core_addr_ptr,
                                              NULL, /* no delete key */
                                              NULL, /* no delete value */
                                              splay_obstack_alloc,
Index: src/gdb/hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.273
diff -u -p -r1.273 hppa-tdep.c
--- src/gdb/hppa-tdep.c	19 Jan 2010 09:39:12 -0000	1.273
+++ src/gdb/hppa-tdep.c	5 May 2010 15:42:07 -0000
@@ -115,7 +115,7 @@ hppa_extract_5r_store (unsigned word)
 /* extract the immediate field from a {sr}sm instruction */
 
 unsigned
-hppa_extract_5R_store (unsigned word)
+hppa_extract_5R_store (unsigned word) /* ARI: editCase function */
 {
   return (word >> 16 & MASK_5);
 }
Index: src/gdb/ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.205
diff -u -p -r1.205 ia64-tdep.c
--- src/gdb/ia64-tdep.c	1 Jan 2010 07:31:36 -0000	1.205
+++ src/gdb/ia64-tdep.c	5 May 2010 15:42:08 -0000
@@ -447,7 +447,7 @@ replace_bit_field (char *bundle, long lo
    and instruction bundle */
 
 static long long
-slotN_contents (char *bundle, int slotnum)
+slotN_contents (char *bundle, int slotnum) /* ARI: editCase function */
 {
   return extract_bit_field (bundle, 5+41*slotnum, 41);
 }
@@ -455,7 +455,8 @@ slotN_contents (char *bundle, int slotnu
 /* Store an instruction in an instruction bundle */
 
 static void
-replace_slotN_contents (char *bundle, long long instr, int slotnum)
+replace_slotN_contents (char *bundle, /* ARI: editCase function */
+			long long instr, int slotnum)
 {
   replace_bit_field (bundle, instr, 5+41*slotnum, 41);
 }
Index: src/gdb/procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.131
diff -u -p -r1.131 procfs.c
--- src/gdb/procfs.c	20 Apr 2010 22:36:35 -0000	1.131
+++ src/gdb/procfs.c	5 May 2010 15:42:09 -0000
@@ -2974,7 +2974,7 @@ proc_set_watchpoint (procinfo *pi, CORE_
 #include <sys/sysi86.h>
 
 /*
- * Function: proc_get_LDT_entry
+ * Function: proc_get_ldt_entry
  *
  * Inputs:
  *   procinfo *pi;
@@ -2987,7 +2987,7 @@ proc_set_watchpoint (procinfo *pi, CORE_
  */
 
 struct ssd *
-proc_get_LDT_entry (procinfo *pi, int key)
+proc_get_ldt_entry (procinfo *pi, int key)
 {
   static struct ssd *ldt_entry = NULL;
 #ifdef NEW_PROC_API
@@ -3004,7 +3004,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
   sprintf (pathname, "/proc/%d/ldt", pi->pid);
   if ((fd = open_with_retry (pathname, O_RDONLY)) < 0)
     {
-      proc_warn (pi, "proc_get_LDT_entry (open)", __LINE__);
+      proc_warn (pi, "proc_get_ldt_entry (open)", __LINE__);
       return NULL;
     }
   /* Make sure it gets closed again! */
@@ -3031,7 +3031,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
   /* Get the number of LDT entries.  */
   if (ioctl (pi->ctl_fd, PIOCNLDT, &nldt) < 0)
     {
-      proc_warn (pi, "proc_get_LDT_entry (PIOCNLDT)", __LINE__);
+      proc_warn (pi, "proc_get_ldt_entry (PIOCNLDT)", __LINE__);
       return NULL;
     }
 
@@ -3047,7 +3047,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
   /* Read the whole table in one gulp.  */
   if (ioctl (pi->ctl_fd, PIOCLDT, ldt_entry) < 0)
     {
-      proc_warn (pi, "proc_get_LDT_entry (PIOCLDT)", __LINE__);
+      proc_warn (pi, "proc_get_ldt_entry (PIOCLDT)", __LINE__);
       return NULL;
     }
 
@@ -3062,7 +3062,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
 }
 
 /*
- * Function: procfs_find_LDT_entry
+ * Function: procfs_find_ldt_entry
  *
  * Input:
  *   ptid_t ptid;	// The GDB-style pid-plus-LWP.
@@ -3072,7 +3072,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
  */
 
 struct ssd *
-procfs_find_LDT_entry (ptid_t ptid)
+procfs_find_ldt_entry (ptid_t ptid)
 {
   gdb_gregset_t *gregs;
   int            key;
@@ -3081,14 +3081,14 @@ procfs_find_LDT_entry (ptid_t ptid)
   /* Find procinfo for the lwp. */
   if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL)
     {
-      warning (_("procfs_find_LDT_entry: could not find procinfo for
%d:%ld."),
+      warning (_("procfs_find_ldt_entry: could not find procinfo for
%d:%ld."),
 	       PIDGET (ptid), TIDGET (ptid));
       return NULL;
     }
   /* get its general registers. */
   if ((gregs = proc_get_gregs (pi)) == NULL)
     {
-      warning (_("procfs_find_LDT_entry: could not read gregs for
%d:%ld."),
+      warning (_("procfs_find_ldt_entry: could not read gregs for
%d:%ld."),
 	       PIDGET (ptid), TIDGET (ptid));
       return NULL;
     }
@@ -3096,7 +3096,7 @@ procfs_find_LDT_entry (ptid_t ptid)
   key = (*gregs)[GS] & 0xffff;
 
   /* Find the matching entry and return it. */
-  return proc_get_LDT_entry (pi, key);
+  return proc_get_ldt_entry (pi, key);
 }
 
 #endif
Index: src/gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.405
diff -u -p -r1.405 remote.c
--- src/gdb/remote.c	5 May 2010 15:05:57 -0000	1.405
+++ src/gdb/remote.c	5 May 2010 15:42:11 -0000
@@ -1217,8 +1217,8 @@ enum Z_packet_type
 static enum auto_boolean remote_Z_packet_detect;
 
 static void
-set_remote_protocol_Z_packet_cmd (char *args, int from_tty,
-				  struct cmd_list_element *c)
+set_remote_protocol_Z_packet_cmd (char *args, /* ARI: editCase function */
+				  int from_tty, struct cmd_list_element *c)
 {
   int i;
   for (i = 0; i < NR_Z_PACKET_TYPES; i++)
@@ -1229,7 +1229,8 @@ set_remote_protocol_Z_packet_cmd (char *
 }
 
 static void
-show_remote_protocol_Z_packet_cmd (struct ui_file *file, int from_tty,
+show_remote_protocol_Z_packet_cmd (/* ARI: editCase function */
+				   struct ui_file *file, int from_tty,
 				   struct cmd_list_element *c,
 				   const char *value)
 {
@@ -5612,7 +5613,8 @@ remote_prepare_to_store (struct regcache
    packet was not recognized.  */
 
 static int
-store_register_using_P (const struct regcache *regcache, 
+store_register_using_P ( /* ARI: editCase function */ 
+			const struct regcache *regcache,
 			struct packet_reg *reg)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -5653,7 +5655,8 @@ store_register_using_P (const struct reg
    contents of the register cache buffer.  FIXME: ignores errors.  */
 
 static void
-store_registers_using_G (const struct regcache *regcache)
+store_registers_using_G ( /* ARI: editCase function */
+			 const struct regcache *regcache)
 {
   struct remote_state *rs = get_remote_state ();
   struct remote_arch_state *rsa = get_remote_arch_state ();
@@ -7387,7 +7390,7 @@ remote_remove_breakpoint (struct gdbarch
 }
 
 static int
-watchpoint_to_Z_packet (int type)
+watchpoint_to_Z_packet (int type) /* ARI: editCase function */
 {
   switch (type)
     {
Index: src/gdb/sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.78
diff -u -p -r1.78 sol-thread.c
--- src/gdb/sol-thread.c	1 Jan 2010 07:31:41 -0000	1.78
+++ src/gdb/sol-thread.c	5 May 2010 15:42:11 -0000
@@ -1107,11 +1107,11 @@ ps_pdmodel (gdb_ps_prochandle_t ph, int 
    of libthread_db would fail because of ps_lgetLDT being undefined.  */
 
 ps_err_e
-ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid, /* ARI: editCase
function */
 	    struct ssd *pldt)
 {
   /* NOTE: only used on Solaris, therefore OK to refer to procfs.c.  */
-  extern struct ssd *procfs_find_LDT_entry (ptid_t);
+  extern struct ssd *procfs_find_ldt_entry (ptid_t);
   struct ssd *ret;
 
   /* FIXME: can't I get the process ID from the prochandle or
@@ -1120,7 +1120,7 @@ ps_lgetLDT (gdb_ps_prochandle_t ph, lwpi
   if (PIDGET (inferior_ptid) <= 0 || lwpid <= 0)
     return PS_BADLID;
 
-  ret = procfs_find_LDT_entry (BUILD_LWP (lwpid, PIDGET (inferior_ptid)));
+  ret = procfs_find_ldt_entry (BUILD_LWP (lwpid, PIDGET (inferior_ptid)));
   if (ret)
     {
       memcpy (pldt, ret, sizeof (struct ssd));
Index: src/gdb/windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.208
diff -u -p -r1.208 windows-nat.c
--- src/gdb/windows-nat.c	16 Apr 2010 07:49:35 -0000	1.208
+++ src/gdb/windows-nat.c	5 May 2010 15:42:12 -0000
@@ -2522,50 +2522,57 @@ _initialize_check_for_gdb_ini (void)
 }
 
 /* Define dummy functions which always return error for the rare cases
where
-   these functions could not be found. */
+   these functions could not be found.
+   Those functions mix upper and lowercase characters as they follow
+   the name in the windows API.
+   We use ARI comment to avoid a warining on A.R.I. page.  */
 static BOOL WINAPI
-bad_DebugActiveProcessStop (DWORD w)
+bad_DebugActiveProcessStop (DWORD w) /* ARI: editCase function */
 {
   return FALSE;
 }
 static BOOL WINAPI
-bad_DebugBreakProcess (HANDLE w)
+bad_DebugBreakProcess (HANDLE w) /* ARI: editCase function */
 {
   return FALSE;
 }
 static BOOL WINAPI
-bad_DebugSetProcessKillOnExit (BOOL w)
+bad_DebugSetProcessKillOnExit (BOOL w) /* ARI: editCase function */
 {
   return FALSE;
 }
 static BOOL WINAPI
-bad_EnumProcessModules (HANDLE w, HMODULE *x, DWORD y, LPDWORD z)
+bad_EnumProcessModules (HANDLE w, /* ARI: editCase function */
+			HMODULE *x, DWORD y, LPDWORD z)
 {
   return FALSE;
 }
 
 #ifdef __USEWIDE
 static DWORD WINAPI
-bad_GetModuleFileNameExW (HANDLE w, HMODULE x, LPWSTR y, DWORD z)
+bad_GetModuleFileNameExW (HANDLE w, /* ARI: editCase function */
+			  HMODULE x, LPWSTR y, DWORD z)
 {
   return 0;
 }
 #else
 static DWORD WINAPI
-bad_GetModuleFileNameExA (HANDLE w, HMODULE x, LPSTR y, DWORD z)
+bad_GetModuleFileNameExA (HANDLE w, /* ARI: editCase function */
+			  HMODULE x, LPSTR y, DWORD z)
 {
   return 0;
 }
 #endif
 
 static BOOL WINAPI
-bad_GetModuleInformation (HANDLE w, HMODULE x, LPMODULEINFO y, DWORD z)
+bad_GetModuleInformation (HANDLE w, /* ARI: editCase function */
+			  HMODULE x, LPMODULEINFO y, DWORD z)
 {
   return FALSE;
 }
 
 static BOOL WINAPI
-bad_OpenProcessToken (HANDLE w, DWORD x, PHANDLE y)
+bad_OpenProcessToken (HANDLE w, DWORD x, PHANDLE y) /* ARI: editCase
function */
 {
   return FALSE;
 }


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

* Re: [ARI] Remove all editCase warnings
  2010-05-05 16:09       ` Pierre Muller
@ 2010-05-05 16:55         ` Joel Brobecker
  2010-05-05 17:15           ` Stan Shebs
  2010-05-05 18:34           ` Daniel Jacobowitz
  0 siblings, 2 replies; 14+ messages in thread
From: Joel Brobecker @ 2010-05-05 16:55 UTC (permalink / raw)
  To: Pierre Muller; +Cc: 'Pedro Alves', gdb-patches

>  static void
> -ada_remove_Xbn_suffix (const char *encoded, int *len)
> +ada_remove_Xbn_suffix ( /* ARI: editCase function */
> +		       const char *encoded, int *len)

I would rather have:

ada_remove_Xbn_suffix /* ARI: editCase function */
  (const char *encoded, int *len)

This applies to the rest of the patch, where we have the comment
embedded right in the middle of parameter declaration... For instance:

>  static void
> -replace_slotN_contents (char *bundle, long long instr, int slotnum)
> +replace_slotN_contents (char *bundle, /* ARI: editCase function */
> +			long long instr, int slotnum)

What do others think?

-- 
Joel


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

* Re: [ARI] Remove all editCase warnings
  2010-05-05 16:55         ` Joel Brobecker
@ 2010-05-05 17:15           ` Stan Shebs
  2010-05-05 21:03             ` Pierre Muller
  2010-05-05 18:34           ` Daniel Jacobowitz
  1 sibling, 1 reply; 14+ messages in thread
From: Stan Shebs @ 2010-05-05 17:15 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Pierre Muller, 'Pedro Alves', gdb-patches

Joel Brobecker wrote:
>>  static void
>> -ada_remove_Xbn_suffix (const char *encoded, int *len)
>> +ada_remove_Xbn_suffix ( /* ARI: editCase function */
>> +		       const char *encoded, int *len)
>>     
>
> I would rather have:
>
> ada_remove_Xbn_suffix /* ARI: editCase function */
>   (const char *encoded, int *len)
>   

I frequently grep for "foo (", so this would cause the function to be 
overlooked.  But, fewer grep results means less work when changing the 
code... :-)

Stan


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

* Re: [ARI] Remove all editCase warnings
  2010-05-05 16:55         ` Joel Brobecker
  2010-05-05 17:15           ` Stan Shebs
@ 2010-05-05 18:34           ` Daniel Jacobowitz
  2010-05-05 18:37             ` Joel Brobecker
  1 sibling, 1 reply; 14+ messages in thread
From: Daniel Jacobowitz @ 2010-05-05 18:34 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Pierre Muller, 'Pedro Alves', gdb-patches

On Wed, May 05, 2010 at 09:55:29AM -0700, Joel Brobecker wrote:
> >  static void
> > -ada_remove_Xbn_suffix (const char *encoded, int *len)
> > +ada_remove_Xbn_suffix ( /* ARI: editCase function */
> > +		       const char *encoded, int *len)
> 
> I would rather have:
> 
> ada_remove_Xbn_suffix /* ARI: editCase function */
>   (const char *encoded, int *len)
> 
> This applies to the rest of the patch, where we have the comment
> embedded right in the middle of parameter declaration... For instance:

Frankly, I'd rather we just dropped this ARI rule.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [ARI] Remove all editCase warnings
  2010-05-05 18:34           ` Daniel Jacobowitz
@ 2010-05-05 18:37             ` Joel Brobecker
  0 siblings, 0 replies; 14+ messages in thread
From: Joel Brobecker @ 2010-05-05 18:37 UTC (permalink / raw)
  To: Pierre Muller, 'Pedro Alves', gdb-patches

> > This applies to the rest of the patch, where we have the comment
> > embedded right in the middle of parameter declaration... For instance:
> 
> Frankly, I'd rather we just dropped this ARI rule.

No objection here :)

-- 
Joel


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

* RE: [ARI] Remove all editCase warnings
  2010-05-05 17:15           ` Stan Shebs
@ 2010-05-05 21:03             ` Pierre Muller
  2010-05-06 18:10               ` Joel Brobecker
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Muller @ 2010-05-05 21:03 UTC (permalink / raw)
  To: 'Stan Shebs', 'Joel Brobecker'
  Cc: 'Pedro Alves', gdb-patches



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Stan Shebs
> Envoyé : Wednesday, May 05, 2010 7:16 PM
> À : Joel Brobecker
> Cc : Pierre Muller; 'Pedro Alves'; gdb-patches@sourceware.org
> Objet : Re: [ARI] Remove all editCase warnings
> 
> Joel Brobecker wrote:
> >>  static void
> >> -ada_remove_Xbn_suffix (const char *encoded, int *len)
> >> +ada_remove_Xbn_suffix ( /* ARI: editCase function */
> >> +		       const char *encoded, int *len)
> >>
> >
> > I would rather have:
> >
> > ada_remove_Xbn_suffix /* ARI: editCase function */
> >   (const char *encoded, int *len)
> >
> 
> I frequently grep for "foo (", so this would cause the function to be
> overlooked.  But, fewer grep results means less work when changing the
> code... :-)
  That is also what is done inside gdb_ari.sh,
which means that it is not possible to fulfill
Joel's request.

  Eliminating the ' (' in the pattern would probably lead to lots of
false positive.

  I don't know what to think now...

  I fully agree that this is not one of the important 
rules, but I hoped that clearing up more fields would make
the ARI more efficient.
  Simply removing the rule is not better than 
leaving the source code unchanged in my opinion,
but I will follow the consensus if we reach one.

  
Pierre



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

* Re: [ARI] Remove all editCase warnings
  2010-05-05 21:03             ` Pierre Muller
@ 2010-05-06 18:10               ` Joel Brobecker
  0 siblings, 0 replies; 14+ messages in thread
From: Joel Brobecker @ 2010-05-06 18:10 UTC (permalink / raw)
  To: Pierre Muller; +Cc: 'Stan Shebs', 'Pedro Alves', gdb-patches

> Eliminating the ' (' in the pattern would probably lead to lots of
> false positive.

I didn't realize that the ARI depended on that. We may have a few
functions in ada-* whose name is so long that the ( is on the next
line. To be double-checked.

>   I don't know what to think now...

I think everyone agrees that the benefits of having this rule are
very small. I would say that we've spent enough energy trying to
accomodate it, and it's time for it to go...

-- 
Joel


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

end of thread, other threads:[~2010-05-06 18:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-04 23:25 [ARI] Remove all editCase warnings Pierre Muller
2010-05-04 23:32 ` Stan Shebs
2010-05-04 23:44 ` Pedro Alves
2010-05-04 23:51   ` Michael Snyder
2010-05-05  9:03   ` Pierre Muller
2010-05-05 14:54     ` Joel Brobecker
2010-05-05 15:11     ` Pedro Alves
2010-05-05 16:09       ` Pierre Muller
2010-05-05 16:55         ` Joel Brobecker
2010-05-05 17:15           ` Stan Shebs
2010-05-05 21:03             ` Pierre Muller
2010-05-06 18:10               ` Joel Brobecker
2010-05-05 18:34           ` Daniel Jacobowitz
2010-05-05 18:37             ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox