* printcmd.c (print_address_demangle): Remove special case for 0.
authorTom Tromey <tromey@redhat.com>
Fri, 18 May 2012 15:28:24 +0000 (15:28 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 18 May 2012 15:28:24 +0000 (15:28 +0000)
testsuite
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.cp/expand-psymtabs-cxx.exp: Update.
* gdb.cp/cp-relocate.exp (get_func_address): Update.

gdb/ChangeLog
gdb/printcmd.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/cp-relocate.exp
gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp
gdb/testsuite/gdb.mi/mi-var-child.exp
gdb/testsuite/gdb.mi/mi-var-display.exp
gdb/testsuite/gdb.mi/mi2-var-display.exp

index 1eba1065722f5148097cde16ef0016a46a721d11..73e06c26224a7c48d9d95dceb97670e04dcf1f97 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-18  Tom Tromey  <tromey@redhat.com>
+
+       * printcmd.c (print_address_demangle): Remove special case for 0.
+
 2012-05-18  Tom Tromey  <tromey@redhat.com>
 
        * printcmd.c (print_address_demangle): Add 'opts' argument.
index 3bb43bdedde894a7df2ff84aa39f9476a7dd2cad..523fad29411a3871ad420eb31b22584a1f26bd01 100644 (file)
@@ -771,11 +771,7 @@ print_address_demangle (const struct value_print_options *opts,
                        struct gdbarch *gdbarch, CORE_ADDR addr,
                        struct ui_file *stream, int do_demangle)
 {
-  if (addr == 0)
-    {
-      fprintf_filtered (stream, "0");
-    }
-  else if (opts->addressprint)
+  if (opts->addressprint)
     {
       fputs_filtered (paddress (gdbarch, addr), stream);
       print_address_symbolic (gdbarch, addr, stream, do_demangle, " ");
index 9eae7929af15fe83a087a00af6d304850464831f..0aeb2f7175af0b146dd1454a7a89d5627bbe429e 100644 (file)
@@ -1,3 +1,11 @@
+2012-05-18  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.mi/mi2-var-display.exp: Update.
+       * gdb.mi/mi-var-display.exp: Update.
+       * gdb.mi/mi-var-child.exp: Update.
+       * gdb.cp/expand-psymtabs-cxx.exp: Update.
+       * gdb.cp/cp-relocate.exp (get_func_address): Update.
+
 2012-05-17  Doug Evans  <dje@google.com>
 
        * info-macros.exp: Pass "debug" to prepare_for_testing.
index 172f24e11db2a932746d78d125f70f96f2cb924e..2981228ac8309741036643f4c0811e5db4ea433b 100644 (file)
@@ -31,11 +31,11 @@ proc get_func_address { func } {
 
     set rfunc [string_to_regexp $func]
     gdb_test_multiple "print ${func}" "get address of ${func}" {
-       -re "\\\$\[0-9\]+ = \\{.*\\} (0|($hex) <${rfunc}>)\[\r\n\]+${gdb_prompt} $" {
+       -re "\\\$\[0-9\]+ = \\{.*\\} (($hex) <${rfunc}.*>)\[\r\n\]+${gdb_prompt} $" {
            # $1 = {int ()} 0x24 <function_bar>
            # But if the function is at zero, the name may be omitted.
            pass "get address of ${func}"
-           if { $expect_out(1,string) == "0" } {
+           if { $expect_out(1,string) == "0x0" } {
                return "0x0"
            } else {
                return $expect_out(2,string)
index 226d0b802ed20a2b108e8581811b6cad1782fa03..2614fb76209aeae90339429c3bcaf8bb4a4291c2 100644 (file)
@@ -32,6 +32,9 @@ gdb_test_no_output "set language c++"
 
 # FAIL was:
 # $1 = {<text variable, no debug info>} 0
-gdb_test "p 'method(long)'" { = {void \(long\)} 0} "before expand"
-gdb_test "p method" { = {void \(long\)} 0} "force expand"
-gdb_test "p 'method(long)'" { = {void \(long\)} 0} "after expand"
+gdb_test "p 'method(long)'" { = {void \(long\)} 0x0 <method.long.>} \
+    "before expand"
+gdb_test "p method" { = {void \(long\)} 0x0 <method.long.>} \
+    "force expand"
+gdb_test "p 'method(long)'" { = {void \(long\)} 0x0 <method.long.>} \
+    "after expand"
index 7e58ad7023cc6213bac5d9aff520d7253a22ac11..fb98c1dd7e56591387fed6f31fa7d63741cd1a79 100644 (file)
@@ -808,9 +808,9 @@ mi_list_varobj_children {struct_declarations --simple-values} \
          {struct_declarations.long_array long_array 12 "long int \\[12\\]"} \
          [list struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)" "(@$hex: |)$hex <nothing>"] \
          {struct_declarations.func_ptr_struct func_ptr_struct 0 \
-              "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?" 0} \
+              "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?" 0x0} \
          {struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
-              "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)" 0} \
+              "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)" 0x0} \
          {struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"} \
          {struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"} \
 ] "listing of children, simple types: names, type and values, complex types: names and types"
index b3ae2c504b480cba604da050d7186dda469c7b2c..bc770d973228a5fd70ef7f2ae31b8b6b7058f708 100644 (file)
@@ -286,7 +286,7 @@ mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \
        "set format variable weird.func_ptr_struct"
 
 mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \
-       "\\^done,format=\"natural\",value=\"0\"" \
+       "\\^done,format=\"natural\",value=\"0x0\"" \
        "set format variable weird.func_ptr_ptr"
 
 mi_gdb_test "-var-set-format weird.u1 natural" \
index f5c69abe18af3c885e0258bd2dc103c242002c24..d1429c80b9e6f7dd481b3f7e63e9343789867279 100644 (file)
@@ -285,7 +285,7 @@ mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \
        "set format variable weird.func_ptr_struct"
 
 mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \
-       "\\^done,format=\"natural\",value=\"0\"" \
+       "\\^done,format=\"natural\",value=\"0x0\"" \
        "set format variable weird.func_ptr_ptr"
 
 mi_gdb_test "-var-set-format weird.u1 natural" \