Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 2015 02:33:07 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r277817 - stable/9/contrib/gdb/gdb
Message-ID:  <201501280233.t0S2X7CK022747@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Wed Jan 28 02:33:06 2015
New Revision: 277817
URL: https://svnweb.freebsd.org/changeset/base/277817

Log:
  MFC	r277608, r277656, r277659:
  
  Small upstream fixes for GDB.
  
  GDB: Fix memset thinkos.
  
  2005-03-25  Anthony Green  <green@redhat.com>
  
         * remote.c (remote_store_registers): Fix memset usage.
         * std-regs.c (value_of_builtin_frame_reg): Ditto.
         (value_of_builtin_frame_fp_reg): Ditto.
         (value_of_builtin_frame_reg): Ditto.
  
  Reported by:	Dirk Engling
  
  gdb: Add missing break statements
  
  2004-05-21  Jim Blandy  <jimb@redhat.com>
  
         * dwarf2expr.c (execute_stack_op): Add 'break' statements after
         cases for DW_OP_div and DW_OP_shr.  (Thanks to Reva Cuthbertson.)
  
  GDB: Replace use of sprintf.
  
  2005-03-17  Mark Kettenis  <kettenis@gnu.org>
  
        * corelow.c (get_core_register_section): Replace usage of sprintf
        and strcpy with xstrprintf and xstrdup.
  
  CID:	604160, 604161, 604162, 604163
  CID:	1006819 1008254

Modified:
  stable/9/contrib/gdb/gdb/corelow.c
  stable/9/contrib/gdb/gdb/dwarf2expr.c
  stable/9/contrib/gdb/gdb/remote.c
  stable/9/contrib/gdb/gdb/std-regs.c
Directory Properties:
  stable/9/contrib/gdb/   (props changed)

Modified: stable/9/contrib/gdb/gdb/corelow.c
==============================================================================
--- stable/9/contrib/gdb/gdb/corelow.c	Wed Jan 28 02:25:48 2015	(r277816)
+++ stable/9/contrib/gdb/gdb/corelow.c	Wed Jan 28 02:33:06 2015	(r277817)
@@ -432,15 +432,16 @@ get_core_register_section (char *name,
 			   char *human_name,
 			   int required)
 {
-  char section_name[100];
+  static char *section_name = NULL;
   struct bfd_section *section;
   bfd_size_type size;
   char *contents;
 
+  xfree (section_name);
   if (PIDGET (inferior_ptid))
-    sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid));
+    section_name = xstrprintf ("%s/%d", name, PIDGET (inferior_ptid));
   else
-    strcpy (section_name, name);
+    section_name = xstrdup (name);
 
   section = bfd_get_section_by_name (core_bfd, section_name);
   if (! section)

Modified: stable/9/contrib/gdb/gdb/dwarf2expr.c
==============================================================================
--- stable/9/contrib/gdb/gdb/dwarf2expr.c	Wed Jan 28 02:25:48 2015	(r277816)
+++ stable/9/contrib/gdb/gdb/dwarf2expr.c	Wed Jan 28 02:33:06 2015	(r277817)
@@ -575,6 +575,7 @@ execute_stack_op (struct dwarf_expr_cont
 		break;
 	      case DW_OP_div:
 		binop = BINOP_DIV;
+                break;
 	      case DW_OP_minus:
 		binop = BINOP_SUB;
 		break;
@@ -595,6 +596,7 @@ execute_stack_op (struct dwarf_expr_cont
 		break;
 	      case DW_OP_shr:
 		binop = BINOP_RSH;
+                break;
 	      case DW_OP_shra:
 		binop = BINOP_RSH;
 		val1 = value_from_longest (signed_address_type (), first);

Modified: stable/9/contrib/gdb/gdb/remote.c
==============================================================================
--- stable/9/contrib/gdb/gdb/remote.c	Wed Jan 28 02:25:48 2015	(r277816)
+++ stable/9/contrib/gdb/gdb/remote.c	Wed Jan 28 02:33:06 2015	(r277817)
@@ -3463,7 +3463,7 @@ remote_store_registers (int regnum)
   {
     int i;
     regs = alloca (rs->sizeof_g_packet);
-    memset (regs, rs->sizeof_g_packet, 0);
+    memset (regs, 0, rs->sizeof_g_packet);
     for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
       {
 	struct packet_reg *r = &rs->regs[i];

Modified: stable/9/contrib/gdb/gdb/std-regs.c
==============================================================================
--- stable/9/contrib/gdb/gdb/std-regs.c	Wed Jan 28 02:25:48 2015	(r277816)
+++ stable/9/contrib/gdb/gdb/std-regs.c	Wed Jan 28 02:33:06 2015	(r277817)
@@ -61,7 +61,7 @@ value_of_builtin_frame_reg (struct frame
   val = allocate_value (builtin_type_frame_reg);
   VALUE_LVAL (val) = not_lval;
   buf = VALUE_CONTENTS_RAW (val);
-  memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+  memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val)));
   /* frame.base.  */
   if (frame != NULL)
     ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
@@ -87,7 +87,7 @@ value_of_builtin_frame_fp_reg (struct fr
       struct value *val = allocate_value (builtin_type_void_data_ptr);
       char *buf = VALUE_CONTENTS_RAW (val);
       if (frame == NULL)
-	memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+	memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val)));
       else
 	ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
 			    get_frame_base_address (frame));
@@ -105,7 +105,7 @@ value_of_builtin_frame_pc_reg (struct fr
       struct value *val = allocate_value (builtin_type_void_data_ptr);
       char *buf = VALUE_CONTENTS_RAW (val);
       if (frame == NULL)
-	memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+	memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val)));
       else
 	ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
 			    get_frame_pc (frame));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501280233.t0S2X7CK022747>