This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug symtab/14025] New: "info var" doesn't find LOC_UNRESOLVED var


http://sourceware.org/bugzilla/show_bug.cgi?id=14025

             Bug #: 14025
           Summary: "info var" doesn't find LOC_UNRESOLVED var
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
        AssignedTo: unassigned@sourceware.org
        ReportedBy: dje@google.com
    Classification: Unclassified


This patch to dw2-unresolved.exp shows a case that gdb doesn't handle.
The variable is there, but gdb doesn't print LOC_UNRESOLVED declarations.


Replace xyz with this bug's bug number.


Index: dw2-unresolved.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp,v
retrieving revision 1.5
diff -u -p -r1.5 dw2-unresolved.exp
--- dw2-unresolved.exp  4 Jan 2012 08:17:51 -0000       1.5
+++ dw2-unresolved.exp  27 Apr 2012 00:10:34 -0000
@@ -34,3 +34,37 @@ gdb_continue_to_breakpoint "*extern_bloc

 # Expect the inner value 2.  Value 1 from the outer local block is shadowed.
 gdb_test "print/d var" "= 2"
+
+# Second version of test for bug xyz.
+# "info var var" should see the global var, but it does not.
+
+if { [prepare_for_testing dw2-unresolved.exp "dw2-unresolved"
{dw2-unresolved-main.c dw2-unresolved.S} {debug}] } {
+    return -1
+}
+
+if ![runto_main] {
+    return -1
+}
+
+gdb_breakpoint "*extern_block_start"
+gdb_continue_to_breakpoint "*extern_block_start"
+
+# Expect the inner value 2.  Value 1 from the outer local block is shadowed.
+gdb_test "print/d var" "= 2"
+
+set test "ptype var"
+gdb_test_multiple $test $test {
+    -re "type = unsigned char\[\r\n]+$gdb_prompt $" {
+       pass $test
+    }
+}
+
+set test "info var var"
+gdb_test_multiple $test $test {
+    -re "  var\[\r\n\]+.*$gdb_prompt $" {
+       pass $test
+    }
+    -re "$gdb_prompt $" {
+       kfail symtab/xyz $test
+    }
+}

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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