1# Copyright 1992-2023 Free Software Foundation, Inc. 2 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 5# the Free Software Foundation; either version 3 of the License, or 6# (at your option) any later version. 7# 8# This program is distributed in the hope that it will be useful, 9# but WITHOUT ANY WARRANTY; without even the implied warranty of 10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11# GNU General Public License for more details. 12# 13# You should have received a copy of the GNU General Public License 14# along with this program. If not, see <http://www.gnu.org/licenses/>. 15 16# This file was written by Fred Fish. (fnf@cygnus.com) 17# Adapted for g++ 3.0 ABI by Michael Chastain. (chastain@redhat.com) 18 19if { [skip_cplus_tests] } { continue } 20 21standard_testfile .cc 22 23if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { 24 return -1 25} 26 27# 28# g++ changed its ABI between 2.95 and 3.0. gdb has two demanglers 29# for the two different styles. The two demanglers have some subtle 30# discrepancies in their output. 31# 32# old demangler new demangler 33# --- --------- --- --------- 34# "operator, " "operator," 35# "char *" "char*" 36# "int *" "int*" 37# "long *" "long*" 38# "void *" "void*" 39# "foo &" "foo&" 40# "unsigned int" "unsigned" 41# "void" "" 42# 43# I probe for the forms in use. 44# The defaults are for the v3 demangler (as of 2001-02-13). 45# 46 47set dm_operator_comma "," 48set dm_type_char_star "char*" 49set dm_type_char_star_quoted "char\\*" 50set dm_type_foo_ref "foo&" 51set dm_type_int_star "int*" 52set dm_type_long_star "long*" 53set dm_type_unsigned_int "unsigned" 54set dm_type_void "void" 55set dm_type_void_star "void*" 56 57# Some other vagaries of GDB's type printing machinery. The integer types 58# may have unsigned before or after their length, and may have "int" 59# appended. The char* conversion operator may have name "char*" even if 60# the type is "char *", because the name comes from the debug information 61# and the type from GDB. Function types may not see through typedefs. 62 63set dm_type_short "short" 64set dm_type_long "long" 65set dm_type_unsigned_short "unsigned short" 66set dm_type_unsigned_long "unsigned long" 67set dm_operator_char_star "char*" 68set dm_operator_char_star_quoted "char\\*" 69set dm_type_typedef 0 70 71proc probe_demangler { } { 72 global gdb_prompt 73 global dm_operator_comma 74 global dm_operator_char_star 75 global dm_operator_char_star_quoted 76 global dm_type_char_star 77 global dm_type_char_star_quoted 78 global dm_type_foo_ref 79 global dm_type_int_star 80 global dm_type_long_star 81 global dm_type_unsigned_int 82 global dm_type_void 83 global dm_type_void_star 84 global dm_type_short 85 global dm_type_unsigned_short 86 global dm_type_long 87 global dm_type_unsigned_long 88 global dm_type_typedef 89 90 gdb_test_multiple "print &foo::operator,(foo&)" \ 91 "detect dm_operator_comma" { 92 -re ".*foo::operator, \\(.*foo.*&.*\\).*\r\n$gdb_prompt $" { 93 # v2 demangler 94 set dm_operator_comma ", " 95 pass "detect dm_operator_comma" 96 } 97 -re ".*foo::operator,\\(.*foo.*&.*\\).*\r\n$gdb_prompt $" { 98 # v3 demangler 99 pass "detect dm_operator_comma" 100 } 101 } 102 103 gdb_test_multiple "print &foo::operator char*($dm_type_void)" \ 104 "detect dm_operator_char_star" { 105 -re ".*foo::operator char \\*\\(void\\).*\r\n$gdb_prompt $" { 106 # v2 demangler or GDB type printer 107 set dm_operator_char_star "char *" 108 set dm_operator_char_star_quoted "char \\*" 109 pass "detect dm_operator_char_star" 110 } 111 -re ".*foo::operator char\\*\\(\\).*\r\n$gdb_prompt $" { 112 # v3 demangler 113 pass "detect dm_operator_char_star" 114 } 115 } 116 117 gdb_test_multiple "print &dm_type_char_star" \ 118 "detect dm_type_char_star" { 119 -re ".*dm_type_char_star\\(char \\*\\).*\r\n$gdb_prompt $" { 120 # v2 demangler 121 set dm_type_char_star "char *" 122 set dm_type_char_star_quoted "char \\*" 123 pass "detect dm_type_char_star" 124 } 125 -re ".*dm_type_char_star\\(char\\*\\).*\r\n$gdb_prompt $" { 126 # v3 demangler 127 pass "detect dm_type_char_star" 128 } 129 } 130 131 gdb_test_multiple "print &dm_type_foo_ref" \ 132 "detect dm_type_foo_ref" { 133 -re ".*dm_type_foo_ref\\(foo &\\).*\r\n$gdb_prompt $" { 134 # v2 demangler 135 set dm_type_foo_ref "foo &" 136 pass "detect dm_type_foo_ref" 137 } 138 -re ".*dm_type_foo_ref\\(foo&\\).*\r\n$gdb_prompt $" { 139 # v3 demangler 140 pass "detect dm_type_foo_ref" 141 } 142 } 143 144 gdb_test_multiple "print &dm_type_int_star" \ 145 "detect dm_type_int_star" { 146 -re ".*dm_type_int_star\\(int \\*\\).*\r\n$gdb_prompt $" { 147 # v2 demangler 148 set dm_type_int_star "int *" 149 pass "detect dm_type_int_star" 150 } 151 -re ".*dm_type_int_star\\(int\\*\\).*\r\n$gdb_prompt $" { 152 # v3 demangler 153 pass "detect dm_type_int_star" 154 } 155 } 156 157 gdb_test_multiple "print &dm_type_long_star" \ 158 "detect dm_type_long_star" { 159 -re ".*dm_type_long_star\\(long \\*\\).*\r\n$gdb_prompt $" { 160 # v2 demangler 161 set dm_type_long_star "long *" 162 pass "detect dm_type_long_star" 163 } 164 -re ".*dm_type_long_star\\(long\\*\\).*\r\n$gdb_prompt $" { 165 # v3 demangler 166 pass "detect dm_type_long_star" 167 } 168 -re ".*dm_type_long_star\\(long int \\*\\).*\r\n$gdb_prompt $" { 169 # GCC v3 and GDB's type printer 170 set dm_type_long_star "long int *" 171 pass "detect dm_type_long_star" 172 } 173 } 174 175 gdb_test_multiple "print &dm_type_unsigned_int" \ 176 "detect dm_type_unsigned_int" { 177 -re ".*dm_type_unsigned_int\\(unsigned int\\).*\r\n$gdb_prompt $" { 178 # v2 demangler 179 set dm_type_unsigned_int "unsigned int" 180 pass "detect dm_type_unsigned_int" 181 } 182 -re ".*dm_type_unsigned_int\\(unsigned\\).*\r\n$gdb_prompt $" { 183 # v3 demangler 184 pass "detect dm_type_unsigned_int" 185 } 186 } 187 188 gdb_test_multiple "print &dm_type_void" \ 189 "detect dm_type_void" { 190 -re ".*dm_type_void\\(void\\).*\r\n$gdb_prompt $" { 191 # v2 demangler 192 set dm_type_void "void" 193 pass "detect dm_type_void" 194 } 195 -re ".*dm_type_void\\(\\).*\r\n$gdb_prompt $" { 196 # v3 demangler 197 pass "detect dm_type_void" 198 } 199 } 200 201 gdb_test_multiple "print &dm_type_void_star" \ 202 "detect dm_type_void_star" { 203 -re ".*dm_type_void_star\\(void \\*\\).*\r\n$gdb_prompt $" { 204 # v2 demangler 205 set dm_type_void_star "void *" 206 pass "detect dm_type_void_star" 207 } 208 -re ".*dm_type_void_star\\(void\\*\\).*\r\n$gdb_prompt $" { 209 # v3 demangler 210 pass "detect dm_type_void_star" 211 } 212 } 213 214 gdb_test_multiple "print &dm_type_short" \ 215 "detect dm_type_short" { 216 -re ".*dm_type_short\\(short\\).*\r\n$gdb_prompt $" { 217 # v2 and v3 demanglers 218 pass "detect dm_type_short" 219 } 220 -re ".*dm_type_short\\(short int\\).*\r\n$gdb_prompt $" { 221 # GDB type printer 222 set dm_type_short "short int" 223 pass "detect dm_type_short" 224 } 225 } 226 227 gdb_test_multiple "print &dm_type_unsigned_short" \ 228 "detect dm_type_unsigned_short" { 229 -re ".*dm_type_unsigned_short\\(unsigned short\\).*\r\n$gdb_prompt $" { 230 # v2 and v3 demanglers 231 pass "detect dm_type_unsigned_short" 232 } 233 -re ".*dm_type_unsigned_short\\(short unsigned int\\).*\r\n$gdb_prompt $" { 234 # GDB type printer 235 set dm_type_unsigned_short "short unsigned int" 236 pass "detect dm_type_unsigned_short" 237 } 238 } 239 240 gdb_test_multiple "print &dm_type_long" \ 241 "detect dm_type_long" { 242 -re ".*dm_type_long\\(long\\).*\r\n$gdb_prompt $" { 243 # v2 and v3 demanglers 244 pass "detect dm_type_long" 245 } 246 -re ".*dm_type_long\\(long int\\).*\r\n$gdb_prompt $" { 247 # GDB type printer 248 set dm_type_long "long int" 249 pass "detect dm_type_long" 250 } 251 } 252 253 gdb_test_multiple "print &dm_type_unsigned_long" \ 254 "detect dm_type_unsigned_long" { 255 -re ".*dm_type_unsigned_long\\(unsigned long\\).*\r\n$gdb_prompt $" { 256 # v2 and v3 demanglers 257 pass "detect dm_type_unsigned_long" 258 } 259 -re ".*dm_type_unsigned_long\\(long unsigned int\\).*\r\n$gdb_prompt $" { 260 # GDB type printer 261 set dm_type_unsigned_long "long unsigned int" 262 pass "detect dm_type_unsigned_long" 263 } 264 } 265 266 gdb_test_multiple "print &dm_type_typedef" \ 267 "detect dm_type_typedef" { 268 -re ".*dm_type_typedef\\(int\\).*\r\n$gdb_prompt $" { 269 # v2 and v3 demanglers 270 pass "detect dm_type_typedef" 271 } 272 -re ".*dm_type_typedef\\(myint\\).*\r\n$gdb_prompt $" { 273 # GDB type printer 274 set dm_type_typedef 1 275 pass "detect dm_type_typedef" 276 } 277 } 278} 279 280# 281# Lookup a specific C++ function and print the demangled type. 282# This form accepts the demangled type as a regexp. 283# 284 285proc info_func_regexp { name demangled } { 286 global srcfile decimal 287 288 regsub {\\\(void\\\)} $demangled {\(\)} demangled 289 290 set file_re "File .*[string_to_regexp $srcfile]:" 291 292 gdb_test_lines "info function $name" "info function for \"$name\"" \ 293 [multi_line \ 294 "$file_re" \ 295 "$decimal:\t(class|)${demangled}.*"] 296} 297 298# 299# Lookup a specific C++ function and print the demangled type. 300# This form accepts the demangled type as a literal string. 301# 302 303proc info_func { name demangled } { 304 info_func_regexp "$name" [string_to_regexp "$demangled"] 305} 306 307# 308# Print the address of a function. 309# This checks that I can lookup a fully qualified C++ function. 310# This also checks the argument types on the return string. 311 312# Note: carlton/2003-01-16: If you modify this, make a corresponding 313# modification to print_addr_2_kfail. 314 315proc print_addr_2 { name good } { 316 global gdb_prompt 317 global hex 318 319 set good_pattern [string_to_regexp $good] 320 321 gdb_test "print &$name" \ 322 ".* = .* $hex <$good_pattern>" 323} 324 325# NOTE: carlton/2003-01-16: hairyfunc5-6 fail on GCC 3.x (for at least 326# x=1 and x=2.1). So I'm modifying print_addr_2 to accept a failure 327# condition. FIXME: It would be nice if the failure condition were 328# conditional on the compiler version, but I'm not sufficiently 329# motivated. I did hardwire in the versions of char * and int *, 330# which will give some compiler-specificity to the failure. 331 332proc print_addr_2_kfail { name good bad bugid } { 333 global gdb_prompt 334 global hex 335 336 set good_pattern [string_to_regexp $good] 337 set bad_pattern [string_to_regexp $bad] 338 339 gdb_test_multiple "print &$name" "print &$name" { 340 -re ".* = .* $hex <$good_pattern>\r\n$gdb_prompt $" { 341 pass "print &$name" 342 } 343 -re ".* = .* $hex <$bad_pattern>\r\n$gdb_prompt $" { 344 kfail $bugid "print &$name" 345 } 346 } 347} 348 349# 350# Simple interfaces to print_addr_2. 351# 352 353proc print_addr { name } { 354 regsub {\(void\)} $name {()} expected 355 if {[string first "::" $name] == -1} { 356 # C function -- must be qutoed 357 set name "'$name'" 358 } 359 print_addr_2 "$name" $expected 360} 361 362# 363# Test name demangling for operators. 364# 365# The '(' at the end of each regex input pattern is so that we match only 366# the one we are looking for. I.E. "operator&" would match both 367# "operator&(foo &)" and "operator&&(foo &)". 368# 369# gdb-gnats bug gdb/18: 370# "gdb can't parse "info func operator*" or "info func operator\*". 371# The star in "operator*" is interpreted as a regexp, but the "\*" 372# in "operator\*" is not a legal operator. 373# 374 375proc test_lookup_operator_functions {} { 376 global dm_operator_comma 377 global dm_operator_char_star 378 global dm_type_char_star 379 global dm_operator_char_star_quoted 380 global dm_type_foo_ref 381 global dm_type_void 382 global dm_type_void_star 383 384 # operator* requires quoting so that GDB does not treat it as a regexp. 385 info_func "operator\\*(" "void foo::operator*($dm_type_foo_ref);" 386 info_func "operator%(" "void foo::operator%($dm_type_foo_ref);" 387 info_func "operator-(" "void foo::operator-($dm_type_foo_ref);" 388 info_func "operator>>(" "void foo::operator>>($dm_type_foo_ref);" 389 info_func "operator!=(" "void foo::operator!=($dm_type_foo_ref);" 390 info_func "operator>(" "void foo::operator>($dm_type_foo_ref);" 391 info_func "operator>=(" "void foo::operator>=($dm_type_foo_ref);" 392 info_func "operator|(" "void foo::operator|($dm_type_foo_ref);" 393 info_func "operator&&(" "void foo::operator&&($dm_type_foo_ref);" 394 info_func "operator!(" "void foo::operator!($dm_type_void);" 395 info_func "operator++(" "void foo::operator++(int);" 396 info_func "operator=(" "void foo::operator=($dm_type_foo_ref);" 397 info_func "operator+=(" "void foo::operator+=($dm_type_foo_ref);" 398 # operator*= requires quoting so that GDB does not treat it as a regexp. 399 info_func "operator\\*=(" "void foo::operator*=($dm_type_foo_ref);" 400 info_func "operator%=(" "void foo::operator%=($dm_type_foo_ref);" 401 info_func "operator>>=(" "void foo::operator>>=($dm_type_foo_ref);" 402 info_func "operator|=(" "void foo::operator|=($dm_type_foo_ref);" 403 info_func "operator$dm_operator_comma\(" \ 404 "void foo::operator$dm_operator_comma\($dm_type_foo_ref);" 405 info_func "operator/(" "void foo::operator/($dm_type_foo_ref);" 406 info_func "operator+(" "void foo::operator+($dm_type_foo_ref);" 407 info_func "operator<<(" "void foo::operator<<($dm_type_foo_ref);" 408 info_func "operator==(" "void foo::operator==($dm_type_foo_ref);" 409 info_func "operator<(" "void foo::operator<($dm_type_foo_ref);" 410 info_func "operator<=(" "void foo::operator<=($dm_type_foo_ref);" 411 info_func "operator&(" "void foo::operator&($dm_type_foo_ref);" 412 info_func "operator^(" "void foo::operator^($dm_type_foo_ref);" 413 info_func "operator||(" "void foo::operator||($dm_type_foo_ref);" 414 info_func "operator~(" "void foo::operator~($dm_type_void);" 415 info_func "operator--(" "void foo::operator--(int);" 416 info_func "operator->(" "foo *foo::operator->($dm_type_void);" 417 info_func "operator-=(" "void foo::operator-=($dm_type_foo_ref);" 418 info_func "operator/=(" "void foo::operator/=($dm_type_foo_ref);" 419 info_func "operator<<=(" "void foo::operator<<=($dm_type_foo_ref);" 420 info_func "operator&=(" "void foo::operator&=($dm_type_foo_ref);" 421 info_func "operator^=(" "void foo::operator^=($dm_type_foo_ref);" 422 # operator->* requires quoting so that GDB does not treat it as a regexp. 423 info_func "operator->\\*(" "void foo::operator->*($dm_type_foo_ref);" 424 425 # operator[] needs double backslashes, so that a single backslash 426 # will be sent to GDB, preventing the square brackets from being 427 # evaluated as a regular expression. 428 info_func "operator\\\[\\\](" "void foo::operator\[\]($dm_type_foo_ref);" 429 430 # These are gnarly because they might end with 'static'. 431 set dm_type_void_star_regexp [string_to_regexp $dm_type_void_star] 432 info_func_regexp "operator new(" "void \\*foo::operator new\\(.*\\)(| static);" 433 info_func_regexp "operator delete(" "void foo::operator delete\\($dm_type_void_star_regexp\\)(| static);" 434 435 info_func "operator int(" "int foo::operator int($dm_type_void);" 436 info_func "operator()(" "void foo::operator()($dm_type_foo_ref);" 437 info_func "operator $dm_operator_char_star_quoted\(" \ 438 "char *foo::operator $dm_operator_char_star\($dm_type_void);" 439 440} 441 442 443proc test_paddr_operator_functions {} { 444 global hex 445 global dm_operator_comma 446 global dm_type_char_star 447 global dm_type_foo_ref 448 global dm_type_long_star 449 global dm_type_unsigned_int 450 global dm_type_void 451 global dm_type_void_star 452 global dm_operator_char_star 453 454 print_addr "foo::operator*($dm_type_foo_ref)" 455 print_addr "foo::operator%($dm_type_foo_ref)" 456 print_addr "foo::operator-($dm_type_foo_ref)" 457 print_addr "foo::operator>>($dm_type_foo_ref)" 458 print_addr "foo::operator!=($dm_type_foo_ref)" 459 print_addr "foo::operator>($dm_type_foo_ref)" 460 print_addr "foo::operator>=($dm_type_foo_ref)" 461 print_addr "foo::operator|($dm_type_foo_ref)" 462 print_addr "foo::operator&&($dm_type_foo_ref)" 463 print_addr "foo::operator!($dm_type_void)" 464 print_addr "foo::operator++(int)" 465 print_addr "foo::operator=($dm_type_foo_ref)" 466 print_addr "foo::operator+=($dm_type_foo_ref)" 467 print_addr "foo::operator*=($dm_type_foo_ref)" 468 print_addr "foo::operator%=($dm_type_foo_ref)" 469 print_addr "foo::operator>>=($dm_type_foo_ref)" 470 print_addr "foo::operator|=($dm_type_foo_ref)" 471 print_addr "foo::operator$dm_operator_comma\($dm_type_foo_ref)" 472 print_addr "foo::operator/($dm_type_foo_ref)" 473 print_addr "foo::operator+($dm_type_foo_ref)" 474 print_addr "foo::operator<<($dm_type_foo_ref)" 475 print_addr "foo::operator==($dm_type_foo_ref)" 476 print_addr "foo::operator<($dm_type_foo_ref)" 477 print_addr "foo::operator<=($dm_type_foo_ref)" 478 print_addr "foo::operator&($dm_type_foo_ref)" 479 print_addr "foo::operator^($dm_type_foo_ref)" 480 print_addr "foo::operator||($dm_type_foo_ref)" 481 print_addr "foo::operator~($dm_type_void)" 482 print_addr "foo::operator--(int)" 483 print_addr "foo::operator->($dm_type_void)" 484 print_addr "foo::operator-=($dm_type_foo_ref)" 485 print_addr "foo::operator/=($dm_type_foo_ref)" 486 print_addr "foo::operator<<=($dm_type_foo_ref)" 487 print_addr "foo::operator&=($dm_type_foo_ref)" 488 print_addr "foo::operator^=($dm_type_foo_ref)" 489 print_addr "foo::operator->*($dm_type_foo_ref)" 490 print_addr "foo::operator\[\]($dm_type_foo_ref)" 491 print_addr "foo::operator()($dm_type_foo_ref)" 492 493 gdb_test "print &foo::operator new" \ 494 " = .* $hex <foo::operator new\\(.*\\)(| static)>" 495 gdb_test "print &foo::operator new\[\]" \ 496 " = .* $hex <foo::operator new\\\[\\\]\\(.*\\)(| static)>" 497 498 print_addr "foo::operator delete($dm_type_void_star)" 499 print_addr "foo::operator delete\[\]($dm_type_void_star)" 500 501 print_addr "foo::operator int($dm_type_void)" 502 print_addr "foo::operator $dm_operator_char_star\($dm_type_void)" 503} 504 505# 506# Test overloaded functions (1 arg). 507# 508 509proc test_paddr_overloaded_functions {} { 510 global dm_type_unsigned_int 511 global dm_type_void 512 global dm_type_short 513 global dm_type_unsigned_short 514 global dm_type_long 515 global dm_type_unsigned_long 516 517 print_addr "overload1arg($dm_type_void)" 518 print_addr "overload1arg(char)" 519 print_addr "overload1arg(signed char)" 520 print_addr "overload1arg(unsigned char)" 521 print_addr "overload1arg($dm_type_short)" 522 print_addr "overload1arg($dm_type_unsigned_short)" 523 print_addr "overload1arg(int)" 524 print_addr "overload1arg($dm_type_unsigned_int)" 525 print_addr "overload1arg($dm_type_long)" 526 print_addr "overload1arg($dm_type_unsigned_long)" 527 print_addr "overload1arg(float)" 528 print_addr "overload1arg(double)" 529 530 print_addr "overloadargs(int)" 531 print_addr "overloadargs(int, int)" 532 print_addr "overloadargs(int, int, int)" 533 print_addr "overloadargs(int, int, int, int)" 534 print_addr "overloadargs(int, int, int, int, int)" 535 print_addr "overloadargs(int, int, int, int, int, int)" 536 print_addr "overloadargs(int, int, int, int, int, int, int)" 537 print_addr "overloadargs(int, int, int, int, int, int, int, int)" 538 print_addr "overloadargs(int, int, int, int, int, int, int, int, int)" 539 print_addr "overloadargs(int, int, int, int, int, int, int, int, int, int)" 540 print_addr "overloadargs(int, int, int, int, int, int, int, int, int, int, int)" 541} 542 543proc test_paddr_hairy_functions {} { 544 global gdb_prompt 545 global hex 546 global dm_type_char_star 547 global dm_type_int_star 548 global dm_type_long_star 549 global dm_type_typedef 550 551 print_addr_2 "hairyfunc1" "hairyfunc1(int)" 552 553 if {$dm_type_typedef == 0} { 554 print_addr_2 "hairyfunc2" "hairyfunc2(int (*)($dm_type_char_star))" 555 print_addr_2 "hairyfunc3" "hairyfunc3(int (*)(short (*)($dm_type_long_star)))" 556 print_addr_2 "hairyfunc4" "hairyfunc4(int (*)(short (*)($dm_type_char_star)))" 557 558 # gdb-gnats bug gdb/19: 559 # "gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7" 560 print_addr_2_kfail "hairyfunc5" "hairyfunc5(int (*(*)($dm_type_char_star))(long))" "hairyfunc5(int (*)(long) (*)(char*))" "gdb/19" 561 print_addr_2_kfail "hairyfunc6" "hairyfunc6(int (*(*)($dm_type_int_star))(long))" "hairyfunc6(int (*)(long) (*)(int*))" "gdb/19" 562 print_addr_2_kfail "hairyfunc7" "hairyfunc7(int (*(*)(int (*)($dm_type_char_star)))(long))" "hairyfunc7(int (*)(long) (*)(int (*)(char*)))" "gdb/19" 563 } else { 564 print_addr_2 "hairyfunc2" "hairyfunc2(PFPc_i)" 565 print_addr_2 "hairyfunc3" "hairyfunc3(PFPFPl_s_i)" 566 print_addr_2 "hairyfunc4" "hairyfunc4(PFPFPc_s_i)" 567 568 # gdb-gnats bug gdb/19: 569 # "gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7" 570 print_addr_2 "hairyfunc5" "hairyfunc5(PFPc_PFl_i)" 571 print_addr_2 "hairyfunc6" "hairyfunc6(PFPi_PFl_i)" 572 print_addr_2 "hairyfunc7" "hairyfunc7(PFPFPc_i_PFl_i)" 573 } 574} 575 576proc do_tests {} { 577 global binfile 578 global dm_type_int_star 579 580 gdb_test_no_output "set width 0" 581 582 runto_main 583 584 gdb_test_no_output "set language c++" 585 probe_demangler 586 test_paddr_overloaded_functions 587 test_paddr_operator_functions 588 test_paddr_hairy_functions 589 test_lookup_operator_functions 590 591 # A regression test on errors involving operators 592 gdb_test "list foo::operator $dm_type_int_star" \ 593 "Function \"foo::operator [string_to_regexp $dm_type_int_star]\" not defined\\." 594} 595 596do_tests 597