keiths / rpms / gdb

Forked from rpms/gdb 4 months ago
Clone
dfe7fd4
2006-12-28  Daniel Jacobowitz  <dan@codesourcery.com>
dfe7fd4
dfe7fd4
	* ia64-tdep.c (get_kernel_table): Correct signedness in check
dfe7fd4
	for a negative return value.
dfe7fd4
dfe7fd4
dfe7fd4
--- ./gdb/ia64-tdep.c	12 Jul 2006 18:13:45 -0000	1.140
dfe7fd4
+++ ./gdb/ia64-tdep.c	28 Dec 2006 23:48:51 -0000	1.141
dfe7fd4
@@ -2486,13 +2486,14 @@ get_kernel_table (unw_word_t ip, unw_dyn
dfe7fd4
   if (!ktab) 
dfe7fd4
     {
dfe7fd4
       gdb_byte *ktab_buf;
dfe7fd4
-      size_t size;
dfe7fd4
+      LONGEST size;
dfe7fd4
 
dfe7fd4
-      ktab_size = getunwind_table (&ktab_buf);
dfe7fd4
-      if (ktab_size <= 0)
dfe7fd4
+      size = getunwind_table (&ktab_buf);
dfe7fd4
+      if (size <= 0)
dfe7fd4
 	return -UNW_ENOINFO;
dfe7fd4
-      else
dfe7fd4
-	ktab = (struct ia64_table_entry *) ktab_buf;
dfe7fd4
+
dfe7fd4
+      ktab = (struct ia64_table_entry *) ktab_buf;
dfe7fd4
+      ktab_size = size;
dfe7fd4
 
dfe7fd4
       for (etab = ktab; etab->start_offset; ++etab)
dfe7fd4
         etab->info_offset += KERNEL_START;
dfe7fd4
dfe7fd4
dfe7fd4
2007-01-11  Daniel Jacobowitz  <dan@codesourcery.com>
dfe7fd4
dfe7fd4
	* frame.c (get_prev_frame_1): Check PC_REGNUM before using it.
dfe7fd4
dfe7fd4
dfe7fd4
--- ./gdb/frame.c	9 Jan 2007 20:19:15 -0000	1.218
dfe7fd4
+++ ./gdb/frame.c	11 Jan 2007 17:18:22 -0000	1.219
dfe7fd4
@@ -1221,10 +1221,17 @@ get_prev_frame_1 (struct frame_info *thi
dfe7fd4
      have different frame IDs, the new frame will be bogus; two
dfe7fd4
      functions can't share a register save slot for the PC.  This can
dfe7fd4
      happen when the prologue analyzer finds a stack adjustment, but
dfe7fd4
-     no PC save.  This check does assume that the "PC register" is
dfe7fd4
-     roughly a traditional PC, even if the gdbarch_unwind_pc method
dfe7fd4
-     frobs it.  */
dfe7fd4
+     no PC save.
dfe7fd4
+
dfe7fd4
+     This check does assume that the "PC register" is roughly a
dfe7fd4
+     traditional PC, even if the gdbarch_unwind_pc method adjusts
dfe7fd4
+     it (we do not rely on the value, only on the unwound PC being
dfe7fd4
+     dependent on this value).  A potential improvement would be
dfe7fd4
+     to have the frame prev_pc method and the gdbarch unwind_pc
dfe7fd4
+     method set the same lval and location information as
dfe7fd4
+     frame_register_unwind.  */
dfe7fd4
   if (this_frame->level > 0
dfe7fd4
+      && PC_REGNUM >= 0
dfe7fd4
       && get_frame_type (this_frame) == NORMAL_FRAME
dfe7fd4
       && get_frame_type (this_frame->next) == NORMAL_FRAME)
dfe7fd4
     {
dfe7fd4
dfe7fd4
dfe7fd4
2007-01-20  Daniel Jacobowitz  <dan@codesourcery.com>
dfe7fd4
dfe7fd4
	* arch-utils.c (show_endian): Correct reversed condition.
dfe7fd4
dfe7fd4
dfe7fd4
--- ./gdb/arch-utils.c	13 Jan 2007 23:24:43 -0000	1.138
dfe7fd4
+++ ./gdb/arch-utils.c	20 Jan 2007 18:16:33 -0000
dfe7fd4
@@ -322,7 +322,7 @@ static void
dfe7fd4
 show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c,
dfe7fd4
 	     const char *value)
dfe7fd4
 {
dfe7fd4
-  if (target_byte_order_user != BFD_ENDIAN_UNKNOWN)
dfe7fd4
+  if (target_byte_order_user == BFD_ENDIAN_UNKNOWN)
dfe7fd4
     if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
dfe7fd4
       fprintf_unfiltered (file, _("The target endianness is set automatically "
dfe7fd4
 				  "(currently big endian)\n"));
dfe7fd4
dfe7fd4
dfe7fd4
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
dfe7fd4
dfe7fd4
dfe7fd4
2007-01-26  Jan Kratochvil <jan.kratochvil@redhat.com>
dfe7fd4
dfe7fd4
	* c-valprint.c (c_val_print): Require strings to be of no-signed CHARs.
dfe7fd4
	* NEWS: Describe CHAR array vs. string identifcation rules.
dfe7fd4
dfe7fd4
2007-01-26  Jan Kratochvil <jan.kratochvil@redhat.com>
dfe7fd4
	    Eli Zaretskii  <eliz@gnu.org>
dfe7fd4
dfe7fd4
	* gdb.texinfo: Describe CHAR array vs. string identifcation rules.
dfe7fd4
dfe7fd4
2007-01-25  Jan Kratochvil <jan.kratochvil@redhat.com>
dfe7fd4
dfe7fd4
	* gdb.base/charsign.exp, gdb.base/charsign.c: New files.
dfe7fd4
	* gdb.arch/i386-sse.exp: Check $xmm.v16_int8 printing as a number array.
dfe7fd4
	* gdb.base/printcmds.exp: Sign-provided CHARs now became arrays.
dfe7fd4
	* gdb.base/setvar.exp: Likewise.
dfe7fd4
dfe7fd4
dfe7fd4
--- ./gdb/NEWS	21 Jan 2007 17:48:53 -0000	1.211
dfe7fd4
+++ ./gdb/NEWS	26 Jan 2007 10:31:48 -0000
dfe7fd4
@@ -15,6 +15,9 @@ frequency signals (e.g. SIGALRM) via the
dfe7fd4
 target's overall architecture.  GDB can read a description from
dfe7fd4
 a local file or over the remote serial protocol.
dfe7fd4
 
dfe7fd4
+* Arrays of explicitly SIGNED or UNSIGNED CHARs are now printed as arrays
dfe7fd4
+  of numbers.
dfe7fd4
+
dfe7fd4
 * New commands
dfe7fd4
 
dfe7fd4
 set mem inaccessible-by-default
dfe7fd4
--- ./gdb/c-valprint.c	9 Jan 2007 17:58:50 -0000	1.41
dfe7fd4
+++ ./gdb/c-valprint.c	26 Jan 2007 10:31:48 -0000
dfe7fd4
@@ -96,7 +96,7 @@ c_val_print (struct type *type, const gd
dfe7fd4
 	    }
dfe7fd4
 	  /* For an array of chars, print with string syntax.  */
dfe7fd4
 	  if (eltlen == 1 &&
dfe7fd4
-	      ((TYPE_CODE (elttype) == TYPE_CODE_INT)
dfe7fd4
+	      ((TYPE_CODE (elttype) == TYPE_CODE_INT && TYPE_NOSIGN (elttype))
dfe7fd4
 	       || ((current_language->la_language == language_m2)
dfe7fd4
 		   && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
dfe7fd4
 	      && (format == 0 || format == 's'))
dfe7fd4
--- ./gdb/doc/gdb.texinfo	26 Jan 2007 08:54:01 -0000	1.380
dfe7fd4
+++ ./gdb/doc/gdb.texinfo	26 Jan 2007 10:32:00 -0000
dfe7fd4
@@ -5632,6 +5632,26 @@ If you ask to print an object whose cont
dfe7fd4
 by the debug information, @value{GDBN} will say @samp{
dfe7fd4
 type>}.  @xref{Symbols, incomplete type}, for more about this.
dfe7fd4
 
dfe7fd4
+Strings are identified as arrays of @code{char} values without specified
dfe7fd4
+signedness.  Arrays of either @code{signed char} or @code{unsigned char} get
dfe7fd4
+printed as arrays of 1 byte sized integers.  @code{-fsigned-char} or
dfe7fd4
+@code{-funsigned-char} @value{NGCC} options have no effect as @value{GDBN}
dfe7fd4
+defines literal string type @code{"char"} as @code{char} without a sign.
dfe7fd4
+For program code
dfe7fd4
+
dfe7fd4
+@smallexample
dfe7fd4
+char var0[] = "A";
dfe7fd4
+signed char var1[] = "A";
dfe7fd4
+@end smallexample
dfe7fd4
+
dfe7fd4
+You get during debugging
dfe7fd4
+@smallexample
dfe7fd4
+(gdb) print var0
dfe7fd4
+$1 = "A"
dfe7fd4
+(gdb) print var1
dfe7fd4
+$2 = @{65 'A', 0 '\0'@}
dfe7fd4
+@end smallexample
dfe7fd4
+
dfe7fd4
 @node Arrays
dfe7fd4
 @section Artificial arrays
dfe7fd4
 
dfe7fd4
--- ./gdb/testsuite/gdb.arch/i386-sse.exp	9 Jan 2007 17:59:09 -0000	1.5
dfe7fd4
+++ ./gdb/testsuite/gdb.arch/i386-sse.exp	26 Jan 2007 10:32:00 -0000
dfe7fd4
@@ -83,7 +83,10 @@ gdb_continue_to_breakpoint "continue to 
dfe7fd4
 foreach r {0 1 2 3 4 5 6 7} {
dfe7fd4
     gdb_test "print \$xmm$r.v4_float" \
dfe7fd4
         ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \
dfe7fd4
-        "check contents of %xmm$r"
dfe7fd4
+        "check float contents of %xmm$r"
dfe7fd4
+    gdb_test "print \$xmm$r.v16_int8" \
dfe7fd4
+        ".. = \\{(-?\[0-9\]+ '.*', ){15}-?\[0-9\]+ '.*'\\}.*" \
dfe7fd4
+        "check int8 contents of %xmm$r"
dfe7fd4
 }
dfe7fd4
 
dfe7fd4
 foreach r {0 1 2 3 4 5 6 7} {
dfe7fd4
--- /dev/null	1 Jan 1970 00:00:00 -0000
dfe7fd4
+++ ./gdb/testsuite/gdb.base/charsign.c	26 Jan 2007 10:32:00 -0000
dfe7fd4
@@ -0,0 +1,37 @@
dfe7fd4
+/* This testcase is part of GDB, the GNU debugger.
dfe7fd4
+
dfe7fd4
+   Copyright 2007 Free Software Foundation, Inc.
dfe7fd4
+
dfe7fd4
+   This program is free software; you can redistribute it and/or modify
dfe7fd4
+   it under the terms of the GNU General Public License as published by
dfe7fd4
+   the Free Software Foundation; either version 2 of the License, or
dfe7fd4
+   (at your option) any later version.
dfe7fd4
+
dfe7fd4
+   This program is distributed in the hope that it will be useful,
dfe7fd4
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
dfe7fd4
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dfe7fd4
+   GNU General Public License for more details.
dfe7fd4
+ 
dfe7fd4
+   You should have received a copy of the GNU General Public License
dfe7fd4
+   along with this program; if not, write to the Free Software
dfe7fd4
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dfe7fd4
+
dfe7fd4
+   Please email any bugs, comments, and/or additions to this file to:
dfe7fd4
+   bug-gdb@prep.ai.mit.edu  */
dfe7fd4
+
dfe7fd4
+int main()
dfe7fd4
+{
dfe7fd4
+  return 0;
dfe7fd4
+}
dfe7fd4
+
dfe7fd4
+char n[]="A";
dfe7fd4
+signed char s[]="A";
dfe7fd4
+unsigned char u[]="A";
dfe7fd4
+
dfe7fd4
+typedef char char_n;
dfe7fd4
+typedef signed char char_s;
dfe7fd4
+typedef unsigned char char_u;
dfe7fd4
+
dfe7fd4
+char_n n_typed[]="A";
dfe7fd4
+char_s s_typed[]="A";
dfe7fd4
+char_u u_typed[]="A";
dfe7fd4
--- /dev/null	1 Jan 1970 00:00:00 -0000
dfe7fd4
+++ ./gdb/testsuite/gdb.base/charsign.exp	26 Jan 2007 10:32:00 -0000
dfe7fd4
@@ -0,0 +1,70 @@
dfe7fd4
+# Copyright 2007 Free Software Foundation, Inc.
dfe7fd4
+
dfe7fd4
+# This program is free software; you can redistribute it and/or modify
dfe7fd4
+# it under the terms of the GNU General Public License as published by
dfe7fd4
+# the Free Software Foundation; either version 2 of the License, or
dfe7fd4
+# (at your option) any later version.
dfe7fd4
+# 
dfe7fd4
+# This program is distributed in the hope that it will be useful,
dfe7fd4
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
dfe7fd4
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dfe7fd4
+# GNU General Public License for more details.
dfe7fd4
+# 
dfe7fd4
+# You should have received a copy of the GNU General Public License
dfe7fd4
+# along with this program; if not, write to the Free Software
dfe7fd4
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
dfe7fd4
+
dfe7fd4
+if $tracelevel then {
dfe7fd4
+    strace $tracelevel
dfe7fd4
+}
dfe7fd4
+
dfe7fd4
+set prms_id 0
dfe7fd4
+set bug_id 0
dfe7fd4
+
dfe7fd4
+set testfile charsign
dfe7fd4
+set srcfile ${testfile}.c
dfe7fd4
+set binfile ${objdir}/${subdir}/${testfile}
dfe7fd4
+
dfe7fd4
+proc do_test { cflags } {
dfe7fd4
+    global srcdir
dfe7fd4
+    global binfile
dfe7fd4
+    global subdir
dfe7fd4
+    global srcfile
dfe7fd4
+    global gdb_prompt
dfe7fd4
+
dfe7fd4
+    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
dfe7fd4
+	untested "Couldn't compile test program"
dfe7fd4
+	return -1
dfe7fd4
+    }
dfe7fd4
+
dfe7fd4
+    # Get things started.
dfe7fd4
+
dfe7fd4
+    gdb_exit
dfe7fd4
+    gdb_start
dfe7fd4
+    gdb_reinitialize_dir $srcdir/$subdir
dfe7fd4
+    gdb_load ${binfile}
dfe7fd4
+
dfe7fd4
+    # For C programs, "start" should stop in main().
dfe7fd4
+
dfe7fd4
+    gdb_test "p n" \
dfe7fd4
+	     "= \"A\""
dfe7fd4
+    gdb_test "p s" \
dfe7fd4
+	     "= \\{65 'A', 0 '\\\\0'\\}"
dfe7fd4
+    gdb_test "p u" \
dfe7fd4
+	     "= \\{65 'A', 0 '\\\\0'\\}"
dfe7fd4
+    gdb_test "p n_typed" \
dfe7fd4
+	     "= \"A\""
dfe7fd4
+    gdb_test "p s_typed" \
dfe7fd4
+	     "= \\{65 'A', 0 '\\\\0'\\}"
dfe7fd4
+    gdb_test "p u_typed" \
dfe7fd4
+	     "= \\{65 'A', 0 '\\\\0'\\}"
dfe7fd4
+}
dfe7fd4
+
dfe7fd4
+# The string identification works despite the compiler flags below due to
dfe7fd4
+# gdbtypes.c:
dfe7fd4
+#   if (name && strcmp (name, "char") == 0)
dfe7fd4
+#     TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
dfe7fd4
+
dfe7fd4
+do_test {}
dfe7fd4
+do_test {-fsigned-char}
dfe7fd4
+do_test {-funsigned-char}
dfe7fd4
--- ./gdb/testsuite/gdb.base/printcmds.exp	9 Jan 2007 17:59:11 -0000	1.14
dfe7fd4
+++ ./gdb/testsuite/gdb.base/printcmds.exp	26 Jan 2007 10:32:01 -0000
dfe7fd4
@@ -590,18 +590,18 @@ proc test_print_char_arrays {} {
dfe7fd4
     gdb_test "set print address on" ""
dfe7fd4
 
dfe7fd4
     gdb_test "p arrays" \
dfe7fd4
-	" = {array1 = \"abc\", array2 = \"d\", array3 = \"e\", array4 = \"fg\", array5 = \"hij\"}"
dfe7fd4
+	" = \\{array1 = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}, array2 = \\{100 'd'\\}, array3 = \\{101 'e'\\}, array4 = \\{102 'f', 103 'g'\\}, array5 = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}\\}"
dfe7fd4
 
dfe7fd4
     gdb_test "p parrays"		" = \\(struct some_arrays \\*\\) $hex"
dfe7fd4
-    gdb_test "p parrays->array1"	" = \"abc\""
dfe7fd4
+    gdb_test "p parrays->array1"	" = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}"
dfe7fd4
     gdb_test "p &parrays->array1"	" = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
dfe7fd4
-    gdb_test "p parrays->array2"	" = \"d\""
dfe7fd4
+    gdb_test "p parrays->array2"	" = \\{100 'd'\\}"
dfe7fd4
     gdb_test "p &parrays->array2"	" = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex"
dfe7fd4
-    gdb_test "p parrays->array3"	" = \"e\""
dfe7fd4
+    gdb_test "p parrays->array3"	" = \\{101 'e'\\}"
dfe7fd4
     gdb_test "p &parrays->array3"	" = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex"
dfe7fd4
-    gdb_test "p parrays->array4"	" = \"fg\""
dfe7fd4
+    gdb_test "p parrays->array4"	" = \\{102 'f', 103 'g'\\}"
dfe7fd4
     gdb_test "p &parrays->array4"	" = \\(unsigned char \\(\\*\\)\\\[2\\\]\\) $hex"
dfe7fd4
-    gdb_test "p parrays->array5"	" = \"hij\""
dfe7fd4
+    gdb_test "p parrays->array5"	" = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}"
dfe7fd4
     gdb_test "p &parrays->array5"	" = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
dfe7fd4
 
dfe7fd4
     gdb_test "set print address off" ""
dfe7fd4
--- ./gdb/testsuite/gdb.base/setvar.exp	9 Jan 2007 17:59:11 -0000	1.10
dfe7fd4
+++ ./gdb/testsuite/gdb.base/setvar.exp	26 Jan 2007 10:32:01 -0000
dfe7fd4
@@ -233,11 +233,11 @@ test_set "set variable v_char_array\[0\]
dfe7fd4
 #
dfe7fd4
 # test "set variable" for "signed char array[2]"
dfe7fd4
 #
dfe7fd4
-test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable signed char array=\"hi\" (string)" 
dfe7fd4
+test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"        "set variable signed char array=\"hi\" (string)" 
dfe7fd4
 #
dfe7fd4
 # test "set variable" for "unsigned char array[2]"
dfe7fd4
 #
dfe7fd4
-test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable unsigned char array=\"hi\" (string)" 
dfe7fd4
+test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"        "set variable unsigned char array=\"hi\" (string)" 
dfe7fd4
 #
dfe7fd4
 # test "set variable" for "short array[2]"
dfe7fd4
 #
dfe7fd4
@@ -289,11 +289,11 @@ test_set "set v_char_pointer=v_char_arra
dfe7fd4
 #
dfe7fd4
 # test "set variable" for type "signed char *"
dfe7fd4
 #
dfe7fd4
-test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable signed char pointer=\"hi\" (string)" 
dfe7fd4
+test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"  "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable signed char pointer=\"hi\" (string)" 
dfe7fd4
 #
dfe7fd4
 # test "set variable" for type "unsigned char *"
dfe7fd4
 #
dfe7fd4
-test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable unsigned char pointer=\"hi\" (string)" 
dfe7fd4
+test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"  "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable unsigned char pointer=\"hi\" (string)" 
dfe7fd4
 #
dfe7fd4
 # test "set variable" for type "short *"
dfe7fd4
 #
2a21fb5
2a21fb5
2a21fb5
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=209445
2a21fb5
2a21fb5
2a21fb5
[ backported ]
2a21fb5
2006-12-31  Daniel Jacobowitz  <dan@codesourcery.com>
2a21fb5
2a21fb5
        * linux-nat.c (lin_lwp_attach_lwp): Return a status.  Do not
2a21fb5
        add the LWP to our list until we are attached.  Warn instead
2a21fb5
        of erroring if the attach fails.
2a21fb5
        * linux-nat.h (lin_lwp_attach_lwp): New prototype.
2a21fb5
        * linux-thread-db.c (attach_thread): Call lin_lwp_attach_lwp
2a21fb5
        directly.  Do not add the thread to our list until we are
2a21fb5
        successfully attached.
2a21fb5
        * config/nm-linux.h (lin_lwp_attach_lwp, ATTACH_LWP): Delete.
2a21fb5
2a21fb5
2a21fb5
--- ./gdb/linux-nat.c	20 Nov 2006 21:47:06 -0000	1.51
2a21fb5
+++ ./gdb/linux-nat.c	31 Dec 2006 21:04:51 -0000	1.52
2a21fb5
@@ -915,12 +915,13 @@ exit_lwp (struct lwp_info *lp)
2a21fb5
 
2a21fb5
 /* Attach to the LWP specified by PID.  If VERBOSE is non-zero, print
2a21fb5
    a message telling the user that a new LWP has been added to the
2a21fb5
-   process.  */
2a21fb5
+   process.  Return 0 if successful or -1 if the new LWP could not
2a21fb5
+   be attached.  */
2a21fb5
 
2a21fb5
-void
2a21fb5
+int
2a21fb5
 lin_lwp_attach_lwp (ptid_t ptid, int verbose)
2a21fb5
 {
2a21fb5
-  struct lwp_info *lp, *found_lp;
2a21fb5
+  struct lwp_info *lp;
2a21fb5
 
2a21fb5
   gdb_assert (is_lwp (ptid));
2a21fb5
 
2a21fb5
@@ -932,12 +933,7 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
2a21fb5
       sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
2a21fb5
     }
2a21fb5
 
2a21fb5
-  if (verbose)
2a21fb5
-    printf_filtered (_("[New %s]\n"), target_pid_to_str (ptid));
2a21fb5
-
2a21fb5
-  found_lp = lp = find_lwp_pid (ptid);
2a21fb5
-  if (lp == NULL)
2a21fb5
-    lp = add_lwp (ptid);
2a21fb5
+  lp = find_lwp_pid (ptid);
2a21fb5
 
2a21fb5
   /* We assume that we're already attached to any LWP that has an id
2a21fb5
      equal to the overall process id, and to any LWP that is already
2a21fb5
@@ -945,14 +941,25 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
2a21fb5
      and we've had PID wraparound since we last tried to stop all threads,
2a21fb5
      this assumption might be wrong; fortunately, this is very unlikely
2a21fb5
      to happen.  */
2a21fb5
-  if (GET_LWP (ptid) != GET_PID (ptid) && found_lp == NULL)
2a21fb5
+  if (GET_LWP (ptid) != GET_PID (ptid) && lp == NULL)
2a21fb5
     {
2a21fb5
       pid_t pid;
2a21fb5
       int status;
2a21fb5
 
2a21fb5
       if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0)
2a21fb5
-	error (_("Can't attach %s: %s"), target_pid_to_str (ptid),
2a21fb5
-	       safe_strerror (errno));
2a21fb5
+	{
2a21fb5
+	  /* If we fail to attach to the thread, issue a warning,
2a21fb5
+	     but continue.  One way this can happen is if thread
2a21fb5
+	     creation is interrupted; as of Linux 2.6.19, a kernel
2a21fb5
+	     bug may place threads in the thread list and then fail
2a21fb5
+	     to create them.  */
2a21fb5
+	  warning (_("Can't attach %s: %s"), target_pid_to_str (ptid),
2a21fb5
+		   safe_strerror (errno));
2a21fb5
+	  return -1;
2a21fb5
+	}
2a21fb5
+
2a21fb5
+      if (lp == NULL)
2a21fb5
+	lp = add_lwp (ptid);
2a21fb5
 
2a21fb5
       if (debug_linux_nat)
2a21fb5
 	fprintf_unfiltered (gdb_stdlog,
2a21fb5
@@ -990,8 +997,15 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
2a21fb5
          threads.  Note that this won't have already been done since
2a21fb5
          the main thread will have, we assume, been stopped by an
2a21fb5
          attach from a different layer.  */
2a21fb5
+      if (lp == NULL)
2a21fb5
+	lp = add_lwp (ptid);
2a21fb5
       lp->stopped = 1;
2a21fb5
     }
2a21fb5
+
2a21fb5
+  if (verbose)
2a21fb5
+    printf_filtered (_("[New %s]\n"), target_pid_to_str (ptid));
2a21fb5
+
2a21fb5
+  return 0;
2a21fb5
 }
2a21fb5
 
2a21fb5
 static void
2a21fb5
--- ./gdb/linux-nat.h	20 Nov 2006 21:47:06 -0000	1.13
2a21fb5
+++ ./gdb/linux-nat.h	31 Dec 2006 21:04:51 -0000	1.14
2a21fb5
@@ -80,6 +80,8 @@ extern void linux_enable_event_reporting
2a21fb5
 extern ptid_t linux_handle_extended_wait (int pid, int status,
2a21fb5
 					  struct target_waitstatus *ourstatus);
2a21fb5
 
2a21fb5
+extern int lin_lwp_attach_lwp (ptid_t ptid, int verbose);
2a21fb5
+
2a21fb5
 /* Iterator function for lin-lwp's lwp list.  */
2a21fb5
 struct lwp_info *iterate_over_lwps (int (*callback) (struct lwp_info *, 
2a21fb5
 						     void *), 
2a21fb5
--- ./gdb/config/nm-linux.h	28 Nov 2006 19:45:07 -0000	1.27
2a21fb5
+++ ./gdb/config/nm-linux.h	31 Dec 2006 21:04:51 -0000	1.28
2a21fb5
@@ -1,6 +1,6 @@
2a21fb5
 /* Native support for GNU/Linux.
2a21fb5
 
2a21fb5
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
2a21fb5
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
2a21fb5
    Free Software Foundation, Inc.
2a21fb5
 
2a21fb5
    This file is part of GDB.
2a21fb5
@@ -25,9 +25,6 @@ struct target_ops;
2a21fb5
 /* GNU/Linux is SVR4-ish but its /proc file system isn't.  */
2a21fb5
 #undef USE_PROC_FS
2a21fb5
 
2a21fb5
-extern void lin_lwp_attach_lwp (ptid_t ptid, int verbose);
2a21fb5
-#define ATTACH_LWP(ptid, verbose) lin_lwp_attach_lwp ((ptid), (verbose))
2a21fb5
-
2a21fb5
 extern void lin_thread_get_thread_signals (sigset_t *mask);
2a21fb5
 #define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
2a21fb5
 
2a21fb5
--- gdb-6.6/gdb-orig/linux-thread-db.c	2007-01-30 14:10:38.000000000 -0500
2a21fb5
+++ gdb-6.6/gdb/linux-thread-db.c	2007-01-30 14:16:22.000000000 -0500
2a21fb5
@@ -678,6 +678,13 @@
2a21fb5
 
2a21fb5
   check_thread_signals ();
2a21fb5
 
2a21fb5
+  if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
2a21fb5
+    return;			/* A zombie thread -- do not attach.  */
2a21fb5
+
2a21fb5
+  /* Under GNU/Linux, we have to attach to each and every thread.  */
2a21fb5
+  if (lin_lwp_attach_lwp (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0) < 0)
2a21fb5
+    return;
2a21fb5
+
2a21fb5
   /* Add the thread to GDB's thread list.  */
2a21fb5
   tp = add_thread (ptid);
2a21fb5
   tp->private = xmalloc (sizeof (struct private_thread_info));
2a21fb5
@@ -686,20 +693,10 @@
2a21fb5
   if (verbose)
2a21fb5
     printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid));
2a21fb5
 
2a21fb5
-  if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
2a21fb5
-    return;			/* A zombie thread -- do not attach.  */
2a21fb5
-
2a21fb5
-  new_ptid = BUILD_LWP (ti_p->ti_lid, GET_PID (ptid));
2a21fb5
-
2a21fb5
-  /* Under GNU/Linux, we have to attach to each and every thread.  */
2a21fb5
-#ifdef ATTACH_LWP
2a21fb5
-  ATTACH_LWP (new_ptid, 0);
2a21fb5
-#endif
2a21fb5
-
2a21fb5
   /* Notify any observers of a new linux thread.  This
2a21fb5
      would include any linux platforms that have to insert hardware
2a21fb5
      watchpoints on every thread.  */
2a21fb5
-  observer_notify_linux_new_thread (new_ptid);
2a21fb5
+  observer_notify_linux_new_thread (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)));
2a21fb5
 
2a21fb5
   /* Enable thread event reporting for this thread.  */
2a21fb5
   err = td_thr_event_enable_p (th_p, 1);
9548cfe
9548cfe
9548cfe
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000
9548cfe
9548cfe
9548cfe
2007-02-08  Thiago Jung Bauermann  <bauerman@br.ibm.com>
9548cfe
9548cfe
	* rs6000-tdep.c (gdb_print_insn_powerpc): Set
9548cfe
	info->disassembler_options to "any".
9548cfe
9548cfe
9548cfe
--- ./gdb/rs6000-tdep.c	8 Feb 2007 14:22:53 -0000	1.261
9548cfe
+++ ./gdb/rs6000-tdep.c	8 Feb 2007 18:05:23 -0000	1.262
9548cfe
@@ -2924,6 +2924,9 @@ find_variant_by_arch (enum bfd_architect
9548cfe
 static int
9548cfe
 gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info)
9548cfe
 {
9548cfe
+  if (!info->disassembler_options)
9548cfe
+    info->disassembler_options = "any";
9548cfe
+
9548cfe
   if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
9548cfe
     return print_insn_big_powerpc (memaddr, info);
9548cfe
   else
eaba00d
eaba00d
eaba00d
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=232353
eaba00d
eaba00d
eaba00d
2007-01-27  Daniel Jacobowitz  <dan@codesourcery.com>
eaba00d
eaba00d
	* dwarf2loc.h (struct dwarf2_locexpr_baton): Change size to a long.
eaba00d
	(struct dwarf2_loclist_baton): Likewise.
eaba00d
eaba00d
eaba00d
--- ./gdb/dwarf2loc.h	17 Dec 2005 22:33:59 -0000	1.6
eaba00d
+++ ./gdb/dwarf2loc.h	5 Jan 2007 15:31:17 -0000
eaba00d
@@ -39,7 +39,7 @@ struct dwarf2_locexpr_baton
eaba00d
   gdb_byte *data;
eaba00d
 
eaba00d
   /* Length of the location expression.  */
eaba00d
-  unsigned short size;
eaba00d
+  unsigned long size;
eaba00d
 
eaba00d
   /* The objfile containing the symbol whose location we're computing.  */
eaba00d
   struct objfile *objfile;
eaba00d
@@ -55,7 +55,7 @@ struct dwarf2_loclist_baton
eaba00d
   gdb_byte *data;
eaba00d
 
eaba00d
   /* Length of the location list.  */
eaba00d
-  unsigned short size;
eaba00d
+  unsigned long size;
eaba00d
 
eaba00d
   /* The objfile containing the symbol whose location we're computing.  */
eaba00d
   /* Used (only???) by thread local variables.  The objfile in which
acb618c
acb618c
acb618c
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000
acb618c
acb618c
acb618c
Fixes embarrassing errors in the ppc dfp instructions committed some
acb618c
time ago.  IBM numbers bits in architecture manuals starting from zero
acb618c
in the most signifigant bit.  Fields are marked by numbering their
acb618c
most signifigant bit too.  This means some translating is required when
acb618c
filling out new powerpc_operand entries.  You can't just plug IBM
acb618c
numbers into the shift counts.  Also, Z_MASK is too big for
acb618c
instructions that take RMC operands.
acb618c
acb618c
	* ppc-opc.c (DCM, DGM, TE, RMC, R, SP, S): Correct shift.
acb618c
	(Z2_MASK): Define.
acb618c
	(powerpc_opcodes): Use Z2_MASK in all insns taking RMC operand.
acb618c
acb618c
--- ./opcodes/ppc-opc.c	19 Apr 2007 01:39:31 -0000	1.91
acb618c
+++ ./opcodes/ppc-opc.c	20 Apr 2007 09:52:09 -0000
acb618c
@@ -530,8 +530,9 @@ const struct powerpc_operand powerpc_ope
acb618c
 #define SIMM VD + 1
acb618c
   { 5, 16, NULL, NULL, PPC_OPERAND_SIGNED},
acb618c
 
acb618c
-  /* The UIMM field in a VX form instruction.  */
acb618c
+  /* The UIMM field in a VX form instruction, and TE in Z form.  */
acb618c
 #define UIMM SIMM + 1
acb618c
+#define TE UIMM
acb618c
   { 5, 16, NULL, NULL, 0 },
acb618c
 
acb618c
   /* The SHB field in a VA form instruction.  */
acb618c
@@ -564,31 +565,23 @@ const struct powerpc_operand powerpc_ope
acb618c
 #define A_L MTMSRD_L
acb618c
   { 1, 16, NULL, NULL, PPC_OPERAND_OPTIONAL },
acb618c
 
acb618c
-  /* The DCM field in a Z form instruction.  */
acb618c
-#define DCM MTMSRD_L + 1
acb618c
-  { 6, 16, NULL, NULL, 0 },
acb618c
-
acb618c
-  /* Likewise, the DGM field in a Z form instruction.  */
acb618c
-#define DGM DCM + 1
acb618c
-  { 6, 16, NULL, NULL, 0 },
acb618c
-
acb618c
-#define TE DGM + 1
acb618c
-  { 5, 11, NULL, NULL, 0 },
acb618c
-
acb618c
-#define RMC TE + 1
acb618c
-  { 2, 21, NULL, NULL, 0 },
acb618c
+#define RMC A_L + 1
acb618c
+  { 2, 9, NULL, NULL, 0 },
acb618c
 
acb618c
 #define R RMC + 1
acb618c
-  { 1, 15, NULL, NULL, 0 },
acb618c
+  { 1, 16, NULL, NULL, 0 },
acb618c
 
acb618c
 #define SP R + 1
acb618c
-  { 2, 11, NULL, NULL, 0 },
acb618c
+  { 2, 19, NULL, NULL, 0 },
acb618c
 
acb618c
 #define S SP + 1
acb618c
-  { 1, 11, NULL, NULL, 0 },
acb618c
+  { 1, 20, NULL, NULL, 0 },
acb618c
 
acb618c
   /* SH field starting at bit position 16.  */
acb618c
 #define SH16 S + 1
acb618c
+  /* The DCM and DGM fields in a Z form instruction.  */
acb618c
+#define DCM SH16
acb618c
+#define DGM DCM
acb618c
   { 6, 10, NULL, NULL, 0 },
acb618c
 
acb618c
   /* The L field in an X form with the RT field fixed instruction.  */
acb618c
@@ -1683,6 +1676,7 @@ extract_tbr (unsigned long insn,
acb618c
 
acb618c
 /* The mask for a Z form instruction.  */
acb618c
 #define Z_MASK ZRC (0x3f, 0x1ff, 1)
acb618c
+#define Z2_MASK ZRC (0x3f, 0xff, 1)
acb618c
 
acb618c
 /* An X_MASK with the RA field fixed.  */
acb618c
 #define XRA_MASK (X_MASK | RA_MASK)
acb618c
@@ -4639,8 +4633,8 @@ const struct powerpc_opcode powerpc_opco
acb618c
 { "dadd",    XRC(59,2,0), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 { "dadd.",   XRC(59,2,1), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 
acb618c
-{ "dqua",    ZRC(59,3,0), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
-{ "dqua.",   ZRC(59,3,1), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "dqua",    ZRC(59,3,0), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "dqua.",   ZRC(59,3,1), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
 
acb618c
 { "fdivs",   A(59,18,0), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
acb618c
 { "fdivs.",  A(59,18,1), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
acb618c
@@ -4678,20 +4672,20 @@ const struct powerpc_opcode powerpc_opco
acb618c
 { "dmul",    XRC(59,34,0), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 { "dmul.",   XRC(59,34,1), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 
acb618c
-{ "drrnd",   ZRC(59,35,0), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
-{ "drrnd.",  ZRC(59,35,1), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "drrnd",   ZRC(59,35,0), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "drrnd.",  ZRC(59,35,1), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
 
acb618c
 { "dscli",   ZRC(59,66,0), Z_MASK,	POWER6,		{ FRT, FRA, SH16 } },
acb618c
 { "dscli.",  ZRC(59,66,1), Z_MASK,	POWER6,		{ FRT, FRA, SH16 } },
acb618c
 
acb618c
-{ "dquai",   ZRC(59,67,0), Z_MASK,	POWER6,		{ TE,  FRT, FRB, RMC } },
acb618c
-{ "dquai.",  ZRC(59,67,1), Z_MASK,	POWER6,		{ TE,  FRT, FRB, RMC } },
acb618c
+{ "dquai",   ZRC(59,67,0), Z2_MASK,	POWER6,		{ TE,  FRT, FRB, RMC } },
acb618c
+{ "dquai.",  ZRC(59,67,1), Z2_MASK,	POWER6,		{ TE,  FRT, FRB, RMC } },
acb618c
 
acb618c
 { "dscri",   ZRC(59,98,0), Z_MASK,	POWER6,		{ FRT, FRA, SH16 } },
acb618c
 { "dscri.",  ZRC(59,98,1), Z_MASK,	POWER6,		{ FRT, FRA, SH16 } },
acb618c
 
acb618c
-{ "drintx",  ZRC(59,99,0), Z_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
-{ "drintx.", ZRC(59,99,1), Z_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
+{ "drintx",  ZRC(59,99,0), Z2_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
+{ "drintx.", ZRC(59,99,1), Z2_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
 
acb618c
 { "dcmpo",   X(59,130),	   X_MASK,	POWER6,		{ BF,  FRA, FRB } },
acb618c
 
acb618c
@@ -4699,8 +4693,8 @@ const struct powerpc_opcode powerpc_opco
acb618c
 { "dtstdc",  Z(59,194),	   Z_MASK,	POWER6,		{ BF,  FRA, DCM } },
acb618c
 { "dtstdg",  Z(59,226),	   Z_MASK,	POWER6,		{ BF,  FRA, DGM } },
acb618c
 
acb618c
-{ "drintn",  ZRC(59,227,0), Z_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
-{ "drintn.", ZRC(59,227,1), Z_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
+{ "drintn",  ZRC(59,227,0), Z2_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
+{ "drintn.", ZRC(59,227,1), Z2_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
 
acb618c
 { "dctdp",   XRC(59,258,0), X_MASK,	POWER6,		{ FRT, FRB } },
acb618c
 { "dctdp.",  XRC(59,258,1), X_MASK,	POWER6,		{ FRT, FRB } },
acb618c
@@ -4766,8 +4760,8 @@ const struct powerpc_opcode powerpc_opco
acb618c
 { "daddq",   XRC(63,2,0), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 { "daddq.",  XRC(63,2,1), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 
acb618c
-{ "dquaq",   ZRC(63,3,0), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
-{ "dquaq.",  ZRC(63,3,1), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "dquaq",   ZRC(63,3,0), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "dquaq.",  ZRC(63,3,1), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
 
acb618c
 { "fcpsgn",  XRC(63,8,0), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 { "fcpsgn.", XRC(63,8,1), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
@@ -4842,8 +4836,8 @@ const struct powerpc_opcode powerpc_opco
acb618c
 { "dmulq",   XRC(63,34,0), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 { "dmulq.",  XRC(63,34,1), X_MASK,	POWER6,		{ FRT, FRA, FRB } },
acb618c
 
acb618c
-{ "drrndq",  ZRC(63,35,0), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
-{ "drrndq.", ZRC(63,35,1), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "drrndq",  ZRC(63,35,0), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "drrndq.", ZRC(63,35,1), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
 
acb618c
 { "mtfsb1",  XRC(63,38,0), XRARB_MASK,	COM,		{ BT } },
acb618c
 { "mtfsb1.", XRC(63,38,1), XRARB_MASK,	COM,		{ BT } },
acb618c
@@ -4856,8 +4850,8 @@ const struct powerpc_opcode powerpc_opco
acb618c
 { "dscliq",  ZRC(63,66,0), Z_MASK,	POWER6,		{ FRT, FRA, SH16 } },
acb618c
 { "dscliq.", ZRC(63,66,1), Z_MASK,	POWER6,		{ FRT, FRA, SH16 } },
acb618c
 
acb618c
-{ "dquaiq",  ZRC(63,67,0), Z_MASK,	POWER6,		{ TE,  FRT, FRB, RMC } },
acb618c
-{ "dquaiq.", ZRC(63,67,1), Z_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
+{ "dquaiq",  ZRC(63,67,0), Z2_MASK,	POWER6,		{ TE,  FRT, FRB, RMC } },
acb618c
+{ "dquaiq.", ZRC(63,67,1), Z2_MASK,	POWER6,		{ FRT, FRA, FRB, RMC } },
acb618c
 
acb618c
 { "mtfsb0",  XRC(63,70,0), XRARB_MASK,	COM,		{ BT } },
acb618c
 { "mtfsb0.", XRC(63,70,1), XRARB_MASK,	COM,		{ BT } },
acb618c
@@ -4868,8 +4862,8 @@ const struct powerpc_opcode powerpc_opco
acb618c
 { "dscriq",  ZRC(63,98,0), Z_MASK,	POWER6,		{ FRT, FRA, SH16 } },
acb618c
 { "dscriq.", ZRC(63,98,1), Z_MASK,	POWER6,		{ FRT, FRA, SH16 } },
acb618c
 
acb618c
-{ "drintxq", ZRC(63,99,0), Z_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
-{ "drintxq.",ZRC(63,99,1), Z_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
+{ "drintxq", ZRC(63,99,0), Z2_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
+{ "drintxq.",ZRC(63,99,1), Z2_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
 
acb618c
 { "dcmpoq",  X(63,130),	   X_MASK,	POWER6,		{ BF,  FRA, FRB } },
acb618c
 
acb618c
@@ -4883,8 +4877,8 @@ const struct powerpc_opcode powerpc_opco
acb618c
 { "dtstdcq", Z(63,194),	    Z_MASK,	POWER6,		{ BF,  FRA, DCM } },
acb618c
 { "dtstdgq", Z(63,226),	    Z_MASK,	POWER6,		{ BF,  FRA, DGM } },
acb618c
 
acb618c
-{ "drintnq", ZRC(63,227,0), Z_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
-{ "drintnq.",ZRC(63,227,1), Z_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
+{ "drintnq", ZRC(63,227,0), Z2_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
+{ "drintnq.",ZRC(63,227,1), Z2_MASK,	POWER6,		{ R, FRT, FRB, RMC } },
acb618c
 
acb618c
 { "dctqpq",  XRC(63,258,0), X_MASK,	POWER6,		{ FRT, FRB } },
acb618c
 { "dctqpq.", XRC(63,258,1), X_MASK,	POWER6,		{ FRT, FRB } },
acb618c
acb618c
-- 
acb618c
Alan Modra
acb618c
IBM OzLabs - Linux Technology Centre
da8ce49
da8ce49
da8ce49
da8ce49
2007-05-14  Paul Brook  <paul@codesourcery.com>
da8ce49
	    Daniel Jacobowitz  <dan@codesourcery.com>
da8ce49
da8ce49
	* dwarf2read.c (dwarf2_debug_line_missing_file_complaint): New
da8ce49
	function.
da8ce49
	(dwarf_decode_lines): Check for line info without a file.
da8ce49
da8ce49
--- src/gdb/dwarf2read.c	2007/04/18 13:25:04	1.218
da8ce49
+++ src/gdb/dwarf2read.c	2007/05/14 17:15:20	1.219
da8ce49
@@ -688,6 +688,13 @@
da8ce49
 }
da8ce49
 
da8ce49
 static void
da8ce49
+dwarf2_debug_line_missing_file_complaint (void)
da8ce49
+{
da8ce49
+  complaint (&symfile_complaints,
da8ce49
+	     _(".debug_line section has line data without a file"));
da8ce49
+}
da8ce49
+
da8ce49
+static void
da8ce49
 dwarf2_complex_location_expr_complaint (void)
da8ce49
 {
da8ce49
   complaint (&symfile_complaints, _("location expression too complex"));
da8ce49
@@ -6708,19 +6715,24 @@
da8ce49
 	      address += (adj_opcode / lh->line_range)
da8ce49
 		* lh->minimum_instruction_length;
da8ce49
 	      line += lh->line_base + (adj_opcode % lh->line_range);
da8ce49
-              lh->file_names[file - 1].included_p = 1;
da8ce49
-              if (!decode_for_pst_p)
da8ce49
-                {
da8ce49
-		  if (last_subfile != current_subfile)
da8ce49
-		    {
da8ce49
-		      if (last_subfile)
da8ce49
-			record_line (last_subfile, 0, address);
da8ce49
-		      last_subfile = current_subfile;
da8ce49
+	      if (lh->num_file_names < file)
da8ce49
+		dwarf2_debug_line_missing_file_complaint ();
da8ce49
+	      else
da8ce49
+		{
da8ce49
+		  lh->file_names[file - 1].included_p = 1;
da8ce49
+		  if (!decode_for_pst_p)
da8ce49
+                    {
da8ce49
+                      if (last_subfile != current_subfile)
da8ce49
+                        {
da8ce49
+                          if (last_subfile)
da8ce49
+                            record_line (last_subfile, 0, address);
da8ce49
+                          last_subfile = current_subfile;
da8ce49
+                        }
da8ce49
+		      /* Append row to matrix using current values.  */
da8ce49
+		      record_line (current_subfile, line, 
da8ce49
+				   check_cu_functions (address, cu));
da8ce49
 		    }
da8ce49
-	          /* Append row to matrix using current values.  */
da8ce49
-	          record_line (current_subfile, line, 
da8ce49
-	                       check_cu_functions (address, cu));
da8ce49
-                }
da8ce49
+		}
da8ce49
 	      basic_block = 1;
da8ce49
 	    }
da8ce49
 	  else switch (op_code)
da8ce49
@@ -6734,9 +6746,15 @@
da8ce49
 		{
da8ce49
 		case DW_LNE_end_sequence:
da8ce49
 		  end_sequence = 1;
da8ce49
-                  lh->file_names[file - 1].included_p = 1;
da8ce49
-                  if (!decode_for_pst_p)
da8ce49
-		    record_line (current_subfile, 0, address);
da8ce49
+
da8ce49
+		  if (lh->num_file_names < file)
da8ce49
+		    dwarf2_debug_line_missing_file_complaint ();
da8ce49
+		  else
da8ce49
+		    {
da8ce49
+		      lh->file_names[file - 1].included_p = 1;
da8ce49
+		      if (!decode_for_pst_p)
da8ce49
+			record_line (current_subfile, 0, address);
da8ce49
+		    }
da8ce49
 		  break;
da8ce49
 		case DW_LNE_set_address:
da8ce49
 		  address = read_address (abfd, line_ptr, cu, &bytes_read);
da8ce49
@@ -6769,17 +6787,22 @@
da8ce49
 		}
da8ce49
 	      break;
da8ce49
 	    case DW_LNS_copy:
da8ce49
-              lh->file_names[file - 1].included_p = 1;
da8ce49
-              if (!decode_for_pst_p)
da8ce49
+	      if (lh->num_file_names < file)
da8ce49
+		dwarf2_debug_line_missing_file_complaint ();
da8ce49
+	      else
da8ce49
 		{
da8ce49
-		  if (last_subfile != current_subfile)
da8ce49
-		    {
da8ce49
-		      if (last_subfile)
da8ce49
-			record_line (last_subfile, 0, address);
da8ce49
-		      last_subfile = current_subfile;
da8ce49
-		    }
da8ce49
-		  record_line (current_subfile, line, 
da8ce49
-			       check_cu_functions (address, cu));
da8ce49
+		  lh->file_names[file - 1].included_p = 1;
da8ce49
+		  if (!decode_for_pst_p)
da8ce49
+                    {
da8ce49
+                      if (last_subfile != current_subfile)
da8ce49
+                        {
da8ce49
+                          if (last_subfile)
da8ce49
+                            record_line (last_subfile, 0, address);
da8ce49
+                          last_subfile = current_subfile;
da8ce49
+                        }
da8ce49
+                      record_line (current_subfile, line, 
da8ce49
+                                   check_cu_functions (address, cu));
da8ce49
+                    }
da8ce49
 		}
da8ce49
 	      basic_block = 0;
da8ce49
 	      break;
da8ce49
@@ -6806,15 +6806,19 @@ dwarf_decode_lines (struct line_header *
da8ce49
 
da8ce49
                 file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
da8ce49
                 line_ptr += bytes_read;
da8ce49
-                fe = &lh->file_names[file - 1];
da8ce49
-                if (fe->dir_index)
da8ce49
-                  dir = lh->include_dirs[fe->dir_index - 1];
da8ce49
-
da8ce49
-                if (!decode_for_pst_p)
da8ce49
-		  {
da8ce49
-		    last_subfile = current_subfile;
da8ce49
-		    dwarf2_start_subfile (fe->name, dir, comp_dir, file);
da8ce49
-		  }
da8ce49
+                if (lh->num_file_names < file)
da8ce49
+                  dwarf2_debug_line_missing_file_complaint ();
da8ce49
+                else
da8ce49
+                  {
da8ce49
+                    fe = &lh->file_names[file - 1];
da8ce49
+                    if (fe->dir_index)
da8ce49
+                      dir = lh->include_dirs[fe->dir_index - 1];
da8ce49
+                    if (!decode_for_pst_p)
da8ce49
+                      {
da8ce49
+                        last_subfile = current_subfile;
da8ce49
+                        dwarf2_start_subfile (fe->name, dir, comp_dir, file);
da8ce49
+                      }
da8ce49
+                  }
da8ce49
               }
da8ce49
 	      break;
da8ce49
 	    case DW_LNS_set_column:
4bfa89a
4bfa89a
4bfa89a
4bfa89a
2007-09-15  Alan Modra  <amodra@bigpond.net.au>
4bfa89a
4bfa89a
	* configure.ac: Correct makeinfo version check.
4bfa89a
	* configure: Regenerate.
4bfa89a
4bfa89a
#--- ./configure.ac	14 Sep 2007 14:51:36 -0000	1.25
4bfa89a
#+++ ./configure.ac	14 Sep 2007 15:47:01 -0000	1.26
4bfa89a
#@@ -2462,7 +2462,7 @@ changequote(,)
4bfa89a
#     # For an installed makeinfo, we require it to be from texinfo 4.4 or
4bfa89a
#     # higher, else we use the "missing" dummy.
4bfa89a
#     if ${MAKEINFO} --version \
4bfa89a
#-       | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
4bfa89a
#+       | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
4bfa89a
#       :
4bfa89a
#     else
4bfa89a
#       MAKEINFO="$MISSING makeinfo"
4bfa89a
--- ./configure	14 Sep 2007 14:51:36 -0000	1.277
4bfa89a
+++ ./configure	14 Sep 2007 15:47:01 -0000	1.278
4bfa89a
@@ -6192,7 +6192,7 @@ case " $build_configdirs " in
4bfa89a
     # For an installed makeinfo, we require it to be from texinfo 4.4 or
4bfa89a
     # higher, else we use the "missing" dummy.
4bfa89a
     if ${MAKEINFO} --version \
4bfa89a
-       | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
4bfa89a
+       | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
4bfa89a
       :
4bfa89a
     else
4bfa89a
       MAKEINFO="$MISSING makeinfo"