| OLD | NEW |
| 1 # Copyright 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2007-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 # Symbols have the form: {file,main}_loc{addr,empty,no}_{,un}resolvable | 26 # Symbols have the form: {file,main}_loc{addr,empty,no}_{,un}resolvable |
| 27 # file: Symbol DIE is placed in DW_TAG_compile_unit. | 27 # file: Symbol DIE is placed in DW_TAG_compile_unit. |
| 28 # main: Symbol DIE is placed in DW_TAG_subprogram. | 28 # main: Symbol DIE is placed in DW_TAG_subprogram. |
| 29 # locaddr: DW_AT_location is using DW_FORM_block DW_OP_addr <addr>. | 29 # locaddr: DW_AT_location is using DW_FORM_block DW_OP_addr <addr>. |
| 30 # locempty: DW_AT_location has zero DW_FORM_block size. | 30 # locempty: DW_AT_location has zero DW_FORM_block size. |
| 31 # locno: DW_AT_location is not present. | 31 # locno: DW_AT_location is not present. |
| 32 # resolvable: .symtab entry exists for this symbol name. | 32 # resolvable: .symtab entry exists for this symbol name. |
| 33 # unresolvable: .symtab entry does not exist for this symbol name. | 33 # unresolvable: .symtab entry does not exist for this symbol name. |
| 34 # DW_AT_declaration is not present in any of these DIEs. | 34 # DW_AT_declaration is not present in any of these DIEs. |
| 35 | 35 |
| 36 proc file_symbols {type} { | 36 proc file_symbols {type} { with_test_prefix "$type" { |
| 37 global pf_prefix | |
| 38 set old_prefix $pf_prefix | |
| 39 lappend pf_prefix "$type:" | |
| 40 | 37 |
| 41 global gdb_prompt | 38 global gdb_prompt |
| 42 | 39 |
| 43 gdb_test "print file_locaddr_resolvable" "= 1234567890" | 40 gdb_test "print file_locaddr_resolvable" "= 1234567890" |
| 44 gdb_test "ptype file_locaddr_resolvable" "type = int" | 41 gdb_test "ptype file_locaddr_resolvable" "type = int" |
| 45 | 42 |
| 46 gdb_test "print file_locaddr_unresolvable" "= 1234567890" | 43 gdb_test "print file_locaddr_unresolvable" "= 1234567890" |
| 47 gdb_test "ptype file_locaddr_unresolvable" "type = int" | 44 gdb_test "ptype file_locaddr_unresolvable" "type = int" |
| 48 | 45 |
| 49 gdb_test "print file_locempty_resolvable" "= <optimized out>" | 46 gdb_test "print file_locempty_resolvable" "= <optimized out>" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 71 gdb_test "ptype file_extern_locempty_unresolvable" "type = int" | 68 gdb_test "ptype file_extern_locempty_unresolvable" "type = int" |
| 72 | 69 |
| 73 gdb_test "print file_extern_locno_resolvable" "= 1234567890" | 70 gdb_test "print file_extern_locno_resolvable" "= 1234567890" |
| 74 gdb_test "ptype file_extern_locno_resolvable" "type = int" | 71 gdb_test "ptype file_extern_locno_resolvable" "type = int" |
| 75 | 72 |
| 76 # `print file_extern_locno_unresolvable' currently prints | 73 # `print file_extern_locno_unresolvable' currently prints |
| 77 # Address of symbol "file_extern_locno_unresolvable" is unknown. | 74 # Address of symbol "file_extern_locno_unresolvable" is unknown. |
| 78 # As DW_AT_declaration is not present in this DIE | 75 # As DW_AT_declaration is not present in this DIE |
| 79 # it should print <optimized out>. As usefulness of such DIE is not | 76 # it should print <optimized out>. As usefulness of such DIE is not |
| 80 # clear its resolution is not being tested. | 77 # clear its resolution is not being tested. |
| 81 | 78 }} |
| 82 set pf_prefix $old_prefix | |
| 83 } | |
| 84 | 79 |
| 85 file_symbols no-run | 80 file_symbols no-run |
| 86 | 81 |
| 87 if ![runto_main] { | 82 if ![runto_main] { |
| 88 return -1 | 83 return -1 |
| 89 } | 84 } |
| 90 | 85 |
| 91 file_symbols in-main | 86 file_symbols in-main |
| 92 | 87 |
| 93 | 88 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 118 gdb_test "print main_extern_locempty_resolvable" "= <optimized out>" | 113 gdb_test "print main_extern_locempty_resolvable" "= <optimized out>" |
| 119 gdb_test "ptype main_extern_locempty_resolvable" "type = int" | 114 gdb_test "ptype main_extern_locempty_resolvable" "type = int" |
| 120 | 115 |
| 121 gdb_test "print main_extern_locempty_unresolvable" "= <optimized out>" | 116 gdb_test "print main_extern_locempty_unresolvable" "= <optimized out>" |
| 122 gdb_test "ptype main_extern_locempty_unresolvable" "type = int" | 117 gdb_test "ptype main_extern_locempty_unresolvable" "type = int" |
| 123 | 118 |
| 124 gdb_test "print main_extern_locno_resolvable" "= 1234567890" | 119 gdb_test "print main_extern_locno_resolvable" "= 1234567890" |
| 125 gdb_test "ptype main_extern_locno_resolvable" "type = int" | 120 gdb_test "ptype main_extern_locno_resolvable" "type = int" |
| 126 | 121 |
| 127 # For `main_extern_locno_unresolvable' see `file_extern_locno_unresolvable'. | 122 # For `main_extern_locno_unresolvable' see `file_extern_locno_unresolvable'. |
| OLD | NEW |