├── .gdbinit ├── LICENSE └── README.md /.gdbinit: -------------------------------------------------------------------------------- 1 | # 2 | # STL GDB evaluators/views/utilities - 1.03 3 | # 4 | # The new GDB commands: 5 | # are entirely non instrumental 6 | # do not depend on any "inline"(s) - e.g. size(), [], etc 7 | # are extremely tolerant to debugger settings 8 | # 9 | # This file should be "included" in .gdbinit as following: 10 | # source stl-views.gdb or just paste it into your .gdbinit file 11 | # 12 | # The following STL containers are currently supported: 13 | # 14 | # std::vector -- via pvector command 15 | # std::list -- via plist or plist_member command 16 | # std::map -- via pmap or pmap_member command 17 | # std::multimap -- via pmap or pmap_member command 18 | # std::set -- via pset command 19 | # std::multiset -- via pset command 20 | # std::deque -- via pdequeue command 21 | # std::stack -- via pstack command 22 | # std::queue -- via pqueue command 23 | # std::priority_queue -- via ppqueue command 24 | # std::bitset -- via pbitset command 25 | # std::string -- via pstring command 26 | # std::widestring -- via pwstring command 27 | # 28 | # The end of this file contains (optional) C++ beautifiers 29 | # Make sure your debugger supports $argc 30 | # 31 | # Simple GDB Macros writen by Dan Marinescu (H-PhD) - License GPL 32 | # Inspired by intial work of Tom Malnar, 33 | # Tony Novac (PhD) / Cornell / Stanford, 34 | # Gilad Mishne (PhD) and Many Many Others. 35 | # Contact: dan_c_marinescu@yahoo.com (Subject: STL) 36 | # 37 | # Modified to work with g++ 4.3 by Anders Elton 38 | # Also added _member functions, that instead of printing the entire class in map, prints a member. 39 | 40 | 41 | 42 | # 43 | # std::vector<> 44 | # 45 | 46 | define pvector 47 | if $argc == 0 48 | help pvector 49 | else 50 | set $size = $arg0.__end_ - $arg0.__begin_ 51 | set $size_max = $size - 1 52 | end 53 | if $argc == 1 54 | set $i = 0 55 | while $i < $size 56 | printf "elem[%u]: ", $i 57 | p *($arg0.__begin_ + $i) 58 | set $i++ 59 | end 60 | end 61 | if $argc == 2 62 | set $idx = $arg1 63 | if $idx < 0 || $idx > $size_max 64 | printf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_max 65 | else 66 | printf "elem[%u]: ", $idx 67 | p *($arg0.__begin_ + $idx) 68 | end 69 | end 70 | if $argc == 3 71 | set $start_idx = $arg1 72 | set $stop_idx = $arg2 73 | if $start_idx > $stop_idx 74 | set $tmp_idx = $start_idx 75 | set $start_idx = $stop_idx 76 | set $stop_idx = $tmp_idx 77 | end 78 | if $start_idx < 0 || $stop_idx < 0 || $start_idx > $size_max || $stop_idx > $size_max 79 | printf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_max 80 | else 81 | set $i = $start_idx 82 | while $i <= $stop_idx 83 | printf "elem[%u]: ", $i 84 | p *($arg0.__begin_ + $i) 85 | set $i++ 86 | end 87 | end 88 | end 89 | if $argc > 0 90 | printf "Vector size = %u\n", $size 91 | #printf "Vector capacity = %u\n", $capacity 92 | printf "Element " 93 | whatis $arg0.__begin_ 94 | end 95 | end 96 | 97 | document pvector 98 | Prints std::vector information. 99 | Syntax: pvector 100 | Note: idx, idx1 and idx2 must be in acceptable range [0...size()-1]. 101 | Examples: 102 | pvector v - Prints vector content, size, capacity and T typedef 103 | pvector v 0 - Prints element[idx] from vector 104 | pvector v 1 2 - Prints elements in range [idx1..idx2] from vector 105 | end 106 | 107 | # 108 | # std::list<> 109 | # 110 | 111 | define plist 112 | if $argc == 0 113 | help plist 114 | else 115 | set $head = &$arg0._M_impl._M_node 116 | set $current = $arg0._M_impl._M_node._M_next 117 | set $size = 0 118 | while $current != $head 119 | if $argc == 2 120 | printf "elem[%u]: ", $size 121 | p **($arg1**)($current + 1) 122 | end 123 | if $argc == 3 124 | if $size == $arg2 125 | printf "elem[%u]: ", $size 126 | p **($arg1**)($current + 1) 127 | end 128 | end 129 | if $argc == 4 130 | if strcmp("$arg2","-context") == 0 131 | printf "elem[%u]: ", $size 132 | p (**($arg1**)($current + 1))$arg3 133 | end 134 | end 135 | set $current = $current._M_next 136 | set $size++ 137 | end 138 | printf "List size = %u \n", $size 139 | if $argc == 1 140 | printf "List " 141 | whatis $arg0 142 | printf "Use plist to see the elements in the list.\n" 143 | end 144 | end 145 | end 146 | 147 | document plist 148 | Prints std::list information. 149 | Syntax: plist : Prints list size, if T defined all elements or just element at idx 150 | Examples: 151 | plist l - prints list size and definition 152 | plist l int - prints all elements and list size 153 | plist l int 2 - prints the third element in the list (if exists) and list size 154 | end 155 | 156 | define plist_member 157 | if $argc == 0 158 | help plist_member 159 | else 160 | set $head = &$arg0._M_impl._M_node 161 | set $current = $arg0._M_impl._M_node._M_next 162 | set $size = 0 163 | while $current != $head 164 | if $argc == 3 165 | printf "elem[%u]: ", $size 166 | p (*($arg1*)($current + 1)).$arg2 167 | end 168 | if $argc == 4 169 | if $size == $arg3 170 | printf "elem[%u]: ", $size 171 | p (*($arg1*)($current + 1)).$arg2 172 | end 173 | end 174 | set $current = $current._M_next 175 | set $size++ 176 | end 177 | printf "List size = %u \n", $size 178 | if $argc == 1 179 | printf "List " 180 | whatis $arg0 181 | printf "Use plist_member to see the elements in the list.\n" 182 | end 183 | end 184 | end 185 | 186 | document plist_member 187 | Prints std::list information. 188 | Syntax: plist : Prints list size, if T defined all elements or just element at idx 189 | Examples: 190 | plist_member l int member - prints all elements and list size 191 | plist_member l int member 2 - prints the third element in the list (if exists) and list size 192 | end 193 | 194 | 195 | # 196 | # std::map and std::multimap 197 | # 198 | 199 | define pmap 200 | if $argc == 0 201 | help pmap 202 | else 203 | set $tree = $arg0 204 | set $i = 0 205 | set $node = $tree._M_t._M_impl._M_header._M_left 206 | set $end = $tree._M_t._M_impl._M_header 207 | set $tree_size = $tree._M_t._M_impl._M_node_count 208 | if $argc == 1 209 | printf "Map " 210 | whatis $tree 211 | printf "Use pmap to see the elements in the map.\n" 212 | end 213 | if $argc == 3 214 | while $i < $tree_size 215 | set $value = (void *)($node + 1) 216 | printf "elem[%u].left: ", $i 217 | p *($arg1*)$value 218 | set $value = $value + sizeof($arg1) 219 | printf "elem[%u].right: ", $i 220 | p *($arg2*)$value 221 | if $node._M_right != 0 222 | set $node = $node._M_right 223 | while $node._M_left != 0 224 | set $node = $node._M_left 225 | end 226 | else 227 | set $tmp_node = $node._M_parent 228 | while $node == $tmp_node._M_right 229 | set $node = $tmp_node 230 | set $tmp_node = $tmp_node._M_parent 231 | end 232 | if $node._M_right != $tmp_node 233 | set $node = $tmp_node 234 | end 235 | end 236 | set $i++ 237 | end 238 | end 239 | if $argc == 4 240 | set $idx = $arg3 241 | set $ElementsFound = 0 242 | while $i < $tree_size 243 | set $value = (void *)($node + 1) 244 | if *($arg1*)$value == $idx 245 | printf "elem[%u].left: ", $i 246 | p *($arg1*)$value 247 | set $value = $value + sizeof($arg1) 248 | printf "elem[%u].right: ", $i 249 | p *($arg2*)$value 250 | set $ElementsFound++ 251 | end 252 | if $node._M_right != 0 253 | set $node = $node._M_right 254 | while $node._M_left != 0 255 | set $node = $node._M_left 256 | end 257 | else 258 | set $tmp_node = $node._M_parent 259 | while $node == $tmp_node._M_right 260 | set $node = $tmp_node 261 | set $tmp_node = $tmp_node._M_parent 262 | end 263 | if $node._M_right != $tmp_node 264 | set $node = $tmp_node 265 | end 266 | end 267 | set $i++ 268 | end 269 | printf "Number of elements found = %u\n", $ElementsFound 270 | end 271 | if $argc == 5 272 | set $idx1 = $arg3 273 | set $idx2 = $arg4 274 | set $ElementsFound = 0 275 | while $i < $tree_size 276 | set $value = (void *)($node + 1) 277 | set $valueLeft = *($arg1*)$value 278 | set $valueRight = *($arg2*)($value + sizeof($arg1)) 279 | if $valueLeft == $idx1 && $valueRight == $idx2 280 | printf "elem[%u].left: ", $i 281 | p $valueLeft 282 | printf "elem[%u].right: ", $i 283 | p $valueRight 284 | set $ElementsFound++ 285 | end 286 | if $node._M_right != 0 287 | set $node = $node._M_right 288 | while $node._M_left != 0 289 | set $node = $node._M_left 290 | end 291 | else 292 | set $tmp_node = $node._M_parent 293 | while $node == $tmp_node._M_right 294 | set $node = $tmp_node 295 | set $tmp_node = $tmp_node._M_parent 296 | end 297 | if $node._M_right != $tmp_node 298 | set $node = $tmp_node 299 | end 300 | end 301 | set $i++ 302 | end 303 | printf "Number of elements found = %u\n", $ElementsFound 304 | end 305 | printf "Map size = %u\n", $tree_size 306 | end 307 | end 308 | 309 | document pmap 310 | Prints std::map or std::multimap information. Works for std::multimap as well. 311 | Syntax: pmap : Prints map size, if T defined all elements or just element(s) with val(s) 312 | Examples: 313 | pmap m - prints map size and definition 314 | pmap m int int - prints all elements and map size 315 | pmap m int int 20 - prints the element(s) with left-value = 20 (if any) and map size 316 | pmap m int int 20 200 - prints the element(s) with left-value = 20 and right-value = 200 (if any) and map size 317 | end 318 | 319 | 320 | define pmap_member 321 | if $argc == 0 322 | help pmap_member 323 | else 324 | set $tree = $arg0 325 | set $i = 0 326 | set $node = $tree._M_t._M_impl._M_header._M_left 327 | set $end = $tree._M_t._M_impl._M_header 328 | set $tree_size = $tree._M_t._M_impl._M_node_count 329 | if $argc == 1 330 | printf "Map " 331 | whatis $tree 332 | printf "Use pmap to see the elements in the map.\n" 333 | end 334 | if $argc == 5 335 | while $i < $tree_size 336 | set $value = (void *)($node + 1) 337 | printf "elem[%u].left: ", $i 338 | p (*($arg1*)$value).$arg2 339 | set $value = $value + sizeof($arg1) 340 | printf "elem[%u].right: ", $i 341 | p (*($arg3*)$value).$arg4 342 | if $node._M_right != 0 343 | set $node = $node._M_right 344 | while $node._M_left != 0 345 | set $node = $node._M_left 346 | end 347 | else 348 | set $tmp_node = $node._M_parent 349 | while $node == $tmp_node._M_right 350 | set $node = $tmp_node 351 | set $tmp_node = $tmp_node._M_parent 352 | end 353 | if $node._M_right != $tmp_node 354 | set $node = $tmp_node 355 | end 356 | end 357 | set $i++ 358 | end 359 | end 360 | if $argc == 6 361 | set $idx = $arg5 362 | set $ElementsFound = 0 363 | while $i < $tree_size 364 | set $value = (void *)($node + 1) 365 | if *($arg1*)$value == $idx 366 | printf "elem[%u].left: ", $i 367 | p (*($arg1*)$value).$arg2 368 | set $value = $value + sizeof($arg1) 369 | printf "elem[%u].right: ", $i 370 | p (*($arg3*)$value).$arg4 371 | set $ElementsFound++ 372 | end 373 | if $node._M_right != 0 374 | set $node = $node._M_right 375 | while $node._M_left != 0 376 | set $node = $node._M_left 377 | end 378 | else 379 | set $tmp_node = $node._M_parent 380 | while $node == $tmp_node._M_right 381 | set $node = $tmp_node 382 | set $tmp_node = $tmp_node._M_parent 383 | end 384 | if $node._M_right != $tmp_node 385 | set $node = $tmp_node 386 | end 387 | end 388 | set $i++ 389 | end 390 | printf "Number of elements found = %u\n", $ElementsFound 391 | end 392 | printf "Map size = %u\n", $tree_size 393 | end 394 | end 395 | 396 | document pmap_member 397 | Prints std::map or std::multimap information. Works for std::multimap as well. 398 | Syntax: pmap : Prints map size, if T defined all elements or just element(s) with val(s) 399 | Examples: 400 | pmap_member m class1 member1 class2 member2 - prints class1.member1 : class2.member2 401 | pmap_member m class1 member1 class2 member2 lvalue - prints class1.member1 : class2.member2 where class1 == lvalue 402 | end 403 | 404 | 405 | # 406 | # std::set and std::multiset 407 | # 408 | 409 | define pset 410 | if $argc == 0 411 | help pset 412 | else 413 | set $tree = $arg0 414 | set $i = 0 415 | set $node = $tree._M_t._M_impl._M_header._M_left 416 | set $end = $tree._M_t._M_impl._M_header 417 | set $tree_size = $tree._M_t._M_impl._M_node_count 418 | if $argc == 1 419 | printf "Set " 420 | whatis $tree 421 | printf "Use pset to see the elements in the set.\n" 422 | end 423 | if $argc == 2 424 | while $i < $tree_size 425 | set $value = (void *)($node + 1) 426 | printf "elem[%u]: ", $i 427 | p *($arg1*)$value 428 | if $node._M_right != 0 429 | set $node = $node._M_right 430 | while $node._M_left != 0 431 | set $node = $node._M_left 432 | end 433 | else 434 | set $tmp_node = $node._M_parent 435 | while $node == $tmp_node._M_right 436 | set $node = $tmp_node 437 | set $tmp_node = $tmp_node._M_parent 438 | end 439 | if $node._M_right != $tmp_node 440 | set $node = $tmp_node 441 | end 442 | end 443 | set $i++ 444 | end 445 | end 446 | if $argc == 3 447 | set $idx = $arg2 448 | set $ElementsFound = 0 449 | while $i < $tree_size 450 | set $value = (void *)($node + 1) 451 | if *($arg1*)$value == $idx 452 | printf "elem[%u]: ", $i 453 | p *($arg1*)$value 454 | set $ElementsFound++ 455 | end 456 | if $node._M_right != 0 457 | set $node = $node._M_right 458 | while $node._M_left != 0 459 | set $node = $node._M_left 460 | end 461 | else 462 | set $tmp_node = $node._M_parent 463 | while $node == $tmp_node._M_right 464 | set $node = $tmp_node 465 | set $tmp_node = $tmp_node._M_parent 466 | end 467 | if $node._M_right != $tmp_node 468 | set $node = $tmp_node 469 | end 470 | end 471 | set $i++ 472 | end 473 | printf "Number of elements found = %u\n", $ElementsFound 474 | end 475 | printf "Set size = %u\n", $tree_size 476 | end 477 | end 478 | 479 | document pset 480 | Prints std::set or std::multiset information. Works for std::multiset as well. 481 | Syntax: pset : Prints set size, if T defined all elements or just element(s) having val 482 | Examples: 483 | pset s - prints set size and definition 484 | pset s int - prints all elements and the size of s 485 | pset s int 20 - prints the element(s) with value = 20 (if any) and the size of s 486 | end 487 | 488 | 489 | 490 | # 491 | # std::dequeue 492 | # 493 | 494 | define pdequeue 495 | if $argc == 0 496 | help pdequeue 497 | else 498 | set $size = 0 499 | set $start_cur = $arg0._M_impl._M_start._M_cur 500 | set $start_last = $arg0._M_impl._M_start._M_last 501 | set $start_stop = $start_last 502 | while $start_cur != $start_stop 503 | p *$start_cur 504 | set $start_cur++ 505 | set $size++ 506 | end 507 | set $finish_first = $arg0._M_impl._M_finish._M_first 508 | set $finish_cur = $arg0._M_impl._M_finish._M_cur 509 | set $finish_last = $arg0._M_impl._M_finish._M_last 510 | if $finish_cur < $finish_last 511 | set $finish_stop = $finish_cur 512 | else 513 | set $finish_stop = $finish_last 514 | end 515 | while $finish_first != $finish_stop 516 | p *$finish_first 517 | set $finish_first++ 518 | set $size++ 519 | end 520 | printf "Dequeue size = %u\n", $size 521 | end 522 | end 523 | 524 | document pdequeue 525 | Prints std::dequeue information. 526 | Syntax: pdequeue : Prints dequeue size, if T defined all elements 527 | Deque elements are listed "left to right" (left-most stands for front and right-most stands for back) 528 | Example: 529 | pdequeue d - prints all elements and size of d 530 | end 531 | 532 | 533 | 534 | # 535 | # std::stack 536 | # 537 | 538 | define pstack 539 | if $argc == 0 540 | help pstack 541 | else 542 | set $start_cur = $arg0.c._M_impl._M_start._M_cur 543 | set $finish_cur = $arg0.c._M_impl._M_finish._M_cur 544 | set $size = $finish_cur - $start_cur 545 | set $i = $size - 1 546 | while $i >= 0 547 | p *($start_cur + $i) 548 | set $i-- 549 | end 550 | printf "Stack size = %u\n", $size 551 | end 552 | end 553 | 554 | document pstack 555 | Prints std::stack information. 556 | Syntax: pstack : Prints all elements and size of the stack 557 | Stack elements are listed "top to buttom" (top-most element is the first to come on pop) 558 | Example: 559 | pstack s - prints all elements and the size of s 560 | end 561 | 562 | 563 | 564 | # 565 | # std::queue 566 | # 567 | 568 | define pqueue 569 | if $argc == 0 570 | help pqueue 571 | else 572 | set $start_cur = $arg0.c._M_impl._M_start._M_cur 573 | set $finish_cur = $arg0.c._M_impl._M_finish._M_cur 574 | set $size = $finish_cur - $start_cur 575 | set $i = 0 576 | while $i < $size 577 | p *($start_cur + $i) 578 | set $i++ 579 | end 580 | printf "Queue size = %u\n", $size 581 | end 582 | end 583 | 584 | document pqueue 585 | Prints std::queue information. 586 | Syntax: pqueue : Prints all elements and the size of the queue 587 | Queue elements are listed "top to bottom" (top-most element is the first to come on pop) 588 | Example: 589 | pqueue q - prints all elements and the size of q 590 | end 591 | 592 | 593 | 594 | # 595 | # std::priority_queue 596 | # 597 | 598 | define ppqueue 599 | if $argc == 0 600 | help ppqueue 601 | else 602 | set $size = $arg0.c._M_impl._M_finish - $arg0.c._M_impl._M_start 603 | set $capacity = $arg0.c._M_impl._M_end_of_storage - $arg0.c._M_impl._M_start 604 | set $i = $size - 1 605 | while $i >= 0 606 | p *($arg0.c._M_impl._M_start + $i) 607 | set $i-- 608 | end 609 | printf "Priority queue size = %u\n", $size 610 | printf "Priority queue capacity = %u\n", $capacity 611 | end 612 | end 613 | 614 | document ppqueue 615 | Prints std::priority_queue information. 616 | Syntax: ppqueue : Prints all elements, size and capacity of the priority_queue 617 | Priority_queue elements are listed "top to buttom" (top-most element is the first to come on pop) 618 | Example: 619 | ppqueue pq - prints all elements, size and capacity of pq 620 | end 621 | 622 | 623 | 624 | # 625 | # std::bitset 626 | # 627 | 628 | define pbitset 629 | if $argc == 0 630 | help pbitset 631 | else 632 | p /t $arg0._M_w 633 | end 634 | end 635 | 636 | document pbitset 637 | Prints std::bitset information. 638 | Syntax: pbitset : Prints all bits in bitset 639 | Example: 640 | pbitset b - prints all bits in b 641 | end 642 | 643 | 644 | 645 | # 646 | # std::string 647 | # 648 | 649 | define pstring 650 | if $argc == 0 651 | help pstring 652 | else 653 | printf "String \t\t\t= \"%s\"\n", $arg0._M_data() 654 | printf "String size/length \t= %u\n", $arg0._M_rep()._M_length 655 | printf "String capacity \t= %u\n", $arg0._M_rep()._M_capacity 656 | printf "String ref-count \t= %d\n", $arg0._M_rep()._M_refcount 657 | end 658 | end 659 | 660 | document pstring 661 | Prints std::string information. 662 | Syntax: pstring 663 | Example: 664 | pstring s - Prints content, size/length, capacity and ref-count of string s 665 | end 666 | 667 | # 668 | # std::wstring 669 | # 670 | 671 | define pwstring 672 | if $argc == 0 673 | help pwstring 674 | else 675 | call printf("WString \t\t= \"%ls\"\n", $arg0._M_data()) 676 | printf "WString size/length \t= %u\n", $arg0._M_rep()._M_length 677 | printf "WString capacity \t= %u\n", $arg0._M_rep()._M_capacity 678 | printf "WString ref-count \t= %d\n", $arg0._M_rep()._M_refcount 679 | end 680 | end 681 | 682 | document pwstring 683 | Prints std::wstring information. 684 | Syntax: pwstring 685 | Example: 686 | pwstring s - Prints content, size/length, capacity and ref-count of wstring s 687 | end 688 | 689 | # 690 | # C++ related beautifiers (optional) 691 | # 692 | 693 | set print pretty on 694 | set print object on 695 | set print static-members on 696 | set print vtbl on 697 | set print demangle on 698 | set demangle-style gnu-v3 699 | set print sevenbit-strings off 700 | 701 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License, version 2.0 2 | 3 | 1. Definitions 4 | 5 | 1.1. "Contributor" 6 | 7 | means each individual or legal entity that creates, contributes to the 8 | creation of, or owns Covered Software. 9 | 10 | 1.2. "Contributor Version" 11 | 12 | means the combination of the Contributions of others (if any) used by a 13 | Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | 17 | means Covered Software of a particular Contributor. 18 | 19 | 1.4. "Covered Software" 20 | 21 | means Source Code Form to which the initial Contributor has attached the 22 | notice in Exhibit A, the Executable Form of such Source Code Form, and 23 | Modifications of such Source Code Form, in each case including portions 24 | thereof. 25 | 26 | 1.5. "Incompatible With Secondary Licenses" 27 | means 28 | 29 | a. that the initial Contributor has attached the notice described in 30 | Exhibit B to the Covered Software; or 31 | 32 | b. that the Covered Software was made available under the terms of 33 | version 1.1 or earlier of the License, but not also under the terms of 34 | a Secondary License. 35 | 36 | 1.6. "Executable Form" 37 | 38 | means any form of the work other than Source Code Form. 39 | 40 | 1.7. "Larger Work" 41 | 42 | means a work that combines Covered Software with other material, in a 43 | separate file or files, that is not Covered Software. 44 | 45 | 1.8. "License" 46 | 47 | means this document. 48 | 49 | 1.9. "Licensable" 50 | 51 | means having the right to grant, to the maximum extent possible, whether 52 | at the time of the initial grant or subsequently, any and all of the 53 | rights conveyed by this License. 54 | 55 | 1.10. "Modifications" 56 | 57 | means any of the following: 58 | 59 | a. any file in Source Code Form that results from an addition to, 60 | deletion from, or modification of the contents of Covered Software; or 61 | 62 | b. any new file in Source Code Form that contains any Covered Software. 63 | 64 | 1.11. "Patent Claims" of a Contributor 65 | 66 | means any patent claim(s), including without limitation, method, 67 | process, and apparatus claims, in any patent Licensable by such 68 | Contributor that would be infringed, but for the grant of the License, 69 | by the making, using, selling, offering for sale, having made, import, 70 | or transfer of either its Contributions or its Contributor Version. 71 | 72 | 1.12. "Secondary License" 73 | 74 | means either the GNU General Public License, Version 2.0, the GNU Lesser 75 | General Public License, Version 2.1, the GNU Affero General Public 76 | License, Version 3.0, or any later versions of those licenses. 77 | 78 | 1.13. "Source Code Form" 79 | 80 | means the form of the work preferred for making modifications. 81 | 82 | 1.14. "You" (or "Your") 83 | 84 | means an individual or a legal entity exercising rights under this 85 | License. For legal entities, "You" includes any entity that controls, is 86 | controlled by, or is under common control with You. For purposes of this 87 | definition, "control" means (a) the power, direct or indirect, to cause 88 | the direction or management of such entity, whether by contract or 89 | otherwise, or (b) ownership of more than fifty percent (50%) of the 90 | outstanding shares or beneficial ownership of such entity. 91 | 92 | 93 | 2. License Grants and Conditions 94 | 95 | 2.1. Grants 96 | 97 | Each Contributor hereby grants You a world-wide, royalty-free, 98 | non-exclusive license: 99 | 100 | a. under intellectual property rights (other than patent or trademark) 101 | Licensable by such Contributor to use, reproduce, make available, 102 | modify, display, perform, distribute, and otherwise exploit its 103 | Contributions, either on an unmodified basis, with Modifications, or 104 | as part of a Larger Work; and 105 | 106 | b. under Patent Claims of such Contributor to make, use, sell, offer for 107 | sale, have made, import, and otherwise transfer either its 108 | Contributions or its Contributor Version. 109 | 110 | 2.2. Effective Date 111 | 112 | The licenses granted in Section 2.1 with respect to any Contribution 113 | become effective for each Contribution on the date the Contributor first 114 | distributes such Contribution. 115 | 116 | 2.3. Limitations on Grant Scope 117 | 118 | The licenses granted in this Section 2 are the only rights granted under 119 | this License. No additional rights or licenses will be implied from the 120 | distribution or licensing of Covered Software under this License. 121 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 122 | Contributor: 123 | 124 | a. for any code that a Contributor has removed from Covered Software; or 125 | 126 | b. for infringements caused by: (i) Your and any other third party's 127 | modifications of Covered Software, or (ii) the combination of its 128 | Contributions with other software (except as part of its Contributor 129 | Version); or 130 | 131 | c. under Patent Claims infringed by Covered Software in the absence of 132 | its Contributions. 133 | 134 | This License does not grant any rights in the trademarks, service marks, 135 | or logos of any Contributor (except as may be necessary to comply with 136 | the notice requirements in Section 3.4). 137 | 138 | 2.4. Subsequent Licenses 139 | 140 | No Contributor makes additional grants as a result of Your choice to 141 | distribute the Covered Software under a subsequent version of this 142 | License (see Section 10.2) or under the terms of a Secondary License (if 143 | permitted under the terms of Section 3.3). 144 | 145 | 2.5. Representation 146 | 147 | Each Contributor represents that the Contributor believes its 148 | Contributions are its original creation(s) or it has sufficient rights to 149 | grant the rights to its Contributions conveyed by this License. 150 | 151 | 2.6. Fair Use 152 | 153 | This License is not intended to limit any rights You have under 154 | applicable copyright doctrines of fair use, fair dealing, or other 155 | equivalents. 156 | 157 | 2.7. Conditions 158 | 159 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in 160 | Section 2.1. 161 | 162 | 163 | 3. Responsibilities 164 | 165 | 3.1. Distribution of Source Form 166 | 167 | All distribution of Covered Software in Source Code Form, including any 168 | Modifications that You create or to which You contribute, must be under 169 | the terms of this License. You must inform recipients that the Source 170 | Code Form of the Covered Software is governed by the terms of this 171 | License, and how they can obtain a copy of this License. You may not 172 | attempt to alter or restrict the recipients' rights in the Source Code 173 | Form. 174 | 175 | 3.2. Distribution of Executable Form 176 | 177 | If You distribute Covered Software in Executable Form then: 178 | 179 | a. such Covered Software must also be made available in Source Code Form, 180 | as described in Section 3.1, and You must inform recipients of the 181 | Executable Form how they can obtain a copy of such Source Code Form by 182 | reasonable means in a timely manner, at a charge no more than the cost 183 | of distribution to the recipient; and 184 | 185 | b. You may distribute such Executable Form under the terms of this 186 | License, or sublicense it under different terms, provided that the 187 | license for the Executable Form does not attempt to limit or alter the 188 | recipients' rights in the Source Code Form under this License. 189 | 190 | 3.3. Distribution of a Larger Work 191 | 192 | You may create and distribute a Larger Work under terms of Your choice, 193 | provided that You also comply with the requirements of this License for 194 | the Covered Software. If the Larger Work is a combination of Covered 195 | Software with a work governed by one or more Secondary Licenses, and the 196 | Covered Software is not Incompatible With Secondary Licenses, this 197 | License permits You to additionally distribute such Covered Software 198 | under the terms of such Secondary License(s), so that the recipient of 199 | the Larger Work may, at their option, further distribute the Covered 200 | Software under the terms of either this License or such Secondary 201 | License(s). 202 | 203 | 3.4. Notices 204 | 205 | You may not remove or alter the substance of any license notices 206 | (including copyright notices, patent notices, disclaimers of warranty, or 207 | limitations of liability) contained within the Source Code Form of the 208 | Covered Software, except that You may alter any license notices to the 209 | extent required to remedy known factual inaccuracies. 210 | 211 | 3.5. Application of Additional Terms 212 | 213 | You may choose to offer, and to charge a fee for, warranty, support, 214 | indemnity or liability obligations to one or more recipients of Covered 215 | Software. However, You may do so only on Your own behalf, and not on 216 | behalf of any Contributor. You must make it absolutely clear that any 217 | such warranty, support, indemnity, or liability obligation is offered by 218 | You alone, and You hereby agree to indemnify every Contributor for any 219 | liability incurred by such Contributor as a result of warranty, support, 220 | indemnity or liability terms You offer. You may include additional 221 | disclaimers of warranty and limitations of liability specific to any 222 | jurisdiction. 223 | 224 | 4. Inability to Comply Due to Statute or Regulation 225 | 226 | If it is impossible for You to comply with any of the terms of this License 227 | with respect to some or all of the Covered Software due to statute, 228 | judicial order, or regulation then You must: (a) comply with the terms of 229 | this License to the maximum extent possible; and (b) describe the 230 | limitations and the code they affect. Such description must be placed in a 231 | text file included with all distributions of the Covered Software under 232 | this License. Except to the extent prohibited by statute or regulation, 233 | such description must be sufficiently detailed for a recipient of ordinary 234 | skill to be able to understand it. 235 | 236 | 5. Termination 237 | 238 | 5.1. The rights granted under this License will terminate automatically if You 239 | fail to comply with any of its terms. However, if You become compliant, 240 | then the rights granted under this License from a particular Contributor 241 | are reinstated (a) provisionally, unless and until such Contributor 242 | explicitly and finally terminates Your grants, and (b) on an ongoing 243 | basis, if such Contributor fails to notify You of the non-compliance by 244 | some reasonable means prior to 60 days after You have come back into 245 | compliance. Moreover, Your grants from a particular Contributor are 246 | reinstated on an ongoing basis if such Contributor notifies You of the 247 | non-compliance by some reasonable means, this is the first time You have 248 | received notice of non-compliance with this License from such 249 | Contributor, and You become compliant prior to 30 days after Your receipt 250 | of the notice. 251 | 252 | 5.2. If You initiate litigation against any entity by asserting a patent 253 | infringement claim (excluding declaratory judgment actions, 254 | counter-claims, and cross-claims) alleging that a Contributor Version 255 | directly or indirectly infringes any patent, then the rights granted to 256 | You by any and all Contributors for the Covered Software under Section 257 | 2.1 of this License shall terminate. 258 | 259 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user 260 | license agreements (excluding distributors and resellers) which have been 261 | validly granted by You or Your distributors under this License prior to 262 | termination shall survive termination. 263 | 264 | 6. Disclaimer of Warranty 265 | 266 | Covered Software is provided under this License on an "as is" basis, 267 | without warranty of any kind, either expressed, implied, or statutory, 268 | including, without limitation, warranties that the Covered Software is free 269 | of defects, merchantable, fit for a particular purpose or non-infringing. 270 | The entire risk as to the quality and performance of the Covered Software 271 | is with You. Should any Covered Software prove defective in any respect, 272 | You (not any Contributor) assume the cost of any necessary servicing, 273 | repair, or correction. This disclaimer of warranty constitutes an essential 274 | part of this License. No use of any Covered Software is authorized under 275 | this License except under this disclaimer. 276 | 277 | 7. Limitation of Liability 278 | 279 | Under no circumstances and under no legal theory, whether tort (including 280 | negligence), contract, or otherwise, shall any Contributor, or anyone who 281 | distributes Covered Software as permitted above, be liable to You for any 282 | direct, indirect, special, incidental, or consequential damages of any 283 | character including, without limitation, damages for lost profits, loss of 284 | goodwill, work stoppage, computer failure or malfunction, or any and all 285 | other commercial damages or losses, even if such party shall have been 286 | informed of the possibility of such damages. This limitation of liability 287 | shall not apply to liability for death or personal injury resulting from 288 | such party's negligence to the extent applicable law prohibits such 289 | limitation. Some jurisdictions do not allow the exclusion or limitation of 290 | incidental or consequential damages, so this exclusion and limitation may 291 | not apply to You. 292 | 293 | 8. Litigation 294 | 295 | Any litigation relating to this License may be brought only in the courts 296 | of a jurisdiction where the defendant maintains its principal place of 297 | business and such litigation shall be governed by laws of that 298 | jurisdiction, without reference to its conflict-of-law provisions. Nothing 299 | in this Section shall prevent a party's ability to bring cross-claims or 300 | counter-claims. 301 | 302 | 9. Miscellaneous 303 | 304 | This License represents the complete agreement concerning the subject 305 | matter hereof. If any provision of this License is held to be 306 | unenforceable, such provision shall be reformed only to the extent 307 | necessary to make it enforceable. Any law or regulation which provides that 308 | the language of a contract shall be construed against the drafter shall not 309 | be used to construe this License against a Contributor. 310 | 311 | 312 | 10. Versions of the License 313 | 314 | 10.1. New Versions 315 | 316 | Mozilla Foundation is the license steward. Except as provided in Section 317 | 10.3, no one other than the license steward has the right to modify or 318 | publish new versions of this License. Each version will be given a 319 | distinguishing version number. 320 | 321 | 10.2. Effect of New Versions 322 | 323 | You may distribute the Covered Software under the terms of the version 324 | of the License under which You originally received the Covered Software, 325 | or under the terms of any subsequent version published by the license 326 | steward. 327 | 328 | 10.3. Modified Versions 329 | 330 | If you create software not governed by this License, and you want to 331 | create a new license for such software, you may create and use a 332 | modified version of this License if you rename the license and remove 333 | any references to the name of the license steward (except to note that 334 | such modified license differs from this License). 335 | 336 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 337 | Licenses If You choose to distribute Source Code Form that is 338 | Incompatible With Secondary Licenses under the terms of this version of 339 | the License, the notice described in Exhibit B of this License must be 340 | attached. 341 | 342 | Exhibit A - Source Code Form License Notice 343 | 344 | This Source Code Form is subject to the 345 | terms of the Mozilla Public License, v. 346 | 2.0. If a copy of the MPL was not 347 | distributed with this file, You can 348 | obtain one at 349 | http://mozilla.org/MPL/2.0/. 350 | 351 | If it is not possible or desirable to put the notice in a particular file, 352 | then You may include the notice in a location (such as a LICENSE file in a 353 | relevant directory) where a recipient would be likely to look for such a 354 | notice. 355 | 356 | You may add additional accurate notices of copyright ownership. 357 | 358 | Exhibit B - "Incompatible With Secondary Licenses" Notice 359 | 360 | This Source Code Form is "Incompatible 361 | With Secondary Licenses", as defined by 362 | the Mozilla Public License, v. 2.0. 363 | 364 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gdb-stl-view 2 | GDB macros to print STL containers like vector, map, etc. 3 | --------------------------------------------------------------------------------