~ubuntu-branches/debian/jessie/gdb/jessie

« back to all changes in this revision

Viewing changes to gdb/testsuite/gdb.base/printcmds.exp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Jacobowitz
  • Date: 2010-03-20 01:21:29 UTC
  • mfrom: (1.3.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100320012129-t7h25y8zgr8c2369
Tags: 7.1-1
* New upstream release, including:
  - PIE support (Closes: #346409).
  - C++ improvements, including static_cast<> et al, namespace imports,
    and bug fixes in printing virtual base classes.
  - Multi-program debugging.  One GDB can now debug multiple programs
    at the same time.
  - Python scripting improvements, including gdb.parse_and_eval.
  - Updated MIPS Linux signal frame layout (Closes: #570875).
  - No internal error stepping over _dl_debug_state (Closes: #569551).
* Update to Standards-Version: 3.8.4 (no changes required).
* Include more relevant (and smaller) docs in the gdbserver package
  (Closes: #571132).
* Do not duplicate documentation in gdb64, gdb-source, and libgdb-dev.
* Fix crash when switching into TUI mode (Closes: #568489).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# This testcase is part of GDB, the GNU debugger.
2
2
 
3
3
# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2007,
4
 
# 2008, 2009 Free Software Foundation, Inc.
 
4
# 2008, 2009, 2010 Free Software Foundation, Inc.
5
5
 
6
6
# This program is free software; you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
78
78
    gdb_test "p 0xabcdef" " = 11259375"
79
79
    gdb_test "p 0xAbCdEf" " = 11259375"
80
80
    gdb_test "p/x 0x123" " = 0x123"
 
81
 
 
82
    # Test various binary values.
 
83
 
 
84
    gdb_test "p 0b0" " = 0"
 
85
    gdb_test "p 0b1111" " = 15"
 
86
    gdb_test "p 0B1111" " = 15"
 
87
    gdb_test "p -0b1111" " = -15"
81
88
}
82
89
 
83
90
proc test_character_literals_accepted {} {
99
106
proc test_integer_literals_rejected {} {
100
107
    global gdb_prompt
101
108
 
102
 
    test_print_reject "p 0x" 
 
109
    test_print_reject "p 0x"
 
110
    test_print_reject "p 0b"
103
111
    gdb_test "p ''" "(Empty character constant\\.|A character constant must contain at least one character\\.)"
104
112
    gdb_test "p '''" "(Empty character constant\\.|A character constant must contain at least one character\\.)"
105
113
    test_print_reject "p '\\'"
131
139
 
132
140
    test_print_reject "p 0xG" 
133
141
    test_print_reject "p 0xAG" 
 
142
 
 
143
    # Test various binary values.
 
144
 
 
145
    test_print_reject "p 0b2" 
 
146
    test_print_reject "p 0b12" 
134
147
}
135
148
 
136
149
proc test_print_all_chars {} {
569
582
        " = \"abcd\""
570
583
    gdb_test "p a2\[0\]" " = 97 'a'"
571
584
    gdb_test "p a2\[3\]" " = 100 'd'"
 
585
 
 
586
    # Regression test of null-stop; PR 11049.
 
587
    gdb_test "set print null-stop on" ""
 
588
    gdb_test "p a2" " = \"abcd\"" "print a2 with null-stop on"
 
589
    gdb_test "set print null-stop off" ""
572
590
}
573
591
 
574
592
proc test_artificial_arrays {} {
629
647
    gdb_test "p *\"foo\""               " = 102 'f'"
630
648
    gdb_test "ptype *\"foo\""           " = char"
631
649
    gdb_test "p &*\"foo\""              " = \"foo\""
632
 
    setup_kfail "gdb/538" *-*-*
633
650
    gdb_test "ptype &*\"foo\""  "type = char \\*"
634
651
    gdb_test "p (char *)\"foo\""        " = \"foo\""
635
652
}
669
686
 
670
687
    # Regression test for C lexer bug.
671
688
    gdb_test "printf \"%c\\n\", \"x\"\[1,0\]" "x"
 
689
 
 
690
    # Regression test for "%% at end of format string.
 
691
    # See http://sourceware.org/bugzilla/show_bug.cgi?id=11345
 
692
    gdb_test "printf \"%%%d%%\\n\", 5" "%5%"
672
693
}
673
694
 
674
695
#Test printing DFP values with printf