Compare commits
845 Commits
private-jk
...
master
Author | SHA1 | Date |
---|---|---|
Kevin Buettner | ed8730b4d9 | |
Keith Seitz | d7b61266b7 | |
Keith Seitz | 3ab415fc4a | |
Keith Seitz | 6aff62077b | |
Keith Seitz | ab7962ace7 | |
Fedora Release Engineering | 3c0f61139e | |
Fedora Release Engineering | 578aa401ab | |
Tom Stellard | 12a215835b | |
Jeff Law | 51337c28d9 | |
Jeff Law | 50ea6a9154 | |
Troy Dawson | f9a00bf2a5 | |
Keith Seitz | db493ec1a2 | |
Keith Seitz | b2003eae67 | |
Keith Seitz | 28b99d9981 | |
Miro Hrončok | a6ec4e0365 | |
Kevin Buettner | c54196c27b | |
Kevin Buettner | c3e0b255c8 | |
Sergio Durigan Junior | 03ff51b230 | |
Sergio Durigan Junior | 9e0dc4d5fc | |
Sergio Durigan Junior | 76de449876 | |
Sergio Durigan Junior | cd3e3d1a80 | |
Sergio Durigan Junior | 2a1cf3d881 | |
Sergio Durigan Junior | 63fa2e2956 | |
Sergio Durigan Junior | c172b26911 | |
Dan Čermák | e67700bf46 | |
Sergio Durigan Junior | a5d2c85367 | |
Fedora Release Engineering | f258b03b2f | |
Sergio Durigan Junior | 99dc38b0d5 | |
Sergio Durigan Junior | 2f578f51e4 | |
Jerry James | 86fc1101ee | |
Sergio Durigan Junior | 0a2f2a5526 | |
Sergio Durigan Junior | 8ac06474ff | |
Miro Hrončok | 92508e7ce6 | |
Sergio Durigan Junior | 9949e18054 | |
Sergio Durigan Junior | 9c37e8a0b1 | |
Miro Hrončok | ece6742a5f | |
Sergio Durigan Junior | f7760f831c | |
Fedora Release Engineering | f3efb4b040 | |
Sergio Durigan Junior | c79314bd92 | |
Sergio Durigan Junior | 292cb418af | |
Sergio Durigan Junior | 2ff911f2f5 | |
Sergio Durigan Junior | b1c3400f7f | |
Sergio Durigan Junior | 30a397d1b3 | |
Sergio Durigan Junior | cb6c609428 | |
Sergio Durigan Junior | f0a9ac3b0f | |
Sergio Durigan Junior | 06f4849386 | |
Sergio Durigan Junior | a17be6a448 | |
Sergio Durigan Junior | 865e2df5ec | |
Sergio Durigan Junior | 654fb507d8 | |
Sergio Durigan Junior | 0ec4d78c4e | |
Igor Gnatenko | d96e24456a | |
Sergio Durigan Junior | cc7695234a | |
Sergio Durigan Junior | 1b0ecbf0a5 | |
Sergio Durigan Junior | e507809c35 | |
Sergio Durigan Junior | a5d0cd87e1 | |
Sergio Durigan Junior | e90857f9de | |
Sergio Durigan Junior | 116197567a | |
Sergio Durigan Junior | 252ce24e08 | |
Sergio Durigan Junior | d1a098601d | |
Sergio Durigan Junior | 96770ac25f | |
Sergio Durigan Junior | 29841d1068 | |
Sergio Durigan Junior | b1bf7bc649 | |
Igor Gnatenko | 9404c96ac6 | |
Igor Gnatenko | e5955df97a | |
Sergio Durigan Junior | c60e39b61c | |
Fedora Release Engineering | 46d477eac9 | |
Igor Gnatenko | 538775743e | |
Sergio Durigan Junior | 0172100cc0 | |
Sergio Durigan Junior | 31f5b96fb9 | |
Sergio Durigan Junior | 2111580a73 | |
Sergio Durigan Junior | 83f9b09ebf | |
Sergio Durigan Junior | 1ea4563053 | |
Sergio Durigan Junior | 9c7d730fb9 | |
Sergio Durigan Junior | f11faa1e6a | |
Miro Hrončok | dba70321b8 | |
Sergio Durigan Junior | 6ee43aeabb | |
Sergio Durigan Junior | 4336687790 | |
Sergio Durigan Junior | e18aa17153 | |
Sergio Durigan Junior | d82716127f | |
Sergio Durigan Junior | a3b5cf46c2 | |
Jan Kratochvil | 453d99770b | |
Sergio Durigan Junior | fc163ce193 | |
Sergio Durigan Junior | 0702d0d3e8 | |
Sergio Durigan Junior | 56040033ea | |
Jan Kratochvil | 22998d94f7 | |
Sergio Durigan Junior | af8b999134 | |
Sergio Durigan Junior | b9ce1a2833 | |
Sergio Durigan Junior | f774761950 | |
Sergio Durigan Junior | 657623c611 | |
Sergio Durigan Junior | c26726c3ff | |
Sergio Durigan Junior | 76ddc56b6d | |
Jan Kratochvil | f21bb2353c | |
Sergio Durigan Junior | 2ef085ccae | |
Sergio Durigan Junior | 4f0bc6641e | |
Sergio Durigan Junior | 47b02ba87c | |
Sergio Durigan Junior | 2e649f71e0 | |
Sergio Durigan Junior | 2f6fc56e9a | |
Sergio Durigan Junior | 2cbda85f1c | |
Sergio Durigan Junior | 17183a1d49 | |
Fedora Release Engineering | d790689b70 | |
Jan Kratochvil | 138f53b360 | |
Jan Kratochvil | 5cc516897b | |
Jan Kratochvil | 4f936c1cb8 | |
Sergio Durigan Junior | 0ec66a7bfb | |
Sergio Durigan Junior | 100fc38c45 | |
Sergio Durigan Junior | e95ed4b7b3 | |
Sergio Durigan Junior | 9d054c36c2 | |
Sergio Durigan Junior | 26734721d0 | |
Sergio Durigan Junior | af046d7244 | |
Miro Hrončok | 57c3c609d3 | |
Sergio Durigan Junior | bf87ff816c | |
Sergio Durigan Junior | ab024a6de1 | |
Sergio Durigan Junior | a0d6e14aa3 | |
Sergio Durigan Junior | fd7e5d77a8 | |
Sergio Durigan Junior | 3638ec5fec | |
Sergio Durigan Junior | f3cfd8cd2d | |
Sergio Durigan Junior | 4f2cb1818a | |
Sergio Durigan Junior | 399e22022a | |
Miro Hrončok | ea73a43ec5 | |
Miro Hrončok | a902391148 | |
Sergio Durigan Junior | 8014ace474 | |
Sergio Durigan Junior | 732f37d3a4 | |
Sergio Durigan Junior | c9daf93497 | |
Sergio Durigan Junior | 56d681a596 | |
Sergio Durigan Junior | 9e41188f8d | |
Sergio Durigan Junior | 2bcd68d7bf | |
Sergio Durigan Junior | b7dc57f2a9 | |
Sergio Durigan Junior | f62b682777 | |
Sergio Durigan Junior | 9736ebfbb0 | |
Jan Kratochvil | 397c8a5922 | |
Jan Kratochvil | fd48d313b8 | |
Jan Kratochvil | 4262bf0e32 | |
Jan Kratochvil | 35cdcb6a32 | |
Jan Kratochvil | ad1404c938 | |
Rex Dieter | 4ec1a6344c | |
Jan Kratochvil | 3b2269511e | |
Igor Gnatenko | 828d4ecb65 | |
Igor Gnatenko | c287c646a5 | |
Fedora Release Engineering | f9b3dfe2c9 | |
Jan Kratochvil | 1919df08fd | |
Sergio Durigan Junior | 82f299dd3b | |
Jan Kratochvil | 4a848ebc38 | |
Jan Kratochvil | 188c9fbf90 | |
Sergio Durigan Junior | 57200186ba | |
Sergio Durigan Junior | 6f7202ecff | |
esakaiev@redhat.com | 3a396f9ecd | |
Sergio Durigan Junior | 21011c1e9c | |
Sergio Durigan Junior | a749f1b208 | |
Sergio Durigan Junior | c42f0297dc | |
Sergio Durigan Junior | 4632e1fa80 | |
Sergio Durigan Junior | a8767b37e5 | |
Sergio Durigan Junior | b7971c4818 | |
Sergio Durigan Junior | f637971ee3 | |
Sergio Durigan Junior | f524ac5870 | |
Jan Kratochvil | bb1c5356b1 | |
Jan Kratochvil | f408ba821f | |
Jan Kratochvil | d614670f9d | |
Jan Kratochvil | 5210cb945e | |
Troy Dawson | 1b69fa99d4 | |
Jan Kratochvil | 364e8a5927 | |
Jan Kratochvil | f318b4ab7b | |
Jan Kratochvil | d4a557a0ab | |
Jan Kratochvil | 4f1de05c3f | |
Jan Kratochvil | 99b34dc784 | |
Jan Kratochvil | 9eb42f22d5 | |
Jan Kratochvil | 3bff4d98ba | |
Fedora Release Engineering | 2d3d9675a7 | |
Fedora Release Engineering | d1308d3e8b | |
Jan Kratochvil | 4d0140dca1 | |
Jan Kratochvil | c52da2003f | |
Jan Kratochvil | 39868f2076 | |
Jan Kratochvil | 80d902f397 | |
Jan Kratochvil | 7e382f5dd2 | |
Jan Kratochvil | b5e2ceba4b | |
Fedora Release Engineering | 7c86337b97 | |
Jan Kratochvil | e6074aa8c0 | |
Jan Kratochvil | ee50e95c11 | |
Jan Kratochvil | 5bb0f3bac3 | |
Jan Kratochvil | 5e93e40f3c | |
Jan Kratochvil | 5b3c4903f6 | |
Jan Kratochvil | dbc649db15 | |
Jan Kratochvil | 0fffd6c99d | |
Jan Kratochvil | b1807ab4e1 | |
Jan Kratochvil | f9739f5031 | |
Jan Kratochvil | af2c2a5422 | |
Jan Kratochvil | 26c3bd5ab5 | |
Jan Kratochvil | 8d40388f0a | |
Jan Kratochvil | 04e185f768 | |
Jan Kratochvil | f3b44f72fc | |
Jan Kratochvil | 7a79f904cf | |
Jan Kratochvil | 082583feeb | |
Jan Kratochvil | 1d69420972 | |
Jan Kratochvil | 7a45095ecc | |
Jan Kratochvil | 194c0860de | |
Igor Gnatenko | 21eae8e63e | |
Jan Kratochvil | 35d56bae33 | |
Jan Kratochvil | 718f2d69b3 | |
Jan Kratochvil | 6022fd9542 | |
Jan Kratochvil | a06a12e15b | |
Jan Kratochvil | b6aa878929 | |
Rex Dieter | 7fedccf706 | |
Rex Dieter | 602e87ce15 | |
Rex Dieter | 714c89f6bc | |
Charalampos Stratakis | 246098eea8 | |
Charalampos Stratakis | 9bafb7c0fd | |
Jan Kratochvil | 5eb569c1b7 | |
Jan Kratochvil | b513153c46 | |
Jan Kratochvil | 43d7d2a8eb | |
Jan Kratochvil | 29d49d9491 | |
Jan Kratochvil | 2b94f0063a | |
Jan Kratochvil | d08a20f70d | |
Jan Kratochvil | 425d099f6b | |
Jan Kratochvil | 1c3e2fa7ac | |
Jan Kratochvil | 53edfc5dad | |
Jan Kratochvil | eed01b8fe7 | |
Jan Kratochvil | 25e02352ec | |
Jan Kratochvil | 4ca26b1f03 | |
Jan Kratochvil | 2f00fc1fdb | |
Jan Kratochvil | 303cd25eb9 | |
Jan Kratochvil | 60c662d53a | |
Jan Kratochvil | 235c57bc26 | |
Jan Kratochvil | d258670d64 | |
Jan Kratochvil | 35cbc92246 | |
Jan Kratochvil | 0414aeba5a | |
Jan Kratochvil | dc6b8f4f24 | |
Jan Kratochvil | 0300a2eb2d | |
Jan Kratochvil | d987921748 | |
Jan Kratochvil | 72aed9dc5e | |
Jan Kratochvil | 8cff818ba3 | |
Jan Kratochvil | a5a9adcd40 | |
Jan Kratochvil | efdba24c8f | |
Jan Kratochvil | aacdec2a04 | |
Jan Kratochvil | 92d45fce5d | |
Jan Kratochvil | b4d85c5451 | |
Jan Kratochvil | a4c8bcab20 | |
Jan Kratochvil | 1d224e61d8 | |
Jan Kratochvil | 9faadbe569 | |
Jan Kratochvil | 3f32311b4a | |
Jan Kratochvil | 5c5eb100c4 | |
Jan Kratochvil | 2e29a3ec7b | |
Jan Kratochvil | 1e35566c47 | |
Jan Kratochvil | 7306e88eb4 | |
Jan Kratochvil | fb74e3a749 | |
Jan Kratochvil | 8e7b06e27c | |
Jan Kratochvil | 6b46b9b395 | |
Jan Kratochvil | 8dde8d1082 | |
Jan Kratochvil | d6851d1cc9 | |
Jan Kratochvil | 223268c6f0 | |
Jan Kratochvil | ae97bb9470 | |
Jan Kratochvil | 7ecbbb2a16 | |
Jan Kratochvil | 2e49bd4dad | |
Jan Kratochvil | dd7d988932 | |
Jan Kratochvil | bd0820fa32 | |
Jan Kratochvil | 98045fb9ce | |
Jan Kratochvil | 76251d6102 | |
Jan Kratochvil | c0cbb1aae4 | |
Jan Kratochvil | 4dd46aad51 | |
Jan Kratochvil | 04d3aefc17 | |
Jan Kratochvil | b84e3d603f | |
Jan Kratochvil | 01264bee10 | |
Jan Kratochvil | fdbd5e346b | |
Jan Kratochvil | 09aea42a99 | |
Jan Kratochvil | 1ed22de73e | |
Jan Kratochvil | 46311ecd89 | |
Jan Kratochvil | 32b1677f0e | |
Jan Kratochvil | 22d1e60a36 | |
Jan Kratochvil | c4c35c27fd | |
Dennis Gilmore | 7759e5bf5e | |
Jan Kratochvil | 92913c305e | |
Jan Kratochvil | 2e597932c2 | |
Jan Kratochvil | 4f2557176f | |
Jan Kratochvil | 5a2431c246 | |
Jan Kratochvil | 3a8cee8e79 | |
Jan Kratochvil | c16b44507f | |
Jan Kratochvil | 6f06b1f20c | |
Jan Kratochvil | 65adaa87b1 | |
Jan Kratochvil | eca6388b15 | |
Jan Kratochvil | 5d173531c0 | |
Jan Kratochvil | ccd56ac8c9 | |
Jan Kratochvil | 13d2cd5e8a | |
Jan Kratochvil | 46cc044291 | |
Jan Kratochvil | a4961b9190 | |
Jan Kratochvil | 046f33b589 | |
Jan Kratochvil | 4800a9bd4b | |
Jan Kratochvil | 2116e53327 | |
Jan Kratochvil | c296a6a29e | |
Peter Robinson | 07b8587e82 | |
Jan Kratochvil | 41e6c203a2 | |
Jan Kratochvil | 23f398e61a | |
Jan Kratochvil | ebe9b7c7c7 | |
Jan Kratochvil | 29ca342f5e | |
Jan Kratochvil | 213eccacf2 | |
Jan Kratochvil | a2e5681941 | |
Robert Kuska | ac7f21685a | |
Robert Kuska | 99387a5556 | |
Jan Kratochvil | e32f96fe44 | |
Jan Kratochvil | 44ca5e4d1e | |
Jan Kratochvil | fe8a89ffd6 | |
Jan Kratochvil | 276edb821d | |
Jan Kratochvil | a6321db170 | |
Peter Robinson | 595c255949 | |
Jan Kratochvil | 569c63c04c | |
Sergio Durigan Junior | 1c8228902d | |
Jan Kratochvil | 2f1c4cf200 | |
Jan Kratochvil | 23a14272f3 | |
Jan Kratochvil | 7fe027b002 | |
Jan Kratochvil | 1dfcf42ec5 | |
Sergio Durigan Junior | 886d770627 | |
Sergio Durigan Junior | c779d454ec | |
Jan Kratochvil | 15c3af2823 | |
Jan Kratochvil | 1309eacac1 | |
Jan Kratochvil | e18a36d366 | |
Jan Kratochvil | ddc0fde6fd | |
Jan Kratochvil | 90127c91f8 | |
Jan Kratochvil | ae96b4a095 | |
Jan Kratochvil | d92234971d | |
Jan Kratochvil | cebf6f9af9 | |
Jan Kratochvil | 80780792f9 | |
Jan Kratochvil | a688fb8c5a | |
Jan Kratochvil | 32f92b2e34 | |
Jan Kratochvil | 19dab0f219 | |
Jan Kratochvil | d03633a0c0 | |
Jan Kratochvil | 6d1599f359 | |
Jan Kratochvil | c2620a4c45 | |
Jan Kratochvil | 186e7e4733 | |
Jan Kratochvil | e209b86292 | |
Till Maas | 6c08fa48ef | |
Jan Kratochvil | 61676c0354 | |
Jan Kratochvil | 7cbf529231 | |
Jan Kratochvil | 21fb199a6f | |
Jan Kratochvil | 5d84d7a16a | |
Jan Kratochvil | b6bc0d5376 | |
Jan Kratochvil | 072837144c | |
Jan Kratochvil | 2f7f533ae7 | |
Jan Kratochvil | 1445be5574 | |
Jan Kratochvil | b132e8a8fd | |
Jan Kratochvil | a438e05d6f | |
Jan Kratochvil | a79edc166a | |
Sergio Durigan Junior | 4fb72aaac3 | |
Sergio Durigan Junior | ae793cbabe | |
Jan Kratochvil | 43b0bce1db | |
Jan Kratochvil | 8095c33951 | |
Jan Kratochvil | 862e0ed47f | |
Jan Kratochvil | 3cf9dd58a7 | |
Jan Kratochvil | 8a983520e3 | |
Sergio Durigan Junior | e3bcba8731 | |
Jan Kratochvil | 58638f8971 | |
Sergio Durigan Junior | 77c099e703 | |
Jan Kratochvil | 3887bdb15a | |
Jan Kratochvil | 448d46bddf | |
Jan Kratochvil | 263b58000d | |
Peter Robinson | d3f8b94c47 | |
Jan Kratochvil | 5175ae097f | |
Jan Kratochvil | 0d2fda651f | |
Jan Kratochvil | 533da91091 | |
Jan Kratochvil | 191ccfbccd | |
Jan Kratochvil | 902c8e5abc | |
Jan Kratochvil | c1c430cb5f | |
Jan Kratochvil | a972d47b4c | |
Jan Kratochvil | 33d54d9950 | |
Jan Kratochvil | 4f54fc4526 | |
Jan Kratochvil | cec9297712 | |
Jan Kratochvil | b73009e1d2 | |
Jan Kratochvil | 2a0fd8ad84 | |
Jan Kratochvil | de9f421a3c | |
Jan Kratochvil | dd2c5ed0e6 | |
Jan Kratochvil | 2b55d27fdb | |
Jan Kratochvil | 11195233b5 | |
Jan Kratochvil | b3b50862b2 | |
Jan Kratochvil | eb6cb2db36 | |
Dennis Gilmore | 730f2712ef | |
Jan Kratochvil | b472cbae9c | |
Jan Kratochvil | fbd3253d15 | |
Jan Kratochvil | 7082135fc2 | |
Jan Kratochvil | 4eee7557d1 | |
Jan Kratochvil | c70b5a54fd | |
Jan Kratochvil | 7ae270c46d | |
Jan Kratochvil | 68e26e6ce3 | |
Jan Kratochvil | 9b1a6425a1 | |
Jan Kratochvil | 1ecbbdb62a | |
Jan Kratochvil | 6e0665a33c | |
Jan Kratochvil | 936befa814 | |
Sergio Durigan Junior | 0a42762f26 | |
Jan Kratochvil | 699758c055 | |
Jan Kratochvil | 7f2a1f7d83 | |
Jan Kratochvil | 331a1f1adc | |
Sergio Durigan Junior | da639865c1 | |
Sergio Durigan Junior | fceb2c10d4 | |
Jan Kratochvil | 3e564422d3 | |
Jan Kratochvil | 3af2cc602d | |
Jan Kratochvil | e86a0cc13a | |
Jan Kratochvil | 2c55a5441d | |
Jan Kratochvil | ff3b0d487c | |
Jan Kratochvil | 1be7752b2c | |
Jan Kratochvil | 0f5a62e3a0 | |
Jan Kratochvil | 6ca3c187db | |
Jan Kratochvil | 2d6d1b2f58 | |
Jan Kratochvil | 1d5872dcff | |
Jan Kratochvil | fe74423b08 | |
Jan Kratochvil | 25caf289cd | |
Sergio Durigan Junior | de8f297ee0 | |
Jan Kratochvil | 39657054d5 | |
Jan Kratochvil | a717e23abf | |
Jan Kratochvil | bdf0f25112 | |
Jan Kratochvil | a97ee30c3d | |
Jan Kratochvil | 5a0302a66d | |
Jan Kratochvil | 2ed9630f59 | |
Jan Kratochvil | ad6c9a2ec1 | |
Jan Kratochvil | 7ffdf589d4 | |
Jan Kratochvil | 77f735272d | |
Jan Kratochvil | b6e7beb35c | |
Jan Kratochvil | 872aab074e | |
Jan Kratochvil | 2f9bb15290 | |
Jan Kratochvil | 9be0c23ca4 | |
Jan Kratochvil | 44de066dfd | |
Jan Kratochvil | 752ff760ca | |
Jan Kratochvil | 19d4458238 | |
Jan Kratochvil | a5cf0a66f1 | |
Jan Kratochvil | 89fbbfccaf | |
Jan Kratochvil | 6d620330a4 | |
Jan Kratochvil | 5c14ffc194 | |
Jan Kratochvil | 01f32662b6 | |
Jan Kratochvil | a3d12927af | |
Jan Kratochvil | 3344b6ba48 | |
Jan Kratochvil | 46f79e2112 | |
Jan Kratochvil | f8a4995541 | |
Jan Kratochvil | c3b2d52489 | |
Jan Kratochvil | d6a3040467 | |
Jan Kratochvil | 05b22fe0aa | |
Sergio Durigan Junior | 9dd2140456 | |
Jan Kratochvil | cf0b61abc0 | |
Jan Kratochvil | 9b8aeef05e | |
Jan Kratochvil | ac3dde5b9b | |
Jan Kratochvil | 402506cde5 | |
Jan Kratochvil | 43e595b798 | |
Jan Kratochvil | b7ec76456e | |
Jan Kratochvil | f2d6b407bf | |
Jan Kratochvil | f1490f0b05 | |
Jan Kratochvil | 1054fa6d0b | |
Jan Kratochvil | 350d5a31c9 | |
Jan Kratochvil | dd75969f7b | |
Jan Kratochvil | ab333d9938 | |
Jan Kratochvil | 99cd04126a | |
Jan Kratochvil | fd14833eee | |
Jan Kratochvil | f7d32d5142 | |
Jan Kratochvil | 88bebb3fb1 | |
Jan Kratochvil | ebaa23aa6c | |
Jan Kratochvil | 5677fb2373 | |
Jan Kratochvil | 556378e101 | |
Jan Kratochvil | ab816baf60 | |
Jan Kratochvil | f92430a872 | |
Jan Kratochvil | 5f3b63a0d4 | |
Jan Kratochvil | ed2617e547 | |
Jan Kratochvil | 4bb744e410 | |
Jan Kratochvil | 707343965f | |
Jan Kratochvil | e5ad958b76 | |
Jan Kratochvil | 26b4790954 | |
Jan Kratochvil | 54956de3d3 | |
Jan Kratochvil | 92b52c5e6f | |
Jan Kratochvil | 75aac11369 | |
Jan Kratochvil | 979799fd0b | |
Jan Kratochvil | 60a99dfbcf | |
Jan Kratochvil | a7d7affa1c | |
Jan Kratochvil | fb02fc3940 | |
Jan Kratochvil | 29e1388476 | |
Jan Kratochvil | 30f2069f6e | |
Jan Kratochvil | 87ed9489e3 | |
Jan Kratochvil | 4945b2263d | |
Dennis Gilmore | 914739c6e2 | |
Jan Kratochvil | 536bc96db1 | |
Jan Kratochvil | 8aabf36e77 | |
Jan Kratochvil | 642e08f465 | |
Jan Kratochvil | a4cfcd84af | |
Jan Kratochvil | e7f1c832a7 | |
Jan Kratochvil | 5387893eab | |
Jan Kratochvil | c501c4bdb1 | |
Jan Kratochvil | 11eae30806 | |
Sergio Durigan Junior | a9b4b48ee3 | |
Sergio Durigan Junior | 31a43c2209 | |
Jan Kratochvil | a930df3ffb | |
Sergio Durigan Junior | 2b568b7d72 | |
Jan Kratochvil | 31e8955039 | |
Jan Kratochvil | c382081360 | |
Jan Kratochvil | 500c813e17 | |
Jan Kratochvil | f8eee05550 | |
Jan Kratochvil | 0c6cb6731e | |
Jan Kratochvil | 3071876327 | |
Jan Kratochvil | d1151d6581 | |
Jan Kratochvil | 43d8d62a03 | |
Jan Kratochvil | de3a592768 | |
Jan Kratochvil | 72cb82c2bf | |
Jan Kratochvil | fdf21a3584 | |
Jan Kratochvil | bd04ff0041 | |
Jan Kratochvil | 08451779f9 | |
Jan Kratochvil | f289ba9c21 | |
Jan Kratochvil | fbf39fd05f | |
Jan Kratochvil | 78a785d4c5 | |
Jan Kratochvil | e26cb4d20f | |
Jan Kratochvil | ea0fcb4584 | |
Jan Kratochvil | 572702753c | |
Jan Kratochvil | 9d32f32f26 | |
Jan Kratochvil | 3d3c8f2d4a | |
Jan Kratochvil | 380b734913 | |
Jan Kratochvil | 01b1870f18 | |
Jan Kratochvil | d8e4a58344 | |
Jan Kratochvil | c64e73263b | |
Jan Kratochvil | 46d8530cd6 | |
Jan Kratochvil | 9fd125663d | |
Jan Kratochvil | 1c8cc3b9e6 | |
Jan Kratochvil | fb7506558d | |
Jan Kratochvil | e05ce76998 | |
Jan Kratochvil | 9e9d7b2bbb | |
Jan Kratochvil | 9ce5c44987 | |
Jan Kratochvil | 55c3b84dd7 | |
Jan Kratochvil | 3a4ee84176 | |
Jan Kratochvil | e81f470147 | |
Jan Kratochvil | 67644b518c | |
Jan Kratochvil | 5c4cedb759 | |
Jan Kratochvil | 750e47124c | |
Jan Kratochvil | 84ef6008bd | |
Jan Kratochvil | 62c93b3435 | |
Jan Kratochvil | 3000de323b | |
Jan Kratochvil | a50d5b63a7 | |
Jan Kratochvil | c5c713f196 | |
Jan Kratochvil | cc92f09aa1 | |
Jan Kratochvil | a5cb59e730 | |
Jan Kratochvil | ec26424839 | |
Jan Kratochvil | 2d09ea90fb | |
Jan Kratochvil | 7cb24ade9a | |
Jan Kratochvil | 2f2930eb78 | |
Jan Kratochvil | e6cdbfd018 | |
Jan Kratochvil | 191f4d2883 | |
Jan Kratochvil | 254f0e90bc | |
Jan Kratochvil | 4862a154d1 | |
Sergio Durigan Junior | e349329c80 | |
Jan Kratochvil | 52bb570800 | |
Jan Kratochvil | 7218d159e3 | |
Jan Kratochvil | 7649e489fb | |
Jan Kratochvil | c6934442a9 | |
Jan Kratochvil | 922e4a0796 | |
Jan Kratochvil | b9aa4c4c7b | |
Jan Kratochvil | ebad377b2d | |
Jan Kratochvil | 9a9da3171c | |
Jan Kratochvil | eceaa13e09 | |
Jan Kratochvil | 3b55f7833b | |
Jan Kratochvil | e6e9cf3987 | |
Jan Kratochvil | 847a670287 | |
Jan Kratochvil | c8a4544144 | |
Jan Kratochvil | 4adfc8b85c | |
Jan Kratochvil | 7180591ac5 | |
Jan Kratochvil | f314eb3eb5 | |
Jan Kratochvil | 09dd7775eb | |
Fabio M. Di Nitto | 1cd4f3809f | |
Jan Kratochvil | 98c0c7adab | |
Jan Kratochvil | 46a1caf62e | |
Jan Kratochvil | 5752ad02c2 | |
Jan Kratochvil | 48cf710500 | |
Jan Kratochvil | d5159132e2 | |
Jan Kratochvil | 9aa6e1de63 | |
Jan Kratochvil | 833b1257d3 | |
Jan Kratochvil | 14982af20a | |
Jan Kratochvil | 3080c0e54f | |
Jan Kratochvil | 6b44006b8d | |
Jan Kratochvil | 4d79cf2e34 | |
Jan Kratochvil | 6f7687c33f | |
Jan Kratochvil | af2402c03d | |
Dennis Gilmore | 9f971d482a | |
Jan Kratochvil | e266c66da6 | |
Jan Kratochvil | cb641a7fa4 | |
Jan Kratochvil | c00fd45a3e | |
Jan Kratochvil | 16c47e7f0c | |
Jan Kratochvil | ea07d44ec2 | |
Jan Kratochvil | 8973456f5a | |
Jan Kratochvil | f4677c421e | |
Jan Kratochvil | 6b3e65b584 | |
Jan Kratochvil | b0e03f562d | |
Jan Kratochvil | a174f683ec | |
Jan Kratochvil | 0bba59c99f | |
Jan Kratochvil | 33ff7091ac | |
Jan Kratochvil | 278e869a86 | |
Jan Kratochvil | 0b11bd2616 | |
Jan Kratochvil | 6fa2f55b27 | |
Jan Kratochvil | a56307ebf7 | |
Jan Kratochvil | b0a94c2ea0 | |
Jan Kratochvil | ef59bb9bcc | |
Jan Kratochvil | ac0fd38455 | |
Jan Kratochvil | 41aeaf682d | |
Jan Kratochvil | 4546826203 | |
Jan Kratochvil | 1d7d503e7e | |
Jan Kratochvil | 1d459d3886 | |
Jan Kratochvil | 458c182c85 | |
Jan Kratochvil | 8b8af94462 | |
Jan Kratochvil | 336050181d | |
Jan Kratochvil | c804fb8a8f | |
Jan Kratochvil | 58ea63ab49 | |
Jan Kratochvil | 60add66ae4 | |
Jan Kratochvil | e00e5eae57 | |
Jan Kratochvil | 1bcf9b6604 | |
Fedora Release Engineering | 5abe5add8a | |
Mamoru Tasaka | 924e99b419 | |
Jan Kratochvil | 44969d3e6c | |
Jan Kratochvil | 20f9f675af | |
dmalcolm | 4d3bc055ec | |
Jan Kratochvil | f13fc54bce | |
Jan Kratochvil | dd46ae6cd0 | |
Jan Kratochvil | 1c901a1d76 | |
Jan Kratochvil | bc0aadfac7 | |
Jan Kratochvil | ee681d3b2f | |
Jan Kratochvil | c874340ae4 | |
Jan Kratochvil | 3b3433b0b0 | |
Jan Kratochvil | aee5861550 | |
Jan Kratochvil | 8b7a3e1875 | |
Jan Kratochvil | a04bc95fa3 | |
Jan Kratochvil | 45f79714b9 | |
Jan Kratochvil | b469073e48 | |
Jan Kratochvil | 7abf5f4318 | |
Jan Kratochvil | 755bb6f90b | |
Jan Kratochvil | 9291de59d7 | |
Jan Kratochvil | e9671f2471 | |
Jan Kratochvil | c5a9fdc6a7 | |
Jan Kratochvil | 39d52ac1d6 | |
Jan Kratochvil | 5542e358c5 | |
Jan Kratochvil | 79563d6f81 | |
Jan Kratochvil | a7d6efc17b | |
Jan Kratochvil | 626a9059b8 | |
Jan Kratochvil | 8c4c91efd9 | |
Jan Kratochvil | 0911f375d9 | |
Bill Nottingham | bef45217a0 | |
Jan Kratochvil | ab901d8ee8 | |
Jan Kratochvil | 40f8d2fd9b | |
Jan Kratochvil | 580e05685a | |
Jan Kratochvil | 4d3aa56117 | |
Jan Kratochvil | a8e7ccc4fd | |
Jan Kratochvil | 8ae3364a4f | |
Jan Kratochvil | e93d3474d8 | |
Jan Kratochvil | 806f8c893c | |
Jan Kratochvil | 2164cdaf2a | |
Jan Kratochvil | 594e04b937 | |
Jan Kratochvil | 8bf73e0a01 | |
Jan Kratochvil | ab83f240e4 | |
Jan Kratochvil | 0435006f87 | |
Jan Kratochvil | 6370c17fdf | |
Jan Kratochvil | f340c03820 | |
Jan Kratochvil | a97b573f83 | |
Jan Kratochvil | 2280d5542d | |
Jan Kratochvil | 833a63eb37 | |
Jan Kratochvil | 99fa6c959f | |
Jan Kratochvil | 912c39689b | |
Jan Kratochvil | 273e7e98b2 | |
Jan Kratochvil | 657c7f1700 | |
Jan Kratochvil | e5611bfae3 | |
Jan Kratochvil | 6ca358b064 | |
Jan Kratochvil | 620a59a5c4 | |
Jesse Keating | d73adb8cd5 | |
Jan Kratochvil | 364647c376 | |
Jan Kratochvil | 3b9bc6fe50 | |
Jan Kratochvil | a0312d1afc | |
Jan Kratochvil | b92be7d39b | |
Jan Kratochvil | 6f1140096d | |
Jan Kratochvil | 536aae5e6a | |
Jan Kratochvil | f51c5abf98 | |
Jan Kratochvil | bcdbb34cad | |
Jan Kratochvil | c030186760 | |
Jan Kratochvil | 638b7b7c33 | |
Jan Kratochvil | 859e1355cf | |
Jan Kratochvil | 6fcb74ef6e | |
Jan Kratochvil | f4df2f361a | |
Jan Kratochvil | 8876ac66af | |
Jan Kratochvil | b39dc5cfa9 | |
Jan Kratochvil | 94cd124608 | |
Jan Kratochvil | dc95c8ce1c | |
Jan Kratochvil | 360c47d6af | |
Jan Kratochvil | 06e575d259 | |
Jan Kratochvil | 373e1bc565 | |
Jan Kratochvil | 5db4c14168 | |
Jan Kratochvil | 8aaf99f932 | |
Jan Kratochvil | 906a06fdb4 | |
Jan Kratochvil | 88c9a17a81 | |
Dennis Gilmore | 5b24c1447a | |
Jan Kratochvil | 6110293bb9 | |
Jan Kratochvil | b5f2aa80ed | |
Jan Kratochvil | 4fe9415174 | |
Jan Kratochvil | 3ce5394498 | |
Jan Kratochvil | d5fb1cc724 | |
Jan Kratochvil | 42988d9875 | |
Jan Kratochvil | 5b5fe7db1b | |
Jan Kratochvil | 5e5008a2ef | |
Jan Kratochvil | 1a30f6fafe | |
Jan Kratochvil | 984eecf70c | |
Jan Kratochvil | eb11e3c0e6 | |
Jan Kratochvil | 09c22fd5fb | |
Jan Kratochvil | 8dadf56185 | |
Jesse Keating | 0d29c1b6dd | |
Jan Kratochvil | 36474ab6e8 | |
Jan Kratochvil | 159237942c | |
Jesse Keating | e241ec0a7b | |
Jan Kratochvil | a1707b2aa7 | |
Jan Kratochvil | 81783d0ff2 | |
Jan Kratochvil | ec0fcb652c | |
Jan Kratochvil | c1c2c92c21 | |
Jan Kratochvil | f6cec01799 | |
Jan Kratochvil | d8167bba62 | |
Jan Kratochvil | be8869e59a | |
Jan Kratochvil | 23cdd3f2da | |
Jan Kratochvil | 407ebe9063 | |
Jan Kratochvil | 39347a6c8a | |
Štěpán Kasal | 9b2688b72a | |
Jan Kratochvil | 3dc772c212 | |
Jan Kratochvil | 84892dcf86 | |
Jan Kratochvil | 917bed595e | |
Jan Kratochvil | 3883e15b9c | |
Jan Kratochvil | bdd0d9f59a | |
Jan Kratochvil | 74f680bfbd | |
Jan Kratochvil | bb9a89cb8a | |
Jan Kratochvil | 3e31985da5 | |
Jan Kratochvil | e168686c08 | |
Jan Kratochvil | 5c94ba08ee | |
Jan Kratochvil | fdeb421774 | |
Jan Kratochvil | 10f824b955 | |
Jan Kratochvil | e3c8b47c74 | |
Jan Kratochvil | 4f698ded6f | |
Jan Kratochvil | bc809fee48 | |
Jan Kratochvil | 4bbd3a23f8 | |
Jan Kratochvil | 3a094fb8da | |
Jan Kratochvil | 8b1b3fd689 | |
Jan Kratochvil | 3f491b2d88 | |
Jan Kratochvil | 535451a6ad | |
Jan Kratochvil | 5ca2edcb43 | |
Jan Kratochvil | 942cd23f69 | |
Jan Kratochvil | 666c0bad8d | |
Jan Kratochvil | dd1aa7b0b3 | |
Jan Kratochvil | 2234aa8fd6 | |
Jan Kratochvil | ad4fdd5fb5 | |
Tom Callaway | e237432bca | |
Jan Kratochvil | a8518f3891 | |
Tom Callaway | dccf7f213b | |
Jan Kratochvil | 4824eeeeb5 | |
Jan Kratochvil | 1f8808d842 | |
Jan Kratochvil | 70c7344648 | |
Jan Kratochvil | 17a4f25e9f | |
Jan Kratochvil | c499105421 | |
Jan Kratochvil | 7db944e3bd | |
Jan Kratochvil | 5f5d7d94b5 | |
Jan Kratochvil | a9e8793603 | |
Jan Kratochvil | e923707749 | |
Jan Kratochvil | ed268f2814 | |
Jan Kratochvil | 4ebfb44ea4 | |
Jan Kratochvil | 7d92950e83 | |
Jan Kratochvil | 338fe930a1 | |
Jan Kratochvil | 5bed39139d | |
Jan Kratochvil | 25ff8a1663 | |
Jan Kratochvil | 2da8118ede | |
Jan Kratochvil | 082b63b1ab | |
Jan Kratochvil | b3e4c8b04e | |
Jan Kratochvil | 917a6fb9db | |
Jan Kratochvil | 08593f1932 | |
Jan Kratochvil | 4d1104a1ae | |
Jan Kratochvil | 6a80c39af8 | |
Jan Kratochvil | 2a6507443a | |
Jan Kratochvil | d945816097 | |
Jan Kratochvil | 3f52bbd141 | |
Jan Kratochvil | d50521fae0 | |
Jan Kratochvil | 4a930500c1 | |
Jan Kratochvil | cd60710ea7 | |
Jan Kratochvil | 92dc0e1867 | |
Jan Kratochvil | b0ab3a801f | |
Jan Kratochvil | 27c2469e2f | |
Jan Kratochvil | 50dab454bd | |
Jan Kratochvil | eb9d945afa | |
Jan Kratochvil | cc171577b7 | |
Bill Nottingham | e42a86f6e6 | |
Jan Kratochvil | 9a1b9888ac | |
Jan Kratochvil | bd518c30d9 | |
Jan Kratochvil | 84f82bf43b | |
Jan Kratochvil | 7969725ab1 | |
Jan Kratochvil | cafa2ff0c1 | |
Jan Kratochvil | ddc50f97e3 | |
Jan Kratochvil | 435483c64b | |
Jan Kratochvil | dd40115f74 | |
Jan Kratochvil | add1a2d48d | |
Jan Kratochvil | 41705867ad | |
Jan Kratochvil | 4e2e7886e3 | |
Jan Kratochvil | 864733e518 | |
Jan Kratochvil | daafa059ee | |
Jan Kratochvil | 7a31f8b0c5 | |
Jesse Keating | 6614f13981 | |
Jan Kratochvil | 2d6435754d | |
Jan Kratochvil | 5c49e68313 | |
Jan Kratochvil | a0b6775162 | |
Jan Kratochvil | c78c51c0de | |
Jan Kratochvil | 5a72cdabf8 | |
Jan Kratochvil | 4e636f8028 | |
Jan Kratochvil | aad703f07a | |
Štěpán Kasal | 8c68955da2 | |
Jan Kratochvil | f0d366b68d | |
Jan Kratochvil | acb618c727 | |
Jan Kratochvil | 1499556e03 | |
Jan Kratochvil | a32d62ae37 | |
Jan Kratochvil | 8336d588bf | |
Jan Kratochvil | 4b94240967 | |
Jan Kratochvil | b2d009af0c | |
Jan Kratochvil | b972eafb70 | |
Jan Kratochvil | 9a64326ab3 | |
Jan Kratochvil | 24da262922 | |
Jan Kratochvil | 8955b7e320 | |
Jan Kratochvil | eaba00d1b0 | |
Jan Kratochvil | e157c1b26f | |
Jan Kratochvil | 9548cfeea8 | |
Jan Kratochvil | 2a21fb50ae | |
Jan Kratochvil | dfe7fd4669 | |
Jan Kratochvil | aefb0e1e23 | |
Jan Kratochvil | 376c4280d4 | |
Jan Kratochvil | 4dddad4251 | |
Jan Kratochvil | 48f079c103 | |
Jan Kratochvil | 3cdd4d2bbe | |
Jan Kratochvil | 65bc5f9692 | |
Jan Kratochvil | 8ad010c73b | |
Jan Kratochvil | b76482a34c | |
Jan Kratochvil | 803b8bdf52 | |
Jan Kratochvil | 6586341d1d | |
Jan Kratochvil | 418be7985a | |
Jan Kratochvil | b9610957d2 | |
Jan Kratochvil | 9dc4b31d3d | |
Jan Kratochvil | 2a22042c8a | |
Jan Kratochvil | ba921cd95b | |
Jan Kratochvil | 67e6bd43b5 | |
Jan Kratochvil | 509b0ab1f9 | |
Jan Kratochvil | 03e2cd36ed | |
Jan Kratochvil | dd1d9ea7c4 | |
Jan Kratochvil | b048379f11 | |
Jan Kratochvil | 5b4413efb9 | |
Jan Kratochvil | 09585624a5 | |
Jan Kratochvil | 50a6238835 | |
Jan Kratochvil | 7e80c93779 | |
Jan Kratochvil | ba67a7996c | |
Jan Kratochvil | 2c3eddc55e | |
Jan Kratochvil | fa9ba05eb9 | |
Jan Kratochvil | b6646b39a2 | |
aoliva | c3984c8e90 | |
aoliva | e6628c4a6c | |
aoliva | a23697f5db | |
aoliva | 9920fee39f | |
aoliva | 9bd4e90e66 | |
aoliva | 753f5e6d3e | |
aoliva | b13204b595 |
|
@ -1 +0,0 @@
|
|||
gdb-6.5.tar.bz2
|
|
@ -0,0 +1,4 @@
|
|||
/binutils-gdb
|
||||
/gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz
|
||||
/v2.0.2.tar.gz
|
||||
/gdb-10.1.tar.xz
|
6
Makefile
6
Makefile
|
@ -1,6 +0,0 @@
|
|||
# Makefile for source rpm: gdb
|
||||
# $Id$
|
||||
NAME := gdb
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
include ../common/Makefile.common
|
|
@ -0,0 +1,104 @@
|
|||
# Fedora GDB local patches policy
|
||||
|
||||
In order to make things easier for the Fedora GDB maintainer, we
|
||||
choose to auto-generate the local patches by making use of an upstream
|
||||
git repository. Below you can find a few instructions on how to work
|
||||
using this method.
|
||||
|
||||
You need to run the following commands from the directory that
|
||||
contains the "gdb.spec" file.
|
||||
|
||||
## Importing the GDB patches into a git repository
|
||||
|
||||
1) The local patches (`*.patch`) need to be imported into an upstream
|
||||
git repository. For example, let's assume you cloned the repository
|
||||
by doing:
|
||||
|
||||
`$ git clone git://sourceware.org/git/binutils-gdb.git`
|
||||
|
||||
> TIP: if you already have the repository cloned somewhere in your
|
||||
> system, you can pass a "--reference <dir>" to the "git clone"
|
||||
> command and it will use your local repository as much as possible
|
||||
> to make the clone, speeding up things.
|
||||
|
||||
2) After cloning the upstream repository, you can import your patches
|
||||
by using the script "generate-git-repo-from-patches.sh":
|
||||
|
||||
`$ sh generate-git-repo-from-patches.sh <REPOSITORY_DIR>`
|
||||
|
||||
The script will basically cd into the repository, checkout the
|
||||
revision specified in the file `_git_upstream_commit`, iterate through
|
||||
the file `_patch_order` and "git-am" every patch *in that order*.
|
||||
This operation should complete without errors; if you find a problem
|
||||
with `git-am`, it probably means that the revision specified in the
|
||||
file `_git_upstream_commit` is wrong.
|
||||
|
||||
## Rebasing the patches against a newer version/release
|
||||
|
||||
1) First, cd into the upstream repository. All you have to do is
|
||||
choose the revision against which you plan to rebase the patches, and
|
||||
`git rebase <REVISION>`. git will do the rest, and you will be able
|
||||
to perform conflict resolution by git's algorithm, which is smarter.
|
||||
|
||||
## Creating new patches
|
||||
|
||||
1) Create the new patch on top of the the others, as usual. Note that
|
||||
you can use `git rebase` whenever you want to reorder patch order, or
|
||||
even to delete a patch.
|
||||
|
||||
2) When writing the commit log, you must obey a few rules. The
|
||||
subject line *must* be the filename of the patch. This line will be
|
||||
used when exporting the patches from the git repository, and
|
||||
(obviously) it gives the filename that should be used for this
|
||||
specific patch.
|
||||
|
||||
3) You can also add comments that will go into the auto-generated
|
||||
`Patch:` file (see below). To do that, use the special marker `;;` at
|
||||
the beginning of the line. This way, a commit log that says:
|
||||
|
||||
~~~~~~~~~~~
|
||||
test-patch.patch
|
||||
|
||||
;; This is a test patch
|
||||
;; Second line
|
||||
~~~~~~~~~~~
|
||||
|
||||
Will generate the following entry in the auto-generated `Patch:` file:
|
||||
|
||||
~~~~~~~~~~~
|
||||
# This is a test patch
|
||||
# Second line
|
||||
PatchXYZ: test-patch.patch
|
||||
~~~~~~~~~~~
|
||||
|
||||
## Exporting the GDB patches from the git repository
|
||||
|
||||
1) When you're done working with the patches, go back to the directory
|
||||
that contains the `gdb.spec` file, and from there you run:
|
||||
|
||||
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR>`
|
||||
|
||||
This will regenerate all of the `*.patch` files (excluding the ones that
|
||||
were also excluded from the git repository), and also regenerate a few
|
||||
control files. These control files are:
|
||||
|
||||
- `_gdb.spec.Patch.include`: This file contains the `Patch:` directives.
|
||||
|
||||
- `_gdb.spec.patch.include`: This file contains the `%patch` directives.
|
||||
|
||||
- `_patch_order`: This file contains the patches, in the exact order
|
||||
that they must be applied. It is used when importing the patches
|
||||
into the git repository.
|
||||
|
||||
- `_git_upstream_commit`: This file contains the last upstream commit
|
||||
against which the patches were rebased. It is used when importing
|
||||
the patches into the git repository.
|
||||
|
||||
NOTE: If you did a rebase against a newer upstream version, you need
|
||||
to specify the commit/tag/branch against which you rebased:
|
||||
|
||||
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR> <COMMIT_OR_TAG_OR_BRANCH>`
|
||||
|
||||
For example, if you rebased against `gdb-8.1-release`:
|
||||
|
||||
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR> gdb-8.1-release`
|
|
@ -0,0 +1,384 @@
|
|||
# Match the Fedora's version info.
|
||||
#=fedora
|
||||
Patch001: gdb-6.3-rh-testversion-20041202.patch
|
||||
|
||||
# VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests.
|
||||
#=push
|
||||
Patch002: gdb-vla-intel-fortran-strides.patch
|
||||
|
||||
#=push
|
||||
Patch003: gdb-vla-intel-fortran-vla-strings.patch
|
||||
|
||||
#=push+jan
|
||||
Patch004: gdb-vla-intel-stringbt-fix.patch
|
||||
|
||||
# Add a wrapper script to GDB that implements pstack using the
|
||||
# --readnever option.
|
||||
#=push
|
||||
Patch005: gdb-6.3-gstack-20050411.patch
|
||||
|
||||
# VSYSCALL and PIE
|
||||
#=fedoratest
|
||||
Patch006: gdb-6.3-test-pie-20050107.patch
|
||||
|
||||
# Get selftest working with sep-debug-info
|
||||
#=fedoratest
|
||||
Patch007: gdb-6.3-test-self-20050110.patch
|
||||
|
||||
# Test support of multiple destructors just like multiple constructors
|
||||
#=fedoratest
|
||||
Patch008: gdb-6.3-test-dtorfix-20050121.patch
|
||||
|
||||
# Fix to support executable moving
|
||||
#=fedoratest
|
||||
Patch009: gdb-6.3-test-movedir-20050125.patch
|
||||
|
||||
# Test sibling threads to set threaded watchpoints for x86 and x86-64
|
||||
#=fedoratest
|
||||
Patch010: gdb-6.3-threaded-watchpoints2-20050225.patch
|
||||
|
||||
# Verify printing of inherited members test
|
||||
#=fedoratest
|
||||
Patch012: gdb-6.3-inheritancetest-20050726.patch
|
||||
|
||||
# Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
|
||||
#=push+jan: It should be replaced by Infinity project.
|
||||
Patch013: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
|
||||
# Fix TLS symbols resolving for shared libraries with a relative pathname.
|
||||
# The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
|
||||
#=fedoratest: One should recheck if it is really fixed upstream.
|
||||
Patch014: gdb-6.5-sharedlibrary-path.patch
|
||||
|
||||
# Improved testsuite results by the testsuite provided by the courtesy of BEA.
|
||||
#=fedoratest: For upstream it should be rewritten as a dejagnu test, the test of no "??" was useful.
|
||||
Patch015: gdb-6.5-BEA-testsuite.patch
|
||||
|
||||
# Testcase for deadlocking on last address space byte; for corrupted backtraces.
|
||||
#=fedoratest
|
||||
Patch016: gdb-6.5-last-address-space-byte-test.patch
|
||||
|
||||
# Fix readline segfault on excessively long hand-typed lines.
|
||||
#=fedoratest
|
||||
Patch017: gdb-6.5-readline-long-line-crash-test.patch
|
||||
|
||||
# Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
|
||||
#=fedoratest
|
||||
Patch018: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
|
||||
# Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
|
||||
#=fedora
|
||||
Patch019: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
|
||||
|
||||
# Find symbols properly at their original (included) file (BZ 109921).
|
||||
#=fedoratest
|
||||
Patch020: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
|
||||
|
||||
# Update PPC unwinding patches to their upstream variants (BZ 140532).
|
||||
#=fedoratest
|
||||
Patch021: gdb-6.3-bz140532-ppc-unwinding-test.patch
|
||||
|
||||
# Testcase for exec() from threaded program (BZ 202689).
|
||||
#=fedoratest
|
||||
Patch022: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
||||
|
||||
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
|
||||
#=fedoratest
|
||||
Patch023: gdb-6.6-bz230000-power6-disassembly-test.patch
|
||||
|
||||
# Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
|
||||
#=fedoratest
|
||||
Patch024: gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
|
||||
# Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
|
||||
#=fedoratest
|
||||
Patch025: gdb-6.6-testsuite-timeouts.patch
|
||||
|
||||
# Support for stepping over PPC atomic instruction sequences (BZ 237572).
|
||||
#=fedoratest
|
||||
Patch026: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
|
||||
# Test leftover zombie process (BZ 243845).
|
||||
#=fedoratest
|
||||
Patch028: gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
|
||||
# New locating of the matching binaries from the pure core file (build-id).
|
||||
#=push+jan
|
||||
Patch029: gdb-6.6-buildid-locate.patch
|
||||
|
||||
# Fix loading of core files without build-ids but with build-ids in executables.
|
||||
# Load strictly build-id-checked core files only if no executable is specified
|
||||
# (Jan Kratochvil, RH BZ 1339862).
|
||||
#=push+jan
|
||||
Patch030: gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
|
||||
#=push+jan
|
||||
Patch031: gdb-6.6-buildid-locate-rpm.patch
|
||||
|
||||
# Fix displaying of numeric char arrays as strings (BZ 224128).
|
||||
#=fedoratest: But it is failing anyway, one should check the behavior more.
|
||||
Patch032: gdb-6.7-charsign-test.patch
|
||||
|
||||
# Test PPC hiding of call-volatile parameter register.
|
||||
#=fedoratest
|
||||
Patch033: gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
|
||||
# Testsuite fixes for more stable/comparable results.
|
||||
#=fedoratest
|
||||
Patch034: gdb-6.7-testsuite-stable-results.patch
|
||||
|
||||
# Test ia64 memory leaks of the code using libunwind.
|
||||
#=fedoratest
|
||||
Patch035: gdb-6.5-ia64-libunwind-leak-test.patch
|
||||
|
||||
# Test hiding unexpected breakpoints on intentional step commands.
|
||||
#=fedoratest
|
||||
Patch036: gdb-6.5-missed-trap-on-step-test.patch
|
||||
|
||||
# Test GCORE for shmid 0 shared memory mappings.
|
||||
#=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible.
|
||||
Patch038: gdb-6.3-mapping-zero-inode-test.patch
|
||||
|
||||
# Test a crash on `focus cmd', `focus prev' commands.
|
||||
#=fedoratest
|
||||
Patch039: gdb-6.3-focus-cmd-prev-test.patch
|
||||
|
||||
# Test various forms of threads tracking across exec() (BZ 442765).
|
||||
#=fedoratest
|
||||
Patch040: gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
|
||||
# Test a crash on libraries missing the .text section.
|
||||
#=fedoratest
|
||||
Patch041: gdb-6.5-section-num-fixup-test.patch
|
||||
|
||||
# Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
|
||||
#=fedoratest
|
||||
Patch042: gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
|
||||
# New test for step-resume breakpoint placed in multiple threads at once.
|
||||
#=fedoratest
|
||||
Patch043: gdb-simultaneous-step-resume-breakpoint-test.patch
|
||||
|
||||
# Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
||||
# Fix regression of undisplayed missing shared libraries caused by a fix for.
|
||||
#=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*>
|
||||
Patch044: gdb-core-open-vdso-warning.patch
|
||||
|
||||
# Fix stepping with OMP parallel Fortran sections (BZ 533176).
|
||||
#=push+jan: It requires some better DWARF annotations.
|
||||
Patch045: gdb-bz533176-fortran-omp-step.patch
|
||||
|
||||
# Workaround ccache making lineno non-zero for command-line definitions.
|
||||
#=fedoratest: ccache is rarely used and it is even fixed now.
|
||||
Patch046: gdb-ccache-workaround.patch
|
||||
|
||||
#=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
|
||||
Patch047: gdb-archer-pie-addons.patch
|
||||
|
||||
#=push+jan: Breakpoints disabling matching should not be based on address.
|
||||
Patch048: gdb-archer-pie-addons-keep-disabled.patch
|
||||
|
||||
# Testcase for "Do not make up line information" fix by Daniel Jacobowitz.
|
||||
#=fedoratest
|
||||
Patch049: gdb-lineno-makeup-test.patch
|
||||
|
||||
# Test power7 ppc disassembly.
|
||||
#=fedoratest
|
||||
Patch050: gdb-ppc-power7-test.patch
|
||||
|
||||
# Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623).
|
||||
#=push+jan: Currently it is still not fully safe.
|
||||
Patch051: gdb-moribund-utrace-workaround.patch
|
||||
|
||||
# Fix follow-exec for C++ programs (bugreported by Martin Stransky).
|
||||
#=fedoratest
|
||||
Patch052: gdb-archer-next-over-throw-cxx-exec.patch
|
||||
|
||||
# Backport DWARF-4 support (BZ 601887, Tom Tromey).
|
||||
#=fedoratest
|
||||
Patch053: gdb-bz601887-dwarf4-rh-test.patch
|
||||
|
||||
#=push+jan
|
||||
Patch054: gdb-6.6-buildid-locate-core-as-arg.patch
|
||||
|
||||
# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
|
||||
#=push+jan
|
||||
Patch055: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
|
||||
# [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604).
|
||||
#=fedoratest
|
||||
Patch056: gdb-test-bt-cfi-without-die.patch
|
||||
|
||||
# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
|
||||
#=fedoratest
|
||||
Patch057: gdb-bz634108-solib_address.patch
|
||||
|
||||
# New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435).
|
||||
#=fedoratest
|
||||
Patch058: gdb-test-pid0-core.patch
|
||||
|
||||
# [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp.
|
||||
#=fedoratest
|
||||
Patch059: gdb-test-dw2-aranges.patch
|
||||
|
||||
# [archer-keiths-expr-cumulative+upstream] Import C++ testcases.
|
||||
#=fedoratest
|
||||
Patch060: gdb-test-expr-cumulative-archer.patch
|
||||
|
||||
# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
|
||||
#=fedoratest
|
||||
Patch061: gdb-physname-pr11734-test.patch
|
||||
|
||||
# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
|
||||
#=fedoratest
|
||||
Patch062: gdb-physname-pr12273-test.patch
|
||||
|
||||
# Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890).
|
||||
#=fedoratest
|
||||
Patch063: gdb-test-ivy-bridge.patch
|
||||
|
||||
# Hack for proper PIE run of the testsuite.
|
||||
#=fedoratest
|
||||
Patch064: gdb-runtest-pie-override.patch
|
||||
|
||||
# Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878).
|
||||
#=push+jan
|
||||
Patch065: gdb-attach-fail-reasons-5of5.patch
|
||||
|
||||
# Workaround PR libc/14166 for inferior calls of strstr.
|
||||
#=fedoratest: Compatibility with RHELs (unchecked which ones).
|
||||
Patch066: gdb-glibc-strstr-workaround.patch
|
||||
|
||||
# Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789).
|
||||
#=fedoratest
|
||||
Patch067: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
|
||||
|
||||
# Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343).
|
||||
#=fedoratest
|
||||
Patch068: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
|
||||
|
||||
# Import regression test for `gdb/findvar.c:417: internal-error:
|
||||
# read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5.
|
||||
#=fedoratest
|
||||
Patch069: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
|
||||
|
||||
# Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211).
|
||||
#=push+jan
|
||||
Patch070: gdb-gnat-dwarf-crash-3of3.patch
|
||||
|
||||
# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
|
||||
#=fedoratest
|
||||
Patch071: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
|
||||
|
||||
# Fix 'gdb gives highly misleading error when debuginfo pkg is present,
|
||||
# but not corresponding binary pkg' (RH BZ 981154).
|
||||
#=push+jan
|
||||
Patch072: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
|
||||
|
||||
#=fedoratest
|
||||
Patch073: gdb-archer-vla-tests.patch
|
||||
|
||||
#=fedoratest
|
||||
Patch074: gdb-vla-intel-tests.patch
|
||||
|
||||
# Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
|
||||
#=push
|
||||
Patch075: gdb-btrobust.patch
|
||||
|
||||
# Display Fortran strings in backtraces.
|
||||
#=fedoratest
|
||||
Patch076: gdb-fortran-frame-string.patch
|
||||
|
||||
# Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to
|
||||
# crash.' (RH BZ 1156192).
|
||||
#=fedoratest
|
||||
Patch077: gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
|
||||
# Fix jit-reader.h for multi-lib.
|
||||
#=push+jan
|
||||
Patch078: gdb-jit-reader-multilib.patch
|
||||
|
||||
# Fix '`catch syscall' doesn't work for parent after `fork' is called'
|
||||
# (Philippe Waroquiers, RH BZ 1149205).
|
||||
#=fedoratest
|
||||
Patch079: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
|
||||
# Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug
|
||||
# description: 'C++ (and objc): Internal error on unqualified name
|
||||
# re-set', PR 11657] (RH BZ 1186476).
|
||||
#=fedoratest
|
||||
Patch080: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
|
||||
|
||||
# Test 'info type-printers' Python error (RH BZ 1350436).
|
||||
#=fedoratest
|
||||
Patch081: gdb-rhbz1350436-type-printers-error.patch
|
||||
|
||||
# Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan
|
||||
# Kratochvil, RH BZ 1084404).
|
||||
#=fedoratest
|
||||
Patch082: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
|
||||
|
||||
# Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747).
|
||||
#=push+jan
|
||||
Patch083: gdb-bz1219747-attach-kills.patch
|
||||
|
||||
# Force libncursesw over libncurses to match the includes (RH BZ 1270534).
|
||||
#=push+jan
|
||||
Patch084: gdb-fedora-libncursesw.patch
|
||||
|
||||
# Test clflushopt instruction decode (for RH BZ 1262471).
|
||||
#=fedoratest
|
||||
Patch085: gdb-opcodes-clflushopt-test.patch
|
||||
|
||||
# [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon).
|
||||
#=fedora
|
||||
Patch086: gdb-dts-rhel6-python-compat.patch
|
||||
|
||||
# [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
|
||||
#=push+jan
|
||||
Patch087: gdb-6.6-buildid-locate-rpm-scl.patch
|
||||
|
||||
# Make the GDB quit processing non-abortable to cleanup everything properly.
|
||||
#=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch .
|
||||
Patch088: gdb-6.8-quit-never-aborts.patch
|
||||
|
||||
# [aarch64] Fix hardware watchpoints (RH BZ 1261564).
|
||||
#=fedoratest
|
||||
Patch089: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
|
||||
|
||||
# Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
|
||||
#=fedora
|
||||
Patch090: gdb-container-rh-pkg.patch
|
||||
|
||||
# New test for Python "Cannot locate object file for block" (for RH BZ 1325795).
|
||||
#=fedoratest
|
||||
Patch091: gdb-rhbz1325795-framefilters-test.patch
|
||||
|
||||
# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
|
||||
#=fedora
|
||||
Patch092: gdb-linux_perf-bundle.patch
|
||||
|
||||
# Fix gdb-headless /usr/bin/ executables (BZ 1390251).
|
||||
#
|
||||
# Also, make /usr/bin/gdb.minimal be the default GDB used, if it's
|
||||
# present. For rationale, see:
|
||||
#
|
||||
# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
|
||||
#=fedora
|
||||
Patch093: gdb-libexec-add-index.patch
|
||||
|
||||
# New testcase for: Fix <tab>-completion crash (Gary Benson, RH BZ 1398387).
|
||||
#=fedoratest
|
||||
Patch094: gdb-rhbz1398387-tab-crash-test.patch
|
||||
|
||||
# Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher
|
||||
#=push
|
||||
Patch095: gdb-archer.patch
|
||||
|
||||
# Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd
|
||||
Patch096: gdb-vla-intel-fix-print-char-array.patch
|
||||
|
||||
# [s390x] Backport arch12 instructions decoding (RH BZ 1553104).
|
||||
# =fedoratest
|
||||
Patch097: gdb-rhbz1553104-s390x-arch12-test.patch
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
%patch001 -p1
|
||||
%patch002 -p1
|
||||
%patch003 -p1
|
||||
%patch004 -p1
|
||||
%patch005 -p1
|
||||
%patch006 -p1
|
||||
%patch007 -p1
|
||||
%patch008 -p1
|
||||
%patch009 -p1
|
||||
%patch010 -p1
|
||||
%patch012 -p1
|
||||
%patch013 -p1
|
||||
%patch014 -p1
|
||||
%patch015 -p1
|
||||
%patch016 -p1
|
||||
%patch017 -p1
|
||||
%patch018 -p1
|
||||
%patch019 -p1
|
||||
%patch020 -p1
|
||||
%patch021 -p1
|
||||
%patch022 -p1
|
||||
%patch023 -p1
|
||||
%patch024 -p1
|
||||
%patch025 -p1
|
||||
%patch026 -p1
|
||||
%patch028 -p1
|
||||
%patch029 -p1
|
||||
%patch030 -p1
|
||||
%patch031 -p1
|
||||
%patch032 -p1
|
||||
%patch033 -p1
|
||||
%patch034 -p1
|
||||
%patch035 -p1
|
||||
%patch036 -p1
|
||||
%patch038 -p1
|
||||
%patch039 -p1
|
||||
%patch040 -p1
|
||||
%patch041 -p1
|
||||
%patch042 -p1
|
||||
%patch043 -p1
|
||||
%patch044 -p1
|
||||
%patch045 -p1
|
||||
%patch046 -p1
|
||||
%patch047 -p1
|
||||
%patch048 -p1
|
||||
%patch049 -p1
|
||||
%patch050 -p1
|
||||
%patch051 -p1
|
||||
%patch052 -p1
|
||||
%patch053 -p1
|
||||
%patch054 -p1
|
||||
%patch055 -p1
|
||||
%patch056 -p1
|
||||
%patch057 -p1
|
||||
%patch058 -p1
|
||||
%patch059 -p1
|
||||
%patch060 -p1
|
||||
%patch061 -p1
|
||||
%patch062 -p1
|
||||
%patch063 -p1
|
||||
%patch064 -p1
|
||||
%patch065 -p1
|
||||
%patch066 -p1
|
||||
%patch067 -p1
|
||||
%patch068 -p1
|
||||
%patch069 -p1
|
||||
%patch070 -p1
|
||||
%patch071 -p1
|
||||
%patch072 -p1
|
||||
%patch073 -p1
|
||||
%patch074 -p1
|
||||
%patch075 -p1
|
||||
%patch076 -p1
|
||||
%patch077 -p1
|
||||
%patch078 -p1
|
||||
%patch079 -p1
|
||||
%patch080 -p1
|
||||
%patch081 -p1
|
||||
%patch082 -p1
|
||||
%patch083 -p1
|
||||
%patch084 -p1
|
||||
%patch085 -p1
|
||||
%patch086 -p1
|
||||
%patch087 -p1
|
||||
%patch088 -p1
|
||||
%patch089 -p1
|
||||
%patch090 -p1
|
||||
%patch091 -p1
|
||||
%patch092 -p1
|
||||
%patch093 -p1
|
||||
%patch094 -p1
|
||||
%patch095 -p1
|
||||
%patch096 -p1
|
||||
%patch097 -p1
|
|
@ -0,0 +1 @@
|
|||
606e3fd147ed9a00df165e46f30fe5c46dcda345
|
|
@ -0,0 +1,97 @@
|
|||
gdb-6.3-rh-testversion-20041202.patch
|
||||
gdb-vla-intel-fortran-strides.patch
|
||||
gdb-vla-intel-fortran-vla-strings.patch
|
||||
gdb-vla-intel-stringbt-fix.patch
|
||||
gdb-6.3-gstack-20050411.patch
|
||||
gdb-6.3-test-pie-20050107.patch
|
||||
gdb-6.3-test-self-20050110.patch
|
||||
gdb-6.3-test-dtorfix-20050121.patch
|
||||
gdb-6.3-test-movedir-20050125.patch
|
||||
gdb-6.3-threaded-watchpoints2-20050225.patch
|
||||
gdb-6.3-inferior-notification-20050721.patch
|
||||
gdb-6.3-inheritancetest-20050726.patch
|
||||
gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
gdb-6.5-sharedlibrary-path.patch
|
||||
gdb-6.5-BEA-testsuite.patch
|
||||
gdb-6.5-last-address-space-byte-test.patch
|
||||
gdb-6.5-readline-long-line-crash-test.patch
|
||||
gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
|
||||
gdb-6.5-bz109921-DW_AT_decl_file-test.patch
|
||||
gdb-6.3-bz140532-ppc-unwinding-test.patch
|
||||
gdb-6.3-bz202689-exec-from-pthread-test.patch
|
||||
gdb-6.6-bz230000-power6-disassembly-test.patch
|
||||
gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
gdb-6.6-testsuite-timeouts.patch
|
||||
gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
gdb-6.3-attach-see-vdso-test.patch
|
||||
gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
gdb-6.6-buildid-locate.patch
|
||||
gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
gdb-6.6-buildid-locate-rpm.patch
|
||||
gdb-6.7-charsign-test.patch
|
||||
gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
gdb-6.7-testsuite-stable-results.patch
|
||||
gdb-6.5-ia64-libunwind-leak-test.patch
|
||||
gdb-6.5-missed-trap-on-step-test.patch
|
||||
gdb-6.5-gcore-buffer-limit-test.patch
|
||||
gdb-6.3-mapping-zero-inode-test.patch
|
||||
gdb-6.3-focus-cmd-prev-test.patch
|
||||
gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
gdb-6.5-section-num-fixup-test.patch
|
||||
gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
gdb-simultaneous-step-resume-breakpoint-test.patch
|
||||
gdb-core-open-vdso-warning.patch
|
||||
gdb-bz533176-fortran-omp-step.patch
|
||||
gdb-ccache-workaround.patch
|
||||
gdb-archer-pie-addons.patch
|
||||
gdb-archer-pie-addons-keep-disabled.patch
|
||||
gdb-lineno-makeup-test.patch
|
||||
gdb-ppc-power7-test.patch
|
||||
gdb-moribund-utrace-workaround.patch
|
||||
gdb-archer-next-over-throw-cxx-exec.patch
|
||||
gdb-bz601887-dwarf4-rh-test.patch
|
||||
gdb-6.6-buildid-locate-core-as-arg.patch
|
||||
gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
gdb-test-bt-cfi-without-die.patch
|
||||
gdb-bz634108-solib_address.patch
|
||||
gdb-test-pid0-core.patch
|
||||
gdb-test-dw2-aranges.patch
|
||||
gdb-test-expr-cumulative-archer.patch
|
||||
gdb-physname-pr11734-test.patch
|
||||
gdb-physname-pr12273-test.patch
|
||||
gdb-test-ivy-bridge.patch
|
||||
gdb-runtest-pie-override.patch
|
||||
gdb-attach-fail-reasons-5of5.patch
|
||||
gdb-glibc-strstr-workaround.patch
|
||||
gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
|
||||
gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
|
||||
gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
|
||||
gdb-gnat-dwarf-crash-3of3.patch
|
||||
gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
|
||||
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
|
||||
gdb-archer-vla-tests.patch
|
||||
gdb-vla-intel-tests.patch
|
||||
gdb-btrobust.patch
|
||||
gdb-fortran-frame-string.patch
|
||||
gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
gdb-jit-reader-multilib.patch
|
||||
gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
|
||||
gdb-rhbz1350436-type-printers-error.patch
|
||||
gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
|
||||
gdb-bz1219747-attach-kills.patch
|
||||
gdb-fedora-libncursesw.patch
|
||||
gdb-opcodes-clflushopt-test.patch
|
||||
gdb-dts-rhel6-python-compat.patch
|
||||
gdb-6.6-buildid-locate-rpm-scl.patch
|
||||
gdb-6.8-quit-never-aborts.patch
|
||||
gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
|
||||
gdb-container-rh-pkg.patch
|
||||
gdb-rhbz1325795-framefilters-test.patch
|
||||
gdb-linux_perf-bundle.patch
|
||||
gdb-libexec-add-index.patch
|
||||
gdb-rhbz1398387-tab-crash-test.patch
|
||||
gdb-archer.patch
|
||||
gdb-vla-intel-fix-print-char-array.patch
|
||||
gdb-rhbz1553104-s390x-arch12-test.patch
|
|
@ -0,0 +1,115 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-attach-see-vdso-test.patch
|
||||
|
||||
;; Test kernel VDSO decoding while attaching to an i386 process.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.c
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+int main ()
|
||||
+{
|
||||
+ pause ();
|
||||
+ return 1;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp
|
||||
@@ -0,0 +1,72 @@
|
||||
+# Copyright 2007
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
|
||||
+
|
||||
+# This test only works on Linux
|
||||
+if { ![istarget "*-*-linux-gnu*"] } {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "attach-see-vdso"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]]
|
||||
+
|
||||
+# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
|
||||
+#
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Start the program running and then wait for a bit, to be sure
|
||||
+# that it can be attached to.
|
||||
+
|
||||
+set testpid [eval exec $binfile &]
|
||||
+
|
||||
+# Avoid some race:
|
||||
+sleep 2
|
||||
+
|
||||
+# Start with clean gdb
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+# Never call: gdb_load ${binfile}
|
||||
+# as the former problem would not reproduce otherwise.
|
||||
+
|
||||
+set test "attach"
|
||||
+gdb_test_multiple "attach $testpid" "$test" {
|
||||
+ -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
|
||||
+
|
||||
+# Exit and detach the process.
|
||||
+
|
||||
+gdb_exit
|
||||
+
|
||||
+# Make sure we don't leave a process around to confuse
|
||||
+# the next test run (and prevent the compile by keeping
|
||||
+# the text file busy), in case the "set should_exit" didn't
|
||||
+# work.
|
||||
+
|
||||
+remote_exec build "kill -9 ${testpid}"
|
|
@ -1,90 +0,0 @@
|
|||
2005-12-01 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* frame.c (backtrace_past_zero_pc): New static variable.
|
||||
(get_prev_frame): Don't return NULL for zero pc value if
|
||||
backtrace past-zero-frame option is turned on.
|
||||
(_initialize_frame): Initialize new command to allow backtracing
|
||||
past a zero pc value (set backtrace past-zero-pc).
|
||||
|
||||
testsuite/gdb.base:
|
||||
2005-12-01 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* setshow.exp: Add testing of "set backtrace past-zero-pc" option.
|
||||
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.base/setshow.exp
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/testsuite/gdb.base/setshow.exp 2006-07-11 02:46:50.000000000 -0300
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/setshow.exp 2006-07-11 02:47:24.000000000 -0300
|
||||
@@ -1,4 +1,4 @@
|
||||
-# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003
|
||||
+# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -106,6 +106,16 @@ if { ![target_info exists use_gdb_stub]
|
||||
delete_breakpoints
|
||||
gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args"
|
||||
}
|
||||
+#test show backtrace past-zero-pc
|
||||
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is off." "default show backtrace past-zero-pc (off)"
|
||||
+#test set backtrace past-zero-pc on
|
||||
+gdb_test "set backtrace past-zero-pc on" "" "set backtrace past-zero-pc on"
|
||||
+#test show backtrace past-zero-pc
|
||||
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is on." "show backtrace past-zero-pc (on)"
|
||||
+#test set backtrace past-zero-pc off
|
||||
+gdb_test "set backtrace past-zero-pc off" "" "set backtrace past-zero-pc off"
|
||||
+#test show backtrace past-zero-pc
|
||||
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is off." "show backtrace past-zero-pc (off)"
|
||||
#test set check range on
|
||||
gdb_test "set check range on" "" "set check range on"
|
||||
#test show check range on
|
||||
Index: gdb-6.5/gdb/frame.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/frame.c 2006-07-11 02:46:50.000000000 -0300
|
||||
+++ gdb-6.5/gdb/frame.c 2006-07-11 02:51:20.000000000 -0300
|
||||
@@ -131,6 +131,16 @@ Whether backtraces should continue past
|
||||
value);
|
||||
}
|
||||
|
||||
+static int backtrace_past_zero_pc;
|
||||
+static void
|
||||
+show_backtrace_past_zero_pc (struct ui_file *file, int from_tty,
|
||||
+ struct cmd_list_element *c, const char *value)
|
||||
+{
|
||||
+ fprintf_filtered (file, _("\
|
||||
+Whether backtraces should continue past a zero pc value is %s.\n"),
|
||||
+ value);
|
||||
+}
|
||||
+
|
||||
static int backtrace_past_entry;
|
||||
static void
|
||||
show_backtrace_past_entry (struct ui_file *file, int from_tty,
|
||||
@@ -1313,9 +1323,7 @@ get_prev_frame (struct frame_info *this_
|
||||
}
|
||||
|
||||
if (this_frame->level > 0
|
||||
-#if 0
|
||||
- && backtrace_past_zero_pc
|
||||
-#endif
|
||||
+ && !backtrace_past_zero_pc
|
||||
&& get_frame_type (this_frame) == NORMAL_FRAME
|
||||
&& get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
|
||||
&& get_frame_pc (this_frame) == 0)
|
||||
@@ -1629,6 +1637,17 @@ the rest of the stack trace."),
|
||||
&set_backtrace_cmdlist,
|
||||
&show_backtrace_cmdlist);
|
||||
|
||||
+ add_setshow_boolean_cmd ("past-zero-pc", class_obscure,
|
||||
+ &backtrace_past_zero_pc, _("\
|
||||
+Set whether backtraces should continue past a zero pc value."), _("\
|
||||
+Show whether backtraces should continue past a zero pc value."), _("\
|
||||
+Normally GDB stops backtracing when it finds a zero pc.\n\
|
||||
+Set this variable if you need to see the rest of the stack trace."),
|
||||
+ NULL,
|
||||
+ show_backtrace_past_zero_pc,
|
||||
+ &set_backtrace_cmdlist,
|
||||
+ &show_backtrace_cmdlist);
|
||||
+
|
||||
add_setshow_integer_cmd ("limit", class_obscure,
|
||||
&backtrace_limit, _("\
|
||||
Set an upper bound on the number of backtrace levels."), _("\
|
|
@ -0,0 +1,320 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-bz140532-ppc-unwinding-test.patch
|
||||
|
||||
;; Update PPC unwinding patches to their upstream variants (BZ 140532).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
|
||||
@@ -0,0 +1,78 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+ .section ".text"
|
||||
+ .align 2
|
||||
+ .globl func0
|
||||
+ .type func0, @function
|
||||
+func0:
|
||||
+ stwu 1,-16(1)
|
||||
+ mflr 0
|
||||
+ stw 31,12(1)
|
||||
+ stw 0,20(1)
|
||||
+ mr 31,1
|
||||
+ bl abort
|
||||
+ .size func0, .-func0
|
||||
+ .align 2
|
||||
+ .globl func1
|
||||
+ .type func1, @function
|
||||
+func1:
|
||||
+ stwu 1,-16(1)
|
||||
+ mflr 0
|
||||
+/* 20 = BO = branch always
|
||||
+ 31 = BI = CR bit (ignored) */
|
||||
+ bcl 20,31,.Lpie
|
||||
+.Lpie: stw 31,12(1)
|
||||
+ stw 0,20(1)
|
||||
+ mr 31,1
|
||||
+ bl func0
|
||||
+ mr 0,3
|
||||
+ lis 9,var@ha
|
||||
+ lwz 9,var@l(9)
|
||||
+ add 0,0,9
|
||||
+ mr 3,0
|
||||
+ lwz 11,0(1)
|
||||
+ lwz 0,4(11)
|
||||
+ mtlr 0
|
||||
+ lwz 31,-4(11)
|
||||
+ mr 1,11
|
||||
+ blr
|
||||
+ .size func1, .-func1
|
||||
+ .section .note.GNU-stack,"",@progbits
|
||||
+ .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)"
|
||||
+
|
||||
+/* Original source file:
|
||||
+
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+extern volatile int var;
|
||||
+
|
||||
+int func0 (void) __attribute__((__noinline__));
|
||||
+int func0 (void)
|
||||
+{
|
||||
+ abort ();
|
||||
+ return var;
|
||||
+}
|
||||
+
|
||||
+int func1 (void) __attribute__((__noinline__));
|
||||
+int func1 (void)
|
||||
+{
|
||||
+ return func0 () + var;
|
||||
+}
|
||||
+
|
||||
+*/
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S
|
||||
@@ -0,0 +1,98 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+ .section ".toc","aw"
|
||||
+ .section ".text"
|
||||
+ .align 2
|
||||
+ .globl func0
|
||||
+ .section ".opd","aw"
|
||||
+ .align 3
|
||||
+func0:
|
||||
+ .quad .L.func0,.TOC.@tocbase
|
||||
+ .previous
|
||||
+ .type func0, @function
|
||||
+.L.func0:
|
||||
+ mflr 0
|
||||
+ std 31,-8(1)
|
||||
+ std 0,16(1)
|
||||
+ stdu 1,-128(1)
|
||||
+ mr 31,1
|
||||
+ bl abort
|
||||
+ nop
|
||||
+ .long 0
|
||||
+ .byte 0,0,0,1,128,1,0,1
|
||||
+ .size func0,.-.L.func0
|
||||
+ .section ".toc","aw"
|
||||
+.LC1:
|
||||
+ .tc var[TC],var
|
||||
+ .section ".text"
|
||||
+ .align 2
|
||||
+ .globl func1
|
||||
+ .section ".opd","aw"
|
||||
+ .align 3
|
||||
+func1:
|
||||
+ .quad .L.func1,.TOC.@tocbase
|
||||
+ .previous
|
||||
+ .type func1, @function
|
||||
+.L.func1:
|
||||
+ mflr 0
|
||||
+/* 20 = BO = branch always
|
||||
+ 31 = BI = CR bit (ignored) */
|
||||
+ bcl 20,31,.Lpie
|
||||
+.Lpie: std 31,-8(1)
|
||||
+ std 0,16(1)
|
||||
+ stdu 1,-128(1)
|
||||
+ mr 31,1
|
||||
+ bl func0
|
||||
+ mr 11,3
|
||||
+ ld 9,.LC1@toc(2)
|
||||
+ lwz 0,0(9)
|
||||
+ add 0,11,0
|
||||
+ extsw 0,0
|
||||
+ mr 3,0
|
||||
+ ld 1,0(1)
|
||||
+ ld 0,16(1)
|
||||
+ mtlr 0
|
||||
+ ld 31,-8(1)
|
||||
+ blr
|
||||
+ .long 0
|
||||
+ .byte 0,0,0,1,128,1,0,1
|
||||
+ .size func1,.-.L.func1
|
||||
+ .section .note.GNU-stack,"",@progbits
|
||||
+ .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)"
|
||||
+
|
||||
+/* Original source file:
|
||||
+
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+extern volatile int var;
|
||||
+
|
||||
+int func0 (void) __attribute__((__noinline__));
|
||||
+int func0 (void)
|
||||
+{
|
||||
+ abort ();
|
||||
+ return var;
|
||||
+}
|
||||
+
|
||||
+int func1 (void) __attribute__((__noinline__));
|
||||
+int func1 (void)
|
||||
+{
|
||||
+ return func0 () + var;
|
||||
+}
|
||||
+
|
||||
+*/
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c
|
||||
@@ -0,0 +1,29 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+/* Force `-fpie' double jump bl->blrl. */
|
||||
+/* No longer used. */
|
||||
+volatile int var;
|
||||
+
|
||||
+extern int func1 (void);
|
||||
+
|
||||
+int main (void)
|
||||
+{
|
||||
+ func1 ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
|
||||
@@ -0,0 +1,72 @@
|
||||
+# Copyright 2006, 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Test unwinding fixes of the PPC platform, specifically on the coping with BCL
|
||||
+# jump of the PIE code.
|
||||
+
|
||||
+if ![istarget "powerpc*-*-linux*"] then {
|
||||
+ verbose "Skipping powerpc-linux prologue tests."
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "powerpc-bcl-prologue"
|
||||
+set srcfile1 ${testfile}.c
|
||||
+set flags "debug"
|
||||
+if [istarget "powerpc-*"] then {
|
||||
+ set srcfile2 ${testfile}-asm32.S
|
||||
+ set flags "$flags additional_flags=-m32"
|
||||
+} elseif [istarget "powerpc64-*"] then {
|
||||
+ set srcfile2 ${testfile}-asm64.S
|
||||
+ set flags "$flags additional_flags=-m64"
|
||||
+} else {
|
||||
+ fail "powerpc arch test"
|
||||
+ return
|
||||
+}
|
||||
+set objfile2 [standard_output_file ${testfile}-asm.o]
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2}" ${binfile} executable $flags] != ""} {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+# We should stop in abort(3).
|
||||
+
|
||||
+gdb_run_cmd
|
||||
+
|
||||
+gdb_test_multiple {} "continue to abort()" {
|
||||
+ -re ".*Program received signal SIGABRT,.*$gdb_prompt $" {
|
||||
+ pass "continue to abort()"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Check backtrace:
|
||||
+# #3 0x0804835f in func0 ()
|
||||
+# #4 0x0804836a in func1 ()
|
||||
+# #5 0x0804838c in main ()
|
||||
+# (gdb)
|
||||
+# `\\.?' prefixes are needed for ppc64 without `debug' (another bug).
|
||||
+
|
||||
+set test "matching unwind"
|
||||
+gdb_test_multiple "backtrace" $test {
|
||||
+ -re "\r\n#\[0-9\]\[^\r\n\]* in \\.?func0 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?func1 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?main \\(\[^\r\n\]*\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp
|
||||
--- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp
|
||||
+++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp
|
||||
@@ -16,8 +16,9 @@
|
||||
# Test PowerPC prologue analyzer.
|
||||
|
||||
# Do not run on AIX (where we won't be able to build the tests without
|
||||
-# some surgery) or on PowerPC64 (ditto, dot symbols).
|
||||
-if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then {
|
||||
+# some surgery). PowerPC64 target would break due to dot symbols but we build
|
||||
+# there PowerPC32 inferior.
|
||||
+if {[istarget *-*-aix*] || ![istarget "powerpc*-*-*"]} then {
|
||||
verbose "Skipping PowerPC prologue tests."
|
||||
return
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
||||
|
||||
;; Testcase for exec() from threaded program (BZ 202689).
|
||||
;;=fedoratest
|
||||
|
||||
2007-01-17 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.threads/threaded-exec.exp, gdb.threads/threaded-exec.c: New files.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threaded-exec.c
|
||||
@@ -0,0 +1,46 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
+ Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+#include <stddef.h>
|
||||
+#include <pthread.h>
|
||||
+#include <assert.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+
|
||||
+static void *
|
||||
+threader (void *arg)
|
||||
+{
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ pthread_t t1;
|
||||
+ int i;
|
||||
+
|
||||
+ i = pthread_create (&t1, NULL, threader, (void *) NULL);
|
||||
+ assert (i == 0);
|
||||
+ i = pthread_join (t1, NULL);
|
||||
+ assert (i == 0);
|
||||
+
|
||||
+ execl ("/bin/true", "/bin/true", NULL);
|
||||
+ abort ();
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
@@ -0,0 +1,41 @@
|
||||
+# threaded-exec.exp -- Check reset of the tracked threads on exec*(2)
|
||||
+# Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+set testfile threaded-exec
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable []] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+gdb_run_cmd
|
||||
+
|
||||
+gdb_test_multiple {} "Program exited" {
|
||||
+ -re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {
|
||||
+ pass "Program exited"
|
||||
+ }
|
||||
+}
|
|
@ -1,57 +0,0 @@
|
|||
for gdb-6.3/gdb/ChangeLog
|
||||
from Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* i386-linux-nat.c (i386_debug_register_for_thread): New struct.
|
||||
(i386_linux_set_dr_for_thread): Rename from...
|
||||
(i386_linux_set_debug_regs_for_thread): ... this, and
|
||||
add new function to catch exceptions in the old one.
|
||||
|
||||
Index: gdb-6.5/gdb/i386-linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/i386-linux-nat.c 2006-07-11 05:21:58.000000000 -0300
|
||||
+++ gdb-6.5/gdb/i386-linux-nat.c 2006-07-11 05:24:29.000000000 -0300
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "observer.h"
|
||||
#include "target.h"
|
||||
#include "linux-nat.h"
|
||||
+#include "exceptions.h"
|
||||
|
||||
#include "gdb_assert.h"
|
||||
#include "gdb_string.h"
|
||||
@@ -695,14 +696,33 @@ struct i386_debug_register_state
|
||||
unsigned long control;
|
||||
};
|
||||
|
||||
-static void
|
||||
-i386_linux_set_debug_regs_for_thread (ptid_t ptid,
|
||||
- struct i386_debug_register_state *dbs)
|
||||
+struct i386_debug_register_for_thread
|
||||
+{
|
||||
+ ptid_t ptid;
|
||||
+ struct i386_debug_register_state *dbs;
|
||||
+};
|
||||
+
|
||||
+static int
|
||||
+i386_linux_set_dr_for_thread (void *drp)
|
||||
{
|
||||
+ ptid_t ptid = ((struct i386_debug_register_for_thread *)drp)->ptid;
|
||||
+ struct i386_debug_register_state *dbs
|
||||
+ = ((struct i386_debug_register_for_thread *)drp)->dbs;
|
||||
int i;
|
||||
for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
|
||||
i386_linux_dr_set_addr (ptid, i, dbs->addr[i]);
|
||||
i386_linux_dr_set_control (ptid, dbs->control);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+i386_linux_set_debug_regs_for_thread (ptid_t ptid,
|
||||
+ struct i386_debug_register_state *dbs)
|
||||
+{
|
||||
+ struct i386_debug_register_for_thread dr;
|
||||
+ dr.ptid = ptid;
|
||||
+ dr.dbs = dbs;
|
||||
+ return catch_errors (i386_linux_set_dr_for_thread, &dr, "", RETURN_MASK_ALL);
|
||||
}
|
||||
|
||||
/* Iterator function to support syncing debug registers across all threads. */
|
|
@ -1,44 +0,0 @@
|
|||
2004-12-16 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* cp-demangle.c (d_print_comp): Add support for exposing
|
||||
not-in-charge constructors/destructors in the demangled
|
||||
names.
|
||||
|
||||
--- gdb-6.3/libiberty/cp-demangle.c.fix Thu Dec 16 16:39:09 2004
|
||||
+++ gdb-6.3/libiberty/cp-demangle.c Thu Dec 16 16:39:37 2004
|
||||
@@ -2978,11 +2978,35 @@ d_print_comp (dpi, dc)
|
||||
|
||||
case DEMANGLE_COMPONENT_CTOR:
|
||||
d_print_comp (dpi, dc->u.s_ctor.name);
|
||||
+ switch (dc->u.s_ctor.kind)
|
||||
+ {
|
||||
+ case gnu_v3_complete_object_ctor:
|
||||
+ /* no decoration */
|
||||
+ break;
|
||||
+ case gnu_v3_base_object_ctor:
|
||||
+ d_append_string_constant (dpi, "$base");
|
||||
+ break;
|
||||
+ case gnu_v3_complete_object_allocating_ctor:
|
||||
+ d_append_string_constant (dpi, "$allocate");
|
||||
+ break;
|
||||
+ }
|
||||
return;
|
||||
|
||||
case DEMANGLE_COMPONENT_DTOR:
|
||||
d_append_char (dpi, '~');
|
||||
d_print_comp (dpi, dc->u.s_dtor.name);
|
||||
+ switch (dc->u.s_dtor.kind)
|
||||
+ {
|
||||
+ case gnu_v3_deleting_dtor:
|
||||
+ d_append_string_constant (dpi, "$delete");
|
||||
+ break;
|
||||
+ case gnu_v3_complete_object_dtor:
|
||||
+ /* no decoration */
|
||||
+ break;
|
||||
+ case gnu_v3_base_object_dtor:
|
||||
+ d_append_string_constant (dpi, "$base");
|
||||
+ break;
|
||||
+ }
|
||||
return;
|
||||
|
||||
case DEMANGLE_COMPONENT_VTABLE:
|
|
@ -1,586 +0,0 @@
|
|||
2005-01-20 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* symtab.h (find_line_pc): Change prototype to new api
|
||||
which returns a list of pc values and the number of list elements.
|
||||
* symtab.c (find_line_pc): Change function to new api which
|
||||
returns a list of pc values. Support recognizing a base ctor
|
||||
or dtor and finding an additional pc value for the in-charge
|
||||
ctor or dtor accordingly.
|
||||
(find_line_common): Change api to accept a start_index argument
|
||||
which determines where to start searching from in the line table.
|
||||
(find_line_by_pc): New function.
|
||||
* breakpoint.c (resolve_sal_pc_list): New function.
|
||||
(breakpoint_sals_to_pc): Support multiple pc values for a
|
||||
line in a ctor/dtor.
|
||||
(gdb_breakpoint): Change call to find_line_pc to use new api.
|
||||
(break_command_1): Move resolve_sals_to_pc earlier due to the
|
||||
fact it now can extend the sal list.
|
||||
* mi/mi-cmd-disas.c (mi_cmd_disassemble): Change call to
|
||||
find_line_pc to new api.
|
||||
* tui/tui-layout.c (extract_display_start_addr): Ditto.
|
||||
* tui/tui-win.c (make_visible_with_new_height): Ditto.
|
||||
* tui/tui-winsource.c (tui_update_source_windows_with_addr): Ditto.
|
||||
|
||||
Index: gdb-6.5/gdb/mi/mi-cmd-disas.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/mi/mi-cmd-disas.c 2006-07-11 01:30:43.000000000 -0300
|
||||
+++ gdb-6.5/gdb/mi/mi-cmd-disas.c 2006-07-11 02:16:07.000000000 -0300
|
||||
@@ -1,5 +1,5 @@
|
||||
/* MI Command Set - disassemble commands.
|
||||
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
+ Copyright (C) 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Solutions (a Red Hat company).
|
||||
|
||||
This file is part of GDB.
|
||||
@@ -145,11 +145,18 @@ mi_cmd_disassemble (char *command, char
|
||||
|
||||
if (line_seen && file_seen)
|
||||
{
|
||||
+ CORE_ADDR *pc_list;
|
||||
+ int num_pc_values;
|
||||
+
|
||||
s = lookup_symtab (file_string);
|
||||
if (s == NULL)
|
||||
error (_("mi_cmd_disassemble: Invalid filename."));
|
||||
- if (!find_line_pc (s, line_num, &start))
|
||||
+ if (!find_line_pc (s, line_num, &pc_list, &num_pc_values))
|
||||
error (_("mi_cmd_disassemble: Invalid line number"));
|
||||
+ /* FIXME: What do we do with multiple pc values for ctors/dtors
|
||||
+ under mi? */
|
||||
+ start = pc_list[0];
|
||||
+ xfree (pc_list);
|
||||
if (find_pc_partial_function (start, NULL, &low, &high) == 0)
|
||||
error (_("mi_cmd_disassemble: No function contains specified address"));
|
||||
}
|
||||
Index: gdb-6.5/gdb/tui/tui-layout.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/tui/tui-layout.c 2006-07-11 01:30:43.000000000 -0300
|
||||
+++ gdb-6.5/gdb/tui/tui-layout.c 2006-07-11 02:16:07.000000000 -0300
|
||||
@@ -1,6 +1,6 @@
|
||||
/* TUI layout window management.
|
||||
|
||||
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
|
||||
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
Contributed by Hewlett-Packard Company.
|
||||
@@ -511,7 +511,8 @@ extract_display_start_addr (void)
|
||||
{
|
||||
enum tui_layout_type cur_layout = tui_current_layout ();
|
||||
CORE_ADDR addr;
|
||||
- CORE_ADDR pc;
|
||||
+ CORE_ADDR *pc_list;
|
||||
+ int num_pc_values;
|
||||
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
|
||||
|
||||
switch (cur_layout)
|
||||
@@ -520,8 +521,11 @@ extract_display_start_addr (void)
|
||||
case SRC_DATA_COMMAND:
|
||||
find_line_pc (cursal.symtab,
|
||||
TUI_SRC_WIN->detail.source_info.start_line_or_addr.u.line_no,
|
||||
- &pc);
|
||||
- addr = pc;
|
||||
+ &pc_list, &num_pc_values);
|
||||
+ /* FIXME: What do we do with multiple pc values for ctors/dtors or
|
||||
+ inlined functions? */
|
||||
+ addr = pc_list[0];
|
||||
+ xfree (pc_list);
|
||||
break;
|
||||
case DISASSEM_COMMAND:
|
||||
case SRC_DISASSEM_COMMAND:
|
||||
Index: gdb-6.5/gdb/tui/tui-win.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/tui/tui-win.c 2006-07-11 01:30:43.000000000 -0300
|
||||
+++ gdb-6.5/gdb/tui/tui-win.c 2006-07-11 02:16:12.000000000 -0300
|
||||
@@ -1,6 +1,6 @@
|
||||
/* TUI window generic functions.
|
||||
|
||||
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
|
||||
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Hewlett-Packard Company.
|
||||
@@ -1342,8 +1342,16 @@ make_visible_with_new_height (struct tui
|
||||
}
|
||||
else
|
||||
{
|
||||
+ CORE_ADDR *pc_list;
|
||||
+ int num_pc_values;
|
||||
line.loa = LOA_ADDRESS;
|
||||
- find_line_pc (s, cursal.line, &line.u.addr);
|
||||
+ if (find_line_pc (s, cursal.line, &pc_list, &num_pc_values))
|
||||
+ {
|
||||
+ /* FIXME: What do we do with multiple pc values for
|
||||
+ ctors/dtors and inlined functions? */
|
||||
+ line.u.addr = pc_list[0];
|
||||
+ xfree (pc_list);
|
||||
+ }
|
||||
}
|
||||
tui_update_source_window (win_info, s, line, TRUE);
|
||||
}
|
||||
Index: gdb-6.5/gdb/tui/tui-winsource.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/tui/tui-winsource.c 2006-07-11 01:30:43.000000000 -0300
|
||||
+++ gdb-6.5/gdb/tui/tui-winsource.c 2006-07-11 01:39:20.000000000 -0300
|
||||
@@ -1,6 +1,6 @@
|
||||
/* TUI display source/assembly window.
|
||||
|
||||
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
|
||||
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Hewlett-Packard Company.
|
||||
@@ -173,14 +173,21 @@ tui_update_source_windows_with_addr (COR
|
||||
void
|
||||
tui_update_source_windows_with_line (struct symtab *s, int line)
|
||||
{
|
||||
- CORE_ADDR pc;
|
||||
+ CORE_ADDR pc = 0;
|
||||
+ CORE_ADDR *pc_list;
|
||||
+ int num_pc_values;
|
||||
struct tui_line_or_address l;
|
||||
|
||||
switch (tui_current_layout ())
|
||||
{
|
||||
case DISASSEM_COMMAND:
|
||||
case DISASSEM_DATA_COMMAND:
|
||||
- find_line_pc (s, line, &pc);
|
||||
+ /* FIXME: What do we do with multiple pc values for ctors/dtors? */
|
||||
+ if (find_line_pc (s, line, &pc_list, &num_pc_values))
|
||||
+ {
|
||||
+ pc = pc_list[0];
|
||||
+ xfree (pc_list);
|
||||
+ }
|
||||
tui_update_source_windows_with_addr (pc);
|
||||
break;
|
||||
default:
|
||||
@@ -189,7 +196,12 @@ tui_update_source_windows_with_line (str
|
||||
tui_show_symtab_source (s, l, FALSE);
|
||||
if (tui_current_layout () == SRC_DISASSEM_COMMAND)
|
||||
{
|
||||
- find_line_pc (s, line, &pc);
|
||||
+ /* FIXME: What do we do with multiple pc values for ctors/dtors? */
|
||||
+ if (find_line_pc (s, line, &pc_list, &num_pc_values))
|
||||
+ {
|
||||
+ pc = pc_list[0];
|
||||
+ xfree (pc_list);
|
||||
+ }
|
||||
tui_show_disassem (pc);
|
||||
}
|
||||
break;
|
||||
Index: gdb-6.5/gdb/symtab.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/symtab.c 2006-07-11 01:30:43.000000000 -0300
|
||||
+++ gdb-6.5/gdb/symtab.c 2006-07-11 02:16:05.000000000 -0300
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Symbol table lookup for the GNU debugger, GDB.
|
||||
|
||||
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
|
||||
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
@@ -73,7 +73,9 @@ static void sources_info (char *, int);
|
||||
|
||||
static void output_source_filename (const char *, int *);
|
||||
|
||||
-static int find_line_common (struct linetable *, int, int *);
|
||||
+static int find_line_common (struct linetable *, int, int, int *);
|
||||
+
|
||||
+static int find_line_by_pc (struct linetable *, CORE_ADDR, int *);
|
||||
|
||||
/* This one is used by linespec.c */
|
||||
|
||||
@@ -2233,6 +2235,9 @@ find_pc_line (CORE_ADDR pc, int notcurre
|
||||
/* Find line number LINE in any symtab whose name is the same as
|
||||
SYMTAB.
|
||||
|
||||
+ If INDEX is non-NULL, use the value as the starting index in the
|
||||
+ linetable to start at.
|
||||
+
|
||||
If found, return the symtab that contains the linetable in which it was
|
||||
found, set *INDEX to the index in the linetable of the best entry
|
||||
found, and set *EXACT_MATCH nonzero if the value returned is an
|
||||
@@ -2249,13 +2254,19 @@ find_line_symtab (struct symtab *symtab,
|
||||
so far seen. */
|
||||
|
||||
int best_index;
|
||||
+ int start_index;
|
||||
struct linetable *best_linetable;
|
||||
struct symtab *best_symtab;
|
||||
|
||||
+ if (index)
|
||||
+ start_index = *index;
|
||||
+ else
|
||||
+ start_index = 0;
|
||||
+
|
||||
/* First try looking it up in the given symtab. */
|
||||
best_linetable = LINETABLE (symtab);
|
||||
best_symtab = symtab;
|
||||
- best_index = find_line_common (best_linetable, line, &exact);
|
||||
+ best_index = find_line_common (best_linetable, line, start_index, &exact);
|
||||
if (best_index < 0 || !exact)
|
||||
{
|
||||
/* Didn't find an exact match. So we better keep looking for
|
||||
@@ -2286,7 +2297,7 @@ find_line_symtab (struct symtab *symtab,
|
||||
if (strcmp (symtab->filename, s->filename) != 0)
|
||||
continue;
|
||||
l = LINETABLE (s);
|
||||
- ind = find_line_common (l, line, &exact);
|
||||
+ ind = find_line_common (l, line, start_index, &exact);
|
||||
if (ind >= 0)
|
||||
{
|
||||
if (exact)
|
||||
@@ -2322,13 +2333,23 @@ done:
|
||||
Returns zero for invalid line number (and sets the PC to 0).
|
||||
The source file is specified with a struct symtab. */
|
||||
|
||||
+static CORE_ADDR empty_pc_list = (CORE_ADDR)0;
|
||||
+
|
||||
int
|
||||
-find_line_pc (struct symtab *symtab, int line, CORE_ADDR *pc)
|
||||
+find_line_pc (struct symtab *symtab, int line, CORE_ADDR **pc_array,
|
||||
+ int *num_elements)
|
||||
{
|
||||
struct linetable *l;
|
||||
- int ind;
|
||||
+ int ind = 0;
|
||||
+ char *name;
|
||||
+ CORE_ADDR main_pc;
|
||||
+ struct minimal_symbol *minsym;
|
||||
+ struct minimal_symbol *minsym2;
|
||||
+
|
||||
+
|
||||
+ *pc_array = &empty_pc_list;
|
||||
+ *num_elements = 0;
|
||||
|
||||
- *pc = 0;
|
||||
if (symtab == 0)
|
||||
return 0;
|
||||
|
||||
@@ -2336,7 +2357,50 @@ find_line_pc (struct symtab *symtab, int
|
||||
if (symtab != NULL)
|
||||
{
|
||||
l = LINETABLE (symtab);
|
||||
- *pc = l->item[ind].pc;
|
||||
+ main_pc = l->item[ind].pc;
|
||||
+ minsym = lookup_minimal_symbol_by_pc (main_pc);
|
||||
+ if (minsym != NULL && minsym->ginfo.language == language_cplus)
|
||||
+ {
|
||||
+ char *base_name =
|
||||
+ minsym->ginfo.language_specific.cplus_specific.demangled_name;
|
||||
+ char *tmp_ptr = strstr (base_name, "$base(");
|
||||
+ if (tmp_ptr != NULL)
|
||||
+ {
|
||||
+ char *regular_name = (char *)xmalloc (strlen (base_name));
|
||||
+ memcpy (regular_name, base_name, tmp_ptr - base_name);
|
||||
+ strcpy (regular_name + (tmp_ptr - base_name),
|
||||
+ tmp_ptr + sizeof ("$base") - 1);
|
||||
+ minsym2 = lookup_minimal_symbol (regular_name, NULL, NULL);
|
||||
+ xfree (regular_name);
|
||||
+ if (minsym2 != NULL)
|
||||
+ {
|
||||
+ /* We have recognized we have a ctor or dtor and have
|
||||
+ located our line in the not-in-charge version. We
|
||||
+ also have located the in-charge version's minsym.
|
||||
+ From this, we can find the index for the first line
|
||||
+ line in the in-charge ctor/dtor and then search forward
|
||||
+ for the specified line, thereby finding the 2nd match. */
|
||||
+ int exact;
|
||||
+ int ind = find_line_by_pc (l, minsym2->ginfo.value.address,
|
||||
+ &exact);
|
||||
+ if (ind >= 0)
|
||||
+ {
|
||||
+ ind = find_line_common (l, line, ind, &exact);
|
||||
+ if (ind >= 0)
|
||||
+ {
|
||||
+ *pc_array = xmalloc (2 * sizeof (CORE_ADDR));
|
||||
+ (*pc_array)[0] = main_pc;
|
||||
+ (*pc_array)[1] = l->item[ind].pc;
|
||||
+ *num_elements = 2;
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ *pc_array = xmalloc (sizeof (CORE_ADDR));
|
||||
+ (*pc_array)[0] = main_pc;
|
||||
+ *num_elements = 1;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@@ -2354,12 +2418,22 @@ find_line_pc_range (struct symtab_and_li
|
||||
CORE_ADDR *endptr)
|
||||
{
|
||||
CORE_ADDR startaddr;
|
||||
+ CORE_ADDR *pc_list;
|
||||
+ int num_pc_values;
|
||||
struct symtab_and_line found_sal;
|
||||
|
||||
startaddr = sal.pc;
|
||||
- if (startaddr == 0 && !find_line_pc (sal.symtab, sal.line, &startaddr))
|
||||
+ if (startaddr == 0
|
||||
+ && !find_line_pc (sal.symtab, sal.line, &pc_list, &num_pc_values))
|
||||
return 0;
|
||||
|
||||
+ /* FIXME: have to handle ctors/dtors where line equates to multiple
|
||||
+ pc ranges. */
|
||||
+ if (startaddr == 0)
|
||||
+ startaddr = pc_list[0];
|
||||
+
|
||||
+ xfree (pc_list);
|
||||
+
|
||||
/* This whole function is based on address. For example, if line 10 has
|
||||
two parts, one from 0x100 to 0x200 and one from 0x300 to 0x400, then
|
||||
"info line *0x123" should say the line goes from 0x100 to 0x200
|
||||
@@ -2389,7 +2463,7 @@ find_line_pc_range (struct symtab_and_li
|
||||
Set *EXACT_MATCH nonzero if the value returned is an exact match. */
|
||||
|
||||
static int
|
||||
-find_line_common (struct linetable *l, int lineno,
|
||||
+find_line_common (struct linetable *l, int lineno, int start_index,
|
||||
int *exact_match)
|
||||
{
|
||||
int i;
|
||||
@@ -2408,7 +2482,7 @@ find_line_common (struct linetable *l, i
|
||||
return -1;
|
||||
|
||||
len = l->nitems;
|
||||
- for (i = 0; i < len; i++)
|
||||
+ for (i = start_index; i < len; i++)
|
||||
{
|
||||
struct linetable_entry *item = &(l->item[i]);
|
||||
|
||||
@@ -2432,6 +2506,52 @@ find_line_common (struct linetable *l, i
|
||||
return best_index;
|
||||
}
|
||||
|
||||
+/* Given a line table and a pc value, return the index into the line
|
||||
+ table for the line with pc >= specified pc value.
|
||||
+ Return -1 if none is found. The value is >= 0 if it is an index.
|
||||
+
|
||||
+ Set *EXACT_MATCH nonzero if the value returned is an exact match. */
|
||||
+
|
||||
+static int
|
||||
+find_line_by_pc (struct linetable *l, CORE_ADDR pc,
|
||||
+ int *exact_match)
|
||||
+{
|
||||
+ int i;
|
||||
+ int len;
|
||||
+
|
||||
+ /* BEST is the smallest linenumber > LINENO so far seen,
|
||||
+ or 0 if none has been seen so far.
|
||||
+ BEST_INDEX identifies the item for it. */
|
||||
+
|
||||
+ if (l == 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ len = l->nitems;
|
||||
+ for (i = 0; i < len; i++)
|
||||
+ {
|
||||
+ struct linetable_entry *item = &(l->item[i]);
|
||||
+
|
||||
+ /* Return the first (lowest address) entry which matches or
|
||||
+ exceeds the given pc value. */
|
||||
+ if (item->pc == pc)
|
||||
+ {
|
||||
+ *exact_match = 1;
|
||||
+ return i;
|
||||
+ }
|
||||
+
|
||||
+ if (item->pc > pc)
|
||||
+ {
|
||||
+ *exact_match = 0;
|
||||
+ return i;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* If we got here, we didn't get a match. */
|
||||
+
|
||||
+ *exact_match = 0;
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
int
|
||||
find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
|
||||
{
|
||||
Index: gdb-6.5/gdb/symtab.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/symtab.h 2006-07-11 01:30:43.000000000 -0300
|
||||
+++ gdb-6.5/gdb/symtab.h 2006-07-11 01:39:20.000000000 -0300
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Symbol table definitions for GDB.
|
||||
|
||||
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
|
||||
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
@@ -1256,13 +1256,16 @@ extern struct symtab_and_line find_pc_se
|
||||
|
||||
/* Given a symtab and line number, return the pc there. */
|
||||
|
||||
-extern int find_line_pc (struct symtab *, int, CORE_ADDR *);
|
||||
+extern int find_line_pc (struct symtab *, int, CORE_ADDR **, int *);
|
||||
|
||||
extern int find_line_pc_range (struct symtab_and_line, CORE_ADDR *,
|
||||
CORE_ADDR *);
|
||||
|
||||
extern void resolve_sal_pc (struct symtab_and_line *);
|
||||
|
||||
+extern void resolve_sal_pc_list (struct symtab_and_line *, CORE_ADDR **,
|
||||
+ int *);
|
||||
+
|
||||
/* Given a string, return the line specified by it. For commands like "list"
|
||||
and "breakpoint". */
|
||||
|
||||
Index: gdb-6.5/gdb/breakpoint.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/breakpoint.c 2006-07-11 01:30:53.000000000 -0300
|
||||
+++ gdb-6.5/gdb/breakpoint.c 2006-07-11 01:39:20.000000000 -0300
|
||||
@@ -5268,10 +5268,40 @@ static void
|
||||
breakpoint_sals_to_pc (struct symtabs_and_lines *sals,
|
||||
char *address)
|
||||
{
|
||||
- int i;
|
||||
- for (i = 0; i < sals->nelts; i++)
|
||||
- {
|
||||
- resolve_sal_pc (&sals->sals[i]);
|
||||
+ int i, j, incr;
|
||||
+ int num_pc_values = 1;
|
||||
+
|
||||
+ /* If a line has multiple pc values, we want to create an sal for
|
||||
+ each pc value so we will end up creating n breakpoints. */
|
||||
+ for (i = 0; i < sals->nelts; i+=incr)
|
||||
+ {
|
||||
+ CORE_ADDR *pc_list;
|
||||
+ incr = 1;
|
||||
+
|
||||
+ resolve_sal_pc_list (&sals->sals[i], &pc_list, &num_pc_values);
|
||||
+ if (num_pc_values != 0)
|
||||
+ sals->sals[i].pc = pc_list[0];
|
||||
+ if (num_pc_values > 1)
|
||||
+ {
|
||||
+ struct symtab_and_line *new_sals =
|
||||
+ xmalloc ((sals->nelts + num_pc_values - 1)
|
||||
+ * sizeof (struct symtab_and_line));
|
||||
+ memcpy (new_sals, sals->sals, (i + 1)
|
||||
+ * sizeof (struct symtab_and_line));
|
||||
+ memcpy (&(new_sals[i + 1]), &sals->sals[i],
|
||||
+ sizeof (struct symtab_and_line));
|
||||
+ xfree (sals->sals);
|
||||
+ sals->sals = new_sals;
|
||||
+ sals->nelts += num_pc_values - 1;
|
||||
+ for (j = 1; j < num_pc_values; ++j)
|
||||
+ {
|
||||
+ sals->sals[i + j].pc = pc_list[j];
|
||||
+ }
|
||||
+ incr = num_pc_values;
|
||||
+ }
|
||||
+
|
||||
+ if (num_pc_values != 0)
|
||||
+ xfree (pc_list);
|
||||
|
||||
/* It's possible for the PC to be nonzero, but still an illegal
|
||||
value on some targets.
|
||||
@@ -5406,6 +5436,10 @@ break_command_1 (char *arg, int flag, in
|
||||
|
||||
if (!pending)
|
||||
{
|
||||
+ /* Resolve all line numbers to PC's and verify that the addresses
|
||||
+ are ok for the target. */
|
||||
+ breakpoint_sals_to_pc (&sals, addr_start);
|
||||
+
|
||||
/* Make sure that all storage allocated to SALS gets freed. */
|
||||
make_cleanup (xfree, sals.sals);
|
||||
|
||||
@@ -5436,11 +5470,6 @@ break_command_1 (char *arg, int flag, in
|
||||
make_cleanup (xfree, addr_string[i]);
|
||||
}
|
||||
|
||||
- /* Resolve all line numbers to PC's and verify that the addresses
|
||||
- are ok for the target. */
|
||||
- if (!pending)
|
||||
- breakpoint_sals_to_pc (&sals, addr_start);
|
||||
-
|
||||
/* Verify that condition can be parsed, before setting any
|
||||
breakpoints. Allocate a separate condition expression for each
|
||||
breakpoint. */
|
||||
@@ -5670,14 +5699,16 @@ gdb_breakpoint (char *address, char *con
|
||||
void
|
||||
resolve_sal_pc (struct symtab_and_line *sal)
|
||||
{
|
||||
- CORE_ADDR pc;
|
||||
+ CORE_ADDR *pc_list;
|
||||
+ int num_pc_values;
|
||||
|
||||
if (sal->pc == 0 && sal->symtab != NULL)
|
||||
{
|
||||
- if (!find_line_pc (sal->symtab, sal->line, &pc))
|
||||
+ if (!find_line_pc (sal->symtab, sal->line, &pc_list, &num_pc_values))
|
||||
error (_("No line %d in file \"%s\"."),
|
||||
sal->line, sal->symtab->filename);
|
||||
- sal->pc = pc;
|
||||
+ sal->pc = pc_list[0];
|
||||
+ xfree (pc_list);
|
||||
}
|
||||
|
||||
if (sal->section == 0 && sal->symtab != NULL)
|
||||
@@ -5714,6 +5745,54 @@ resolve_sal_pc (struct symtab_and_line *
|
||||
}
|
||||
}
|
||||
|
||||
+/* Helper function for break_command_1 and disassemble_command. */
|
||||
+
|
||||
+void
|
||||
+resolve_sal_pc_list (struct symtab_and_line *sal, CORE_ADDR **pc_list,
|
||||
+ int *num_pc_values)
|
||||
+{
|
||||
+ *num_pc_values = 0;
|
||||
+ if (sal->pc == 0 && sal->symtab != NULL)
|
||||
+ {
|
||||
+ if (!find_line_pc (sal->symtab, sal->line, pc_list, num_pc_values))
|
||||
+ error ("No line %d in file \"%s\".",
|
||||
+ sal->line, sal->symtab->filename);
|
||||
+ sal->pc = (*pc_list)[0];
|
||||
+ }
|
||||
+
|
||||
+ if (sal->section == 0 && sal->symtab != NULL)
|
||||
+ {
|
||||
+ struct blockvector *bv;
|
||||
+ struct block *b;
|
||||
+ struct symbol *sym;
|
||||
+ int index;
|
||||
+
|
||||
+ bv = blockvector_for_pc_sect (sal->pc, 0, &index, sal->symtab);
|
||||
+ if (bv != NULL)
|
||||
+ {
|
||||
+ b = BLOCKVECTOR_BLOCK (bv, index);
|
||||
+ sym = block_function (b);
|
||||
+ if (sym != NULL)
|
||||
+ {
|
||||
+ fixup_symbol_section (sym, sal->symtab->objfile);
|
||||
+ sal->section = SYMBOL_BFD_SECTION (sym);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* It really is worthwhile to have the section, so we'll just
|
||||
+ have to look harder. This case can be executed if we have
|
||||
+ line numbers but no functions (as can happen in assembly
|
||||
+ source). */
|
||||
+
|
||||
+ struct minimal_symbol *msym;
|
||||
+
|
||||
+ msym = lookup_minimal_symbol_by_pc (sal->pc);
|
||||
+ if (msym)
|
||||
+ sal->section = SYMBOL_BFD_SECTION (msym);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
void
|
||||
break_command (char *arg, int from_tty)
|
||||
{
|
|
@ -1,48 +0,0 @@
|
|||
2005-01-21 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* linespec.c (collect_methods): Don't do special processing for
|
||||
destructors as this will be handled in find_methods.
|
||||
(find_methods): Fix ctor check to also check for dtor.
|
||||
|
||||
Index: gdb-6.5/gdb/linespec.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linespec.c 2006-07-07 01:04:56.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linespec.c 2006-07-07 02:05:35.000000000 -0300
|
||||
@@ -377,12 +377,14 @@ add_matching_methods (int method_counter
|
||||
|
||||
/* Check for special case of looking for member that
|
||||
doesn't have a mangled name provided. This will happen
|
||||
- when we have in-charge and not-in-charge constructors.
|
||||
+ when we have in-charge and not-in-charge ctors/dtors.
|
||||
Since we don't have a mangled name to work with, if we
|
||||
- look for the symbol, we can only find the class itself.
|
||||
+ look for the symbol, we can at best find the class itself.
|
||||
We can find the information we need in the minimal symbol
|
||||
table which has the full member name information we need. */
|
||||
- if (strlen (phys_name) <= strlen (class_name))
|
||||
+ if (strlen (phys_name) <= strlen (class_name)
|
||||
+ || (strlen (phys_name) == strlen (class_name) + 1
|
||||
+ && phys_name[0] == '~'))
|
||||
return add_minsym_members (class_name, phys_name, msym_arr);
|
||||
|
||||
/* Destructor is handled by caller, don't add it to
|
||||
@@ -1709,6 +1711,11 @@ collect_methods (char *copy, struct type
|
||||
{
|
||||
int i1 = 0; /* Counter for the symbol array. */
|
||||
|
||||
+#if 0
|
||||
+ /* Ignore this special method for getting destructors because
|
||||
+ find_methods is more robust and can handle multiple
|
||||
+ destructors which is the case when gcc generates a not-in-charge
|
||||
+ vs an in-charge destructor. */
|
||||
if (destructor_name_p (copy, t))
|
||||
{
|
||||
/* Destructors are a special case. */
|
||||
@@ -1727,6 +1734,7 @@ collect_methods (char *copy, struct type
|
||||
}
|
||||
}
|
||||
else
|
||||
+#endif
|
||||
i1 = find_methods (t, copy, sym_arr, msym_arr);
|
||||
|
||||
return i1;
|
|
@ -1,18 +0,0 @@
|
|||
2005-02-01 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* dwarf2read.c (die_type): Tolerate a type reference to location
|
||||
<0> and treat as unknown type.
|
||||
|
||||
--- gdb-6.3/gdb/dwarf2read.c.fix Tue Feb 1 16:48:49 2005
|
||||
+++ gdb-6.3/gdb/dwarf2read.c Tue Feb 1 16:50:12 2005
|
||||
@@ -7120,6 +7120,10 @@ die_type (struct die_info *die, struct d
|
||||
/* A missing DW_AT_type represents a void type. */
|
||||
return dwarf2_fundamental_type (cu->objfile, FT_VOID, cu);
|
||||
}
|
||||
+ else if (DW_ADDR (type_attr) == 0)
|
||||
+ /* If we have an invalid reference to 0, ignore it and treat
|
||||
+ the type as unknown. */
|
||||
+ return builtin_type_error;
|
||||
else
|
||||
type_die = follow_die_ref (die, type_attr, cu);
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-focus-cmd-prev-test.patch
|
||||
|
||||
;; Test a crash on `focus cmd', `focus prev' commands.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/focus-cmd-prev.exp b/gdb/testsuite/gdb.base/focus-cmd-prev.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/focus-cmd-prev.exp
|
||||
@@ -0,0 +1,40 @@
|
||||
+# Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+
|
||||
+# Do not use gdb_test or \r\n there since:
|
||||
+# commit d7e747318f4d04af033f16325f9b6d74f67079ec
|
||||
+# Eliminate make_cleanup_ui_file_delete / make ui_file a class hierarchy
|
||||
+
|
||||
+set test "focus cmd"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set test "focus prev"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
|
@ -1,31 +0,0 @@
|
|||
2004-09-27 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* frame.c (get_prev_frame): Stop backtrace when a zero PC and
|
||||
successive normal frames.
|
||||
|
||||
Index: ./gdb/frame.c
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/gdb/frame.c,v
|
||||
retrieving revision 1.191
|
||||
diff -p -u -r1.191 frame.c
|
||||
--- ./gdb/frame.c 1 Sep 2004 14:13:33 -0000 1.191
|
||||
+++ ./gdb/frame.c 28 Sep 2004 02:45:58 -0000
|
||||
@@ -1235,6 +1235,18 @@ get_prev_frame (struct frame_info *this_
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+ if (this_frame->level > 0
|
||||
+#if 0
|
||||
+ && backtrace_past_zero_pc
|
||||
+#endif
|
||||
+ && get_frame_type (this_frame) == NORMAL_FRAME
|
||||
+ && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
|
||||
+ && get_frame_pc (this_frame) == 0)
|
||||
+ {
|
||||
+ frame_debug_got_null_frame (gdb_stdlog, this_frame, "zero PC");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
return get_prev_frame_1 (this_frame);
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
2005-02-07 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* linux-nat.c (linux_nat_xfer_memory): Don't use
|
||||
linux_proc_xfer_memory for ia64.
|
||||
|
||||
Index: gdb-6.5/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 00:57:56.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 02:24:51.000000000 -0300
|
||||
@@ -3152,10 +3152,15 @@ linux_xfer_partial (struct target_ops *o
|
||||
return procfs_xfer_auxv (ops, object, annex, readbuf, writebuf,
|
||||
offset, len);
|
||||
|
||||
+#ifndef NATIVE_XFER_UNWIND_TABLE
|
||||
+ /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory
|
||||
+ for accessing thread storage. Revert when Bugzilla 147436
|
||||
+ is fixed. */
|
||||
xfer = linux_proc_xfer_partial (ops, object, annex, readbuf, writebuf,
|
||||
offset, len);
|
||||
if (xfer != 0)
|
||||
return xfer;
|
||||
+#endif
|
||||
|
||||
return super_xfer_partial (ops, object, annex, readbuf, writebuf,
|
||||
offset, len);
|
|
@ -1,25 +1,35 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Cagney <cagney@gnu.org>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-gstack-20050411.patch
|
||||
|
||||
;; Add a wrapper script to GDB that implements pstack using the
|
||||
;; --readnever option.
|
||||
;;=push
|
||||
|
||||
2004-11-23 Andrew Cagney <cagney@redhat.com>
|
||||
|
||||
* Makefile.in (uninstall-gstack, install-gstack): New rules, add
|
||||
to install and uninstall.
|
||||
* gstack.sh, gstack.1: New files.
|
||||
|
||||
diff -uN -r ../orig/gdb/Makefile.in ./gdb/Makefile.in
|
||||
--- ../orig/gdb/Makefile.in 2004-11-23 13:31:03.000000000 -0500
|
||||
+++ ./gdb/Makefile.in 2004-11-23 15:06:34.623389592 -0500
|
||||
@@ -970,7 +970,7 @@
|
||||
# time it takes for make to check that all is up to date.
|
||||
# install-only is intended to address that need.
|
||||
install: all install-only
|
||||
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
|
||||
--- a/gdb/Makefile.in
|
||||
+++ b/gdb/Makefile.in
|
||||
@@ -1726,7 +1726,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
|
||||
install: all
|
||||
@$(MAKE) $(FLAGS_TO_PASS) install-only
|
||||
|
||||
-install-only: $(CONFIG_INSTALL)
|
||||
+install-only: install-gstack $(CONFIG_INSTALL)
|
||||
transformed_name=`t='$(program_transform_name)'; \
|
||||
echo gdb | sed -e "$$t"` ; \
|
||||
if test "x$$transformed_name" = x; then \
|
||||
@@ -1002,9 +1002,26 @@
|
||||
$(DESTDIR)$(man1dir) ; \
|
||||
$(INSTALL_DATA) $(srcdir)/gdb.1 \
|
||||
$(DESTDIR)$(man1dir)/$$transformed_name.1
|
||||
@@ -1775,7 +1775,25 @@ install-guile:
|
||||
install-python:
|
||||
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
|
||||
|
||||
-uninstall: force $(CONFIG_UNINSTALL)
|
||||
+GSTACK=gstack
|
||||
+.PHONY: install-gstack
|
||||
+install-gstack:
|
||||
|
@ -37,17 +47,15 @@ diff -uN -r ../orig/gdb/Makefile.in ./gdb/Makefile.in
|
|||
+ $(DESTDIR)$(man1dir) ; \
|
||||
+ : $(INSTALL_DATA) $(srcdir)/gstack.1 \
|
||||
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
|
||||
|
||||
|
||||
-uninstall: force $(CONFIG_UNINSTALL)
|
||||
+
|
||||
+uninstall: force uninstall-gstack $(CONFIG_UNINSTALL)
|
||||
transformed_name=`t='$(program_transform_name)'; \
|
||||
echo gdb | sed -e $$t` ; \
|
||||
if test "x$$transformed_name" = x; then \
|
||||
@@ -1026,6 +1043,17 @@
|
||||
fi ; \
|
||||
rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
|
||||
$(DESTDIR)$(man1dir)/$$transformed_name.1
|
||||
@@ -1798,6 +1816,18 @@ uninstall: force $(CONFIG_UNINSTALL)
|
||||
fi
|
||||
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
||||
|
||||
+.PHONY: uninstall-gstack
|
||||
+uninstall-gstack:
|
||||
+ transformed_name=`t='$(program_transform_name)'; \
|
||||
|
@ -59,12 +67,15 @@ diff -uN -r ../orig/gdb/Makefile.in ./gdb/Makefile.in
|
|||
+ fi ; \
|
||||
+ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
|
||||
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
|
||||
|
||||
# We do this by grepping through sources. If that turns out to be too slow,
|
||||
# maybe we could just require every .o file to have an initialization routine
|
||||
--- /dev/null 2005-04-09 23:51:05.027867440 -0400
|
||||
+++ ./gdb/gstack.sh 2005-04-08 18:00:49.000000000 -0400
|
||||
@@ -0,0 +1,45 @@
|
||||
+
|
||||
# The C++ name parser can be built standalone for testing.
|
||||
test-cp-name-parser.o: cp-name-parser.c
|
||||
$(COMPILE) -DTEST_CPNAMES cp-name-parser.c
|
||||
diff --git a/gdb/gstack.sh b/gdb/gstack.sh
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/gstack.sh
|
||||
@@ -0,0 +1,43 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+if test $# -ne 1; then
|
||||
|
@ -84,29 +95,164 @@ diff -uN -r ../orig/gdb/Makefile.in ./gdb/Makefile.in
|
|||
+backtrace="bt"
|
||||
+if test -d /proc/$1/task ; then
|
||||
+ # Newer kernel; has a task/ directory.
|
||||
+ if test `ls /proc/$1/task | wc -l` -gt 1 2>/dev/null ; then
|
||||
+ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
|
||||
+ backtrace="thread apply all bt"
|
||||
+ fi
|
||||
+elif test -f /proc/$1/maps ; then
|
||||
+ # Older kernel; go by it loading libpthread.
|
||||
+ if grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
||||
+ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
||||
+ backtrace="thread apply all bt"
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+GDB=${GDB:-gdb}
|
||||
+
|
||||
+if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
|
||||
+ readnever=--readnever
|
||||
+else
|
||||
+ readnever=
|
||||
+fi
|
||||
+
|
||||
+# Run GDB, strip out unwanted noise.
|
||||
+$GDB --quiet $readnever -nx /proc/$1/exe $1 <<EOF 2>&1 |
|
||||
+# --readnever is no longer used since .gdb_index is now in use.
|
||||
+$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 |
|
||||
+set width 0
|
||||
+set height 0
|
||||
+set pagination no
|
||||
+$backtrace
|
||||
+EOF
|
||||
+sed -n \
|
||||
+ -e 's/^(gdb) //' \
|
||||
+/bin/sed -n \
|
||||
+ -e 's/^\((gdb) \)*//' \
|
||||
+ -e '/^#/p' \
|
||||
+ -e '/^Thread/p'
|
||||
diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gstack.c
|
||||
@@ -0,0 +1,43 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+void
|
||||
+func (void)
|
||||
+{
|
||||
+ const char msg[] = "looping\n";
|
||||
+
|
||||
+ /* Use the most simple notification not to get caught by attach on exiting
|
||||
+ the function. */
|
||||
+ write (1, msg, strlen (msg));
|
||||
+
|
||||
+ for (;;);
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ alarm (60);
|
||||
+ nice (100);
|
||||
+
|
||||
+ func ();
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gstack.exp
|
||||
@@ -0,0 +1,84 @@
|
||||
+# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+set testfile gstack
|
||||
+set executable ${testfile}
|
||||
+set binfile [standard_output_file $executable]
|
||||
+if {[build_executable ${testfile} ${executable} "" {debug}] == -1} {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set test "spawn inferior"
|
||||
+set command "${binfile}"
|
||||
+set res [remote_spawn host $command];
|
||||
+if { $res < 0 || $res == "" } {
|
||||
+ perror "Spawning $command failed."
|
||||
+ fail $test
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# The spawn id of the test inferior.
|
||||
+set test_spawn_id $res
|
||||
+
|
||||
+set use_gdb_stub 1
|
||||
+set pid [exp_pid -i $res]
|
||||
+gdb_expect {
|
||||
+ -re "looping\r\n" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ eof {
|
||||
+ fail "$test (eof)"
|
||||
+ return
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "$test (timeout)"
|
||||
+ return
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Testcase uses the most simple notification not to get caught by attach on
|
||||
+# exiting the function. Still we could retry the gstack command if we fail.
|
||||
+
|
||||
+set test "spawn gstack"
|
||||
+set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END"
|
||||
+set res [remote_spawn host $command];
|
||||
+if { $res < 0 || $res == "" } {
|
||||
+ perror "Spawning $command failed."
|
||||
+ fail $test
|
||||
+}
|
||||
+
|
||||
+set gdb_spawn_id $res
|
||||
+
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "^#0 +(0x\[0-9a-f\]+ in )?\\.?func \\(\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in \\.?main \\(\\) at \[^\r\n\]*\r\nGSTACK-END\r\n\$" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test_multiple "" "gstack exits" {
|
||||
+ eof {
|
||||
+ set result [wait -i $gdb_spawn_id]
|
||||
+ verbose $result
|
||||
+
|
||||
+ gdb_assert { [lindex $result 2] == 0 } "gstack exits with no error"
|
||||
+ gdb_assert { [lindex $result 3] == 0 } "gstack's exit status is 0"
|
||||
+
|
||||
+ remote_close host
|
||||
+ clear_gdb_spawn_id
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Kill the test inferior.
|
||||
+kill_wait_spawned_process $test_spawn_id
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
Index: gdb-6.3/gdb/gstack.sh
|
||||
===================================================================
|
||||
--- gdb-6.3.orig/gdb/gstack.sh 2006-02-14 17:21:05.000000000 -0200
|
||||
+++ gdb-6.3/gdb/gstack.sh 2006-04-14 03:17:12.000000000 -0300
|
||||
@@ -17,17 +17,17 @@ fi
|
||||
backtrace="bt"
|
||||
if test -d /proc/$1/task ; then
|
||||
# Newer kernel; has a task/ directory.
|
||||
- if test `ls /proc/$1/task | wc -l` -gt 1 2>/dev/null ; then
|
||||
+ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
|
||||
backtrace="thread apply all bt"
|
||||
fi
|
||||
elif test -f /proc/$1/maps ; then
|
||||
# Older kernel; go by it loading libpthread.
|
||||
- if grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
||||
+ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
||||
backtrace="thread apply all bt"
|
||||
fi
|
||||
fi
|
||||
|
||||
-GDB=${GDB:-gdb}
|
||||
+GDB=${GDB:-/usr/bin/gdb}
|
||||
|
||||
if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
|
||||
readnever=--readnever
|
||||
@@ -39,7 +39,7 @@ fi
|
||||
$GDB --quiet $readnever -nx /proc/$1/exe $1 <<EOF 2>&1 |
|
||||
$backtrace
|
||||
EOF
|
||||
-sed -n \
|
||||
+/bin/sed -n \
|
||||
-e 's/^(gdb) //' \
|
||||
-e '/^#/p' \
|
||||
-e '/^Thread/p'
|
|
@ -1,33 +0,0 @@
|
|||
Index: gdb-6.3/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.3.orig/gdb/linux-nat.c 2006-06-15 07:27:02.000000000 -0300
|
||||
+++ gdb-6.3/gdb/linux-nat.c 2006-06-15 07:27:06.000000000 -0300
|
||||
@@ -157,12 +157,28 @@ static int
|
||||
my_waitpid (int pid, int *status, int flags)
|
||||
{
|
||||
int ret;
|
||||
+ int old_status = status ? *status : 0;
|
||||
+
|
||||
do
|
||||
{
|
||||
ret = waitpid (pid, status, flags);
|
||||
}
|
||||
while (ret == -1 && errno == EINTR);
|
||||
|
||||
+ if (ret == 0 && status != 0)
|
||||
+ {
|
||||
+ /* waitpid() running within ia32el (on multi-threaded processes
|
||||
+ only?) modifies status even when it returns zero, and this
|
||||
+ breaks the assumption in linux_nat_wait(), and perhaps
|
||||
+ elsewhere, that it remains unchanged in this case. We
|
||||
+ restore the old value before returning zero, such that the
|
||||
+ assumption holds. */
|
||||
+ if (*status != 0 && *status != old_status)
|
||||
+ warning ("waitpid: non-zero status %x for zero return value",
|
||||
+ *status);
|
||||
+ *status = old_status;
|
||||
+ }
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
2005-01-25 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* ia64-tdep.c (getunwind_table): Call the low-level xfer
|
||||
unwind table syscall to support backtracing from syscalls in
|
||||
a corefile.
|
||||
|
||||
Index: gdb-6.5/gdb/ia64-tdep.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/ia64-tdep.c 2006-04-18 16:20:06.000000000 -0300
|
||||
+++ gdb-6.5/gdb/ia64-tdep.c 2006-07-07 02:18:40.000000000 -0300
|
||||
@@ -2470,8 +2470,17 @@ getunwind_table (void *buf, size_t len)
|
||||
we want to preserve fall back to the running kernel's table, then
|
||||
we should find a way to override the corefile layer's
|
||||
xfer_partial method. */
|
||||
+#if 0
|
||||
x = target_read_partial (¤t_target, TARGET_OBJECT_UNWIND_TABLE, NULL,
|
||||
buf, 0, len);
|
||||
+#endif
|
||||
+ /* FIXME: This is a temporary solution to backtracing syscalls in corefiles.
|
||||
+ To do this properly, the AUXV section should be used. This
|
||||
+ fix will work as long as the kernel used to generate the corefile
|
||||
+ is equivalent to the kernel used to debug the corefile. */
|
||||
+ x = ia64_linux_xfer_unwind_table (¤t_target,
|
||||
+ TARGET_OBJECT_UNWIND_TABLE, NULL,
|
||||
+ buf, NULL, 0, len);
|
||||
|
||||
return (int)x;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
Index: gdb-6.5/gdb/gcore.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/gcore.c 2005-12-17 20:33:59.000000000 -0200
|
||||
+++ gdb-6.5/gdb/gcore.c 2006-07-07 02:41:33.000000000 -0300
|
||||
@@ -462,8 +462,13 @@ gcore_copy_callback (bfd *obfd, asection
|
||||
error (_("Not enough memory to create corefile."));
|
||||
old_chain = make_cleanup (xfree, memhunk);
|
||||
|
||||
+ /* Warn if read error occurs except if we were trying to read the
|
||||
+ first page for ia64. The first page is marked readable, but it cannot
|
||||
+ be read. */
|
||||
if (target_read_memory (bfd_section_vma (obfd, osec),
|
||||
- memhunk, size) != 0)
|
||||
+ memhunk, size) != 0
|
||||
+ && (strcmp (TARGET_ARCHITECTURE->arch_name, "ia64")
|
||||
+ || bfd_section_vma (obfd, osec) != 0))
|
||||
warning (_("Memory read failed for corefile section, %s bytes at 0x%s."),
|
||||
paddr_d (size), paddr (bfd_section_vma (obfd, osec)));
|
||||
if (!bfd_set_section_contents (obfd, osec, memhunk, 0, size))
|
|
@ -1,133 +0,0 @@
|
|||
2005-07-14 Jeff Johnsotn <jjohnstn@redhat.com>
|
||||
|
||||
* linux-nat.c (linux_nat_xfer_memory): Incorporate Fujitsu
|
||||
work-around to use /proc/mem for storage, but to fall-back
|
||||
to PTRACE for ia64 rse register areas.
|
||||
* ia64-linux-nat.c (ia64_rse_slot_num): New static function.
|
||||
(ia64_rse_skip_regs): Ditto.
|
||||
(ia64_linux_check_stack_region): New function.
|
||||
|
||||
Index: gdb-6.5/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 02:29:12.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 03:03:55.000000000 -0300
|
||||
@@ -2473,7 +2473,9 @@ linux_nat_xfer_partial (struct target_op
|
||||
do_cleanups (old_chain);
|
||||
return xfer;
|
||||
}
|
||||
-
|
||||
+#ifdef NATIVE_XFER_UNWIND_TABLE
|
||||
+extern int ia64_linux_check_stack_region(struct lwp_info *lwp, void *range);
|
||||
+#endif
|
||||
static int
|
||||
linux_nat_thread_alive (ptid_t ptid)
|
||||
{
|
||||
@@ -3214,15 +3216,34 @@ linux_xfer_partial (struct target_ops *o
|
||||
return procfs_xfer_auxv (ops, object, annex, readbuf, writebuf,
|
||||
offset, len);
|
||||
|
||||
-#ifndef NATIVE_XFER_UNWIND_TABLE
|
||||
- /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory
|
||||
- for accessing thread storage. Revert when Bugzilla 147436
|
||||
- is fixed. */
|
||||
xfer = linux_proc_xfer_partial (ops, object, annex, readbuf, writebuf,
|
||||
offset, len);
|
||||
if (xfer != 0)
|
||||
- return xfer;
|
||||
+ {
|
||||
+#ifdef NATIVE_XFER_UNWIND_TABLE
|
||||
+ struct mem_region range;
|
||||
+ range.lo = memaddr;
|
||||
+ range.hi = memaddr + len;
|
||||
+
|
||||
+ /* FIXME: For ia64, we cannot currently use
|
||||
+ linux_proc_xfer_partial for accessing rse register storage.
|
||||
+ Revert when Bugzilla 147436 is fixed. */
|
||||
+ if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
|
||||
+ { /* This region contains ia64 rse registers, we have to re-read. */
|
||||
+ int xxfer;
|
||||
+
|
||||
+ /* Re-read register stack area. */
|
||||
+ xxfer = super_xfer_partial (ops, object, annex,
|
||||
+ readbuf + (range.lo - memaddr),
|
||||
+ writebuf + (range.lo - memaddr),
|
||||
+ offset + (range.lo - memaddr),
|
||||
+ range.hi - range.lo);
|
||||
+ if (xxfer == 0)
|
||||
+ xfer = 0;
|
||||
+ }
|
||||
#endif
|
||||
+ return xfer;
|
||||
+ }
|
||||
|
||||
return super_xfer_partial (ops, object, annex, readbuf, writebuf,
|
||||
offset, len);
|
||||
Index: gdb-6.5/gdb/ia64-linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/ia64-linux-nat.c 2006-03-24 20:08:16.000000000 -0300
|
||||
+++ gdb-6.5/gdb/ia64-linux-nat.c 2006-07-07 02:52:25.000000000 -0300
|
||||
@@ -687,6 +687,64 @@ ia64_linux_xfer_partial (struct target_o
|
||||
|
||||
void _initialize_ia64_linux_nat (void);
|
||||
|
||||
+/*
|
||||
+ * Note: taken from ia64_tdep.c
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+static __inline__ unsigned long
|
||||
+ia64_rse_slot_num (unsigned long addr)
|
||||
+{
|
||||
+ return (addr >> 3) & 0x3f;
|
||||
+}
|
||||
+
|
||||
+/* Skip over a designated number of registers in the backing
|
||||
+ store, remembering every 64th position is for NAT. */
|
||||
+static __inline__ unsigned long
|
||||
+ia64_rse_skip_regs (unsigned long addr, long num_regs)
|
||||
+{
|
||||
+ long delta = ia64_rse_slot_num(addr) + num_regs;
|
||||
+
|
||||
+ if (num_regs < 0)
|
||||
+ delta -= 0x3e;
|
||||
+ return addr + ((num_regs + delta/0x3f) << 3);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Check mem_region is stack or not. If stack, /proc/<pid>/mem cannot return
|
||||
+ * expected value.
|
||||
+ */
|
||||
+int ia64_linux_check_stack_region(struct lwp_info *ti, struct mem_region *range)
|
||||
+{
|
||||
+ CORE_ADDR addr;
|
||||
+ int error;
|
||||
+ unsigned long bsp, cfm, bspstore;
|
||||
+ long sof;
|
||||
+ pid_t pid = ptid_get_lwp(ti->ptid);
|
||||
+ bsp = ptrace(PTRACE_PEEKUSER, pid, PT_AR_BSP ,NULL);
|
||||
+ if (bsp == (unsigned long)-1) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ /* stack is allocated by one-segment, not separated into several segments.
|
||||
+ So, we only have to check whether bsp is in *range* or not. */
|
||||
+ if((range->lo <= bsp) && (bsp <= range->hi)) {
|
||||
+ bspstore = ptrace(PTRACE_PEEKUSER, pid, PT_AR_BSPSTORE, NULL);
|
||||
+ cfm = ptrace(PTRACE_PEEKUSER, pid, PT_CFM, NULL);
|
||||
+ sof = cfm & 0x3f;
|
||||
+ bsp = ia64_rse_skip_regs(bsp, -sof);
|
||||
+ range->lo = bspstore;
|
||||
+ range->hi = bsp;
|
||||
+ /* we have to check the size of dirty register stack area */
|
||||
+ /*
|
||||
+ fprintf_unfiltered(gdb_stdlog, "<%d> <%p> <%lx> <%p> <%p>\n",
|
||||
+ pid, bsp, sof, range->lo, range->hi);
|
||||
+ */
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
void
|
||||
_initialize_ia64_linux_nat (void)
|
||||
{
|
|
@ -1,120 +0,0 @@
|
|||
2005-07-25 Jeff Johnstno <jjohnstn@redhat.com>
|
||||
|
||||
* libunwind-frame.c (libunwind_frame_prev_register): Check valuep
|
||||
is not NULL before copying cursor address into it.
|
||||
|
||||
testsuite:
|
||||
2005-07-25 Jeff Johnstno <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.arch/ia64-sigtramp.exp: New test.
|
||||
* gdb.arch/ia64-sigtramp.c: Ditto.
|
||||
|
||||
--- gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.c.fix 2005-07-25 16:42:46.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.c 2005-07-25 16:42:08.000000000 -0400
|
||||
@@ -0,0 +1,23 @@
|
||||
+#include <stdio.h>
|
||||
+#include <signal.h>
|
||||
+
|
||||
+int *l;
|
||||
+
|
||||
+void x (int sig)
|
||||
+{
|
||||
+ printf ("in signal handler for signal %d\n", sig);
|
||||
+}
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ int k;
|
||||
+
|
||||
+ signal (SIGSEGV, &x);
|
||||
+
|
||||
+ k = *l;
|
||||
+
|
||||
+ printf ("k is %d\n", k);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
--- gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.exp.fix 2005-07-25 16:42:50.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.exp 2005-07-25 16:42:01.000000000 -0400
|
||||
@@ -0,0 +1,66 @@
|
||||
+# Copyright 2005 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+# This file was written by Jeff Johnston (jjohnstn@redhat.com)
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+#
|
||||
+# test running programs
|
||||
+#
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+if ![istarget "ia64-*-*"] then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "ia64-sigtramp"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+if ![runto_main] then {
|
||||
+ fail "Can't run to main"
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+gdb_test "handle SIGSEGV" "SIGSEGV.*Yes.*Yes.*Yes.*Segmentation fault"
|
||||
+gdb_test "next" "" "first next"
|
||||
+gdb_test "next" "Program received signal SIGSEGV.*" "getting SIGSEGV"
|
||||
+gdb_breakpoint "x"
|
||||
+gdb_test "continue" "Breakpoint.*x.*" "continue to x"
|
||||
+
|
||||
+gdb_test "f 1" ".*signal handler called.*" "frame 1"
|
||||
+gdb_test "info frame" "Stack level 1.*p63 at .*" "info sigtramp frame"
|
||||
+
|
||||
--- gdb-6.3/gdb/libunwind-frame.c.fix 2005-07-25 16:41:30.000000000 -0400
|
||||
+++ gdb-6.3/gdb/libunwind-frame.c 2005-07-25 16:46:23.000000000 -0400
|
||||
@@ -303,8 +303,9 @@ libunwind_frame_prev_register (struct fr
|
||||
modification to support unwinding through a sigaltstack. */
|
||||
if (uw_regnum == INT_MAX)
|
||||
{
|
||||
- store_unsigned_integer (valuep, sizeof (CORE_ADDR),
|
||||
- (CORE_ADDR)&cache->cursor);
|
||||
+ if (valuep)
|
||||
+ store_unsigned_integer (valuep, sizeof (CORE_ADDR),
|
||||
+ (CORE_ADDR)&cache->cursor);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1,193 +0,0 @@
|
|||
2005-07-11 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* ia64-tdep.c (pseudo_regs): Add CURSOR_ADDR_REGNUM.
|
||||
(ia64_register_names): Add empty string for CURSOR_ADDR_REGNUM.
|
||||
(ia64_frame_prev_register): Default a request for CURSOR_ADDR_REGNUM
|
||||
to return 0.
|
||||
(ia64_sigtramp_frame_prev_register): Ditto.
|
||||
(ia64_gdb2uw_regnum): Map CURSOR_ADDR_REGNUM to INT_MAX so
|
||||
it won't clash with any legitimate UNW register number.
|
||||
(ia64_unwind_cursor): New callback.
|
||||
(ia64_libunwind_descr): Add new ia64_unwind_cursor callback.
|
||||
* libunwind-frame.h (struct libunwind_descr): Add new slot
|
||||
for unwind cursor callback.
|
||||
* libunwind-frame.c (libunwind_frame_cache): Attempt to copy
|
||||
and step previous cursor if possible, otherwise, create new
|
||||
cursor.
|
||||
(libunwind_frame_prev_register): Support request for
|
||||
getting the cursor address.
|
||||
|
||||
--- gdb-6.3/gdb/ia64-tdep.c.fix 2005-07-11 18:13:42.000000000 -0400
|
||||
+++ gdb-6.3/gdb/ia64-tdep.c 2005-07-11 18:15:52.000000000 -0400
|
||||
@@ -141,7 +141,7 @@ static int lr_regnum = IA64_VRAP_REGNUM;
|
||||
they may not be accessible via the ptrace register get/set interfaces. */
|
||||
enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM,
|
||||
V127_REGNUM = V32_REGNUM + 95,
|
||||
- VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16, VP63_REGNUM = VP0_REGNUM + 63, LAST_PSEUDO_REGNUM };
|
||||
+ VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16, VP63_REGNUM = VP0_REGNUM + 63, CURSOR_ADDR_REGNUM, LAST_PSEUDO_REGNUM };
|
||||
|
||||
/* Array of register names; There should be ia64_num_regs strings in
|
||||
the initializer. */
|
||||
@@ -253,6 +253,7 @@ static char *ia64_register_names[] =
|
||||
"p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47",
|
||||
"p48", "p49", "p50", "p51", "p52", "p53", "p54", "p55",
|
||||
"p56", "p57", "p58", "p59", "p60", "p61", "p62", "p63",
|
||||
+ ""
|
||||
};
|
||||
|
||||
struct ia64_frame_cache
|
||||
@@ -1855,6 +1856,12 @@ ia64_frame_prev_register (struct frame_i
|
||||
read_memory (addr, valuep, register_size (current_gdbarch, regnum));
|
||||
}
|
||||
}
|
||||
+ else if (regnum == CURSOR_ADDR_REGNUM)
|
||||
+ {
|
||||
+ /* The cursor is the address of the ia64 libunwind cursor.
|
||||
+ Default to 0. */
|
||||
+ *lvalp = lval_memory;
|
||||
+ }
|
||||
else
|
||||
{
|
||||
CORE_ADDR addr = 0;
|
||||
@@ -2177,6 +2184,12 @@ ia64_sigtramp_frame_prev_register (struc
|
||||
*addrp = pr_addr;
|
||||
}
|
||||
}
|
||||
+ else if (regnum == CURSOR_ADDR_REGNUM)
|
||||
+ {
|
||||
+ /* The cursor is the address of the ia64 libunwind cursor.
|
||||
+ Default to 0. */
|
||||
+ *lvalp = lval_memory;
|
||||
+ }
|
||||
else
|
||||
{
|
||||
/* All other registers not listed above. */
|
||||
@@ -2296,6 +2309,8 @@ ia64_gdb2uw_regnum (int regnum)
|
||||
return UNW_IA64_AR + (regnum - IA64_AR0_REGNUM);
|
||||
else if ((unsigned) (regnum - IA64_NAT0_REGNUM) < 128)
|
||||
return UNW_IA64_NAT + (regnum - IA64_NAT0_REGNUM);
|
||||
+ else if (regnum == CURSOR_ADDR_REGNUM)
|
||||
+ return INT_MAX;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
@@ -2331,6 +2346,21 @@ ia64_uw2gdb_regnum (int uw_regnum)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+/* Special callback function to allow libunwind-frame to get
|
||||
+ the address of the next frame's cursor so it may be copied and
|
||||
+ stepped. */
|
||||
+static unw_cursor_t *
|
||||
+ia64_unwind_cursor (struct frame_info *next_frame)
|
||||
+{
|
||||
+ unw_cursor_t *cursor_addr;
|
||||
+ char buf[8];
|
||||
+
|
||||
+ frame_unwind_register (next_frame, CURSOR_ADDR_REGNUM, buf);
|
||||
+ cursor_addr = (unw_cursor_t *)extract_unsigned_integer (buf, 8);
|
||||
+
|
||||
+ return cursor_addr;
|
||||
+}
|
||||
+
|
||||
/* Gdb libunwind-frame callback function to reveal if register is a float
|
||||
register or not. */
|
||||
static int
|
||||
@@ -3111,6 +3141,7 @@ static struct libunwind_descr ia64_libun
|
||||
ia64_gdb2uw_regnum,
|
||||
ia64_uw2gdb_regnum,
|
||||
ia64_is_fpreg,
|
||||
+ ia64_unwind_cursor,
|
||||
&ia64_unw_accessors,
|
||||
&ia64_unw_rse_accessors,
|
||||
};
|
||||
--- gdb-6.3/gdb/libunwind-frame.c.fix 2005-07-11 18:17:05.000000000 -0400
|
||||
+++ gdb-6.3/gdb/libunwind-frame.c 2005-07-11 18:20:31.000000000 -0400
|
||||
@@ -122,6 +122,7 @@ libunwind_frame_set_descr (struct gdbarc
|
||||
arch_descr->is_fpreg = descr->is_fpreg;
|
||||
arch_descr->accessors = descr->accessors;
|
||||
arch_descr->special_accessors = descr->special_accessors;
|
||||
+ arch_descr->unwind_cursor = descr->unwind_cursor;
|
||||
}
|
||||
|
||||
static struct libunwind_frame_cache *
|
||||
@@ -129,6 +130,7 @@ libunwind_frame_cache (struct frame_info
|
||||
{
|
||||
unw_accessors_t *acc;
|
||||
unw_addr_space_t as;
|
||||
+ unw_cursor_t *cursor_addr;
|
||||
unw_word_t fp;
|
||||
unw_regnum_t uw_sp_regnum;
|
||||
struct libunwind_frame_cache *cache;
|
||||
@@ -147,22 +149,33 @@ libunwind_frame_cache (struct frame_info
|
||||
&& get_frame_type (next_frame) != SIGTRAMP_FRAME)
|
||||
return NULL;
|
||||
|
||||
- /* Get a libunwind cursor to the previous frame. We do this by initializing
|
||||
- a cursor. Libunwind treats a new cursor as the top of stack and will get
|
||||
- the current register set via the libunwind register accessor. Now, we
|
||||
- provide the platform-specific accessors and we set up the register accessor to use
|
||||
- the frame register unwinding interfaces so that we properly get the registers for
|
||||
- the current frame rather than the top. We then use the unw_step function to
|
||||
- move the libunwind cursor back one frame. We can later use this cursor to find previous
|
||||
- registers via the unw_get_reg interface which will invoke libunwind's special logic. */
|
||||
+ /* Get a libunwind cursor to the previous frame. We do this by getting
|
||||
+ the address of the next frame's cursor (if one exists). If we are at
|
||||
+ the top of stack, then we will get back a zero cursor address and we
|
||||
+ should initialize a new cursor.
|
||||
+
|
||||
+ Otherwise, we copy the cursor address contents and step back by one.
|
||||
+ Libunwind will use our register accessors which are set up to
|
||||
+ unwind registers from the previous frame. We will later use this cursor
|
||||
+ to find previous registers via the unw_get_reg interface. By passing
|
||||
+ back a cursor, we allow libunwind to handle sigaltstack which requires
|
||||
+ one cursor stepped back for all frames. */
|
||||
descr = libunwind_descr (get_frame_arch (next_frame));
|
||||
- acc = descr->accessors;
|
||||
- as = unw_create_addr_space_p (acc,
|
||||
+ cursor_addr = descr->unwind_cursor (next_frame);
|
||||
+
|
||||
+ if (cursor_addr == 0)
|
||||
+ {
|
||||
+ acc = descr->accessors;
|
||||
+ as = unw_create_addr_space_p (acc,
|
||||
TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
|
||||
? __BIG_ENDIAN
|
||||
: __LITTLE_ENDIAN);
|
||||
|
||||
- unw_init_remote_p (&cache->cursor, as, next_frame);
|
||||
+ unw_init_remote_p (&cache->cursor, as, next_frame);
|
||||
+ }
|
||||
+ else /* make copy */
|
||||
+ cache->cursor = *cursor_addr;
|
||||
+
|
||||
if (unw_step_p (&cache->cursor) < 0)
|
||||
return NULL;
|
||||
|
||||
@@ -285,6 +298,16 @@ libunwind_frame_prev_register (struct fr
|
||||
if (uw_regnum < 0)
|
||||
return;
|
||||
|
||||
+ /* Check if we are unwinding the cursor address which just gives
|
||||
+ back the address of the next frame's cursor. This is a special
|
||||
+ modification to support unwinding through a sigaltstack. */
|
||||
+ if (uw_regnum == INT_MAX)
|
||||
+ {
|
||||
+ store_unsigned_integer (valuep, sizeof (CORE_ADDR),
|
||||
+ (CORE_ADDR)&cache->cursor);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* To get the previous register, we use the libunwind register APIs with
|
||||
the cursor we have already pushed back to the previous frame. */
|
||||
|
||||
--- gdb-6.3/gdb/libunwind-frame.h.fix 2005-07-11 18:17:24.000000000 -0400
|
||||
+++ gdb-6.3/gdb/libunwind-frame.h 2005-07-11 18:18:46.000000000 -0400
|
||||
@@ -37,6 +37,7 @@ struct libunwind_descr
|
||||
int (*gdb2uw) (int);
|
||||
int (*uw2gdb) (int);
|
||||
int (*is_fpreg) (int);
|
||||
+ unw_cursor_t *(*unwind_cursor) (struct frame_info *next_frame);
|
||||
void *accessors;
|
||||
void *special_accessors;
|
||||
};
|
|
@ -1,130 +0,0 @@
|
|||
2005-11-15 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* linux-thread-db.c (thread_db_wait): Don't bother continuing if
|
||||
the wait result indicates the program terminated with a signal.
|
||||
* linux-nat.c (linux_nat_wait): For SIGILL and SIGTRAP, don't
|
||||
throw away the event if the user has specified nostop noprint.
|
||||
|
||||
gdb/testsuite:
|
||||
|
||||
2005-11-15 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.arch/ia64-sigill.c: New test.
|
||||
* gdb.arch/ia64-sigill.exp: Ditto.
|
||||
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.arch/ia64-sigill.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.arch/ia64-sigill.exp 2006-07-07 03:16:54.000000000 -0300
|
||||
@@ -0,0 +1,59 @@
|
||||
+# Copyright 2005 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+# This file was written by Jeff Johnston (jjohnstn@redhat.com)
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+#
|
||||
+# test running programs
|
||||
+#
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+if ![istarget "ia64-*-*"] then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "ia64-sigill"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+
|
||||
+# Deliberately compile with pthreads, even though test is single-threaded.
|
||||
+# We want to force gdb thread code to be exercised.
|
||||
+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+# We set up SIGILL nostop, noprint, pass and then run the program.
|
||||
+# We expect to just see a normal run.
|
||||
+gdb_test "handle SIGILL nostop noprint" "SIGILL.*No.*No.*Yes.*" "handle sigill"
|
||||
+gdb_test "run" "Starting program.*ia64-sigill.*\[New thread.*\].*hello world.*Program exited normally." "run to exit"
|
||||
+
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.arch/ia64-sigill.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.arch/ia64-sigill.c 2006-07-07 03:16:54.000000000 -0300
|
||||
@@ -0,0 +1,8 @@
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ printf ("hello world\n");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
Index: gdb-6.5/gdb/linux-thread-db.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linux-thread-db.c 2006-07-07 01:06:36.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linux-thread-db.c 2006-07-07 03:16:54.000000000 -0300
|
||||
@@ -926,7 +926,8 @@ thread_db_wait (ptid_t ptid, struct targ
|
||||
post-processing and bail out early. */
|
||||
return ptid;
|
||||
|
||||
- if (ourstatus->kind == TARGET_WAITKIND_EXITED)
|
||||
+ if (ourstatus->kind == TARGET_WAITKIND_EXITED
|
||||
+ || ourstatus->kind == TARGET_WAITKIND_SIGNALLED)
|
||||
return pid_to_ptid (-1);
|
||||
|
||||
if (ourstatus->kind == TARGET_WAITKIND_STOPPED
|
||||
Index: gdb-6.5/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 03:03:55.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 03:16:54.000000000 -0300
|
||||
@@ -2209,7 +2209,8 @@ retry:
|
||||
threads can be a bit time-consuming so if we want decent
|
||||
performance with heavily multi-threaded programs, especially when
|
||||
they're using a high frequency timer, we'd better avoid it if we
|
||||
- can. */
|
||||
+ can. For possible trap signals like SIGTRAP and SIGILL, don't
|
||||
+ avoid reporting. */
|
||||
|
||||
if (WIFSTOPPED (status))
|
||||
{
|
||||
@@ -2220,7 +2221,9 @@ retry:
|
||||
if (!lp->step
|
||||
&& signal_stop_state (signo) == 0
|
||||
&& signal_print_state (signo) == 0
|
||||
- && signal_pass_state (signo) == 1)
|
||||
+ && signal_pass_state (signo) == 1
|
||||
+ && signo != TARGET_SIGNAL_ILL
|
||||
+ && signo != TARGET_SIGNAL_TRAP)
|
||||
{
|
||||
/* FIMXE: kettenis/2001-06-06: Should we resume all threads
|
||||
here? It is not clear we should. GDB may not expect
|
|
@ -1,151 +0,0 @@
|
|||
2005-09-27 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* libunwind-frame.c (libunwind_frame_cache): Save the current
|
||||
stack pointer in the cache.
|
||||
(libunwind_sigtramp_frame_this_id): New function.
|
||||
(libunwind_sigtramp_frame_unwind): New unwinder.
|
||||
(libunwind_sigtramp_frame_sniffer): Return
|
||||
libunwind_sigtramp_frame_unwind address.
|
||||
* libunwind-frame.h (libunwind_sigtramp_frame_this_id): New
|
||||
prototype.
|
||||
* ia64-tdep.c (ia64_libunwind_sigtramp_frame_this_id): Calculate
|
||||
the base address using the current stack pointer plus a fixed
|
||||
offset.
|
||||
|
||||
Index: gdb-6.5/gdb/libunwind-frame.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/libunwind-frame.c 2006-07-07 03:04:32.000000000 -0300
|
||||
+++ gdb-6.5/gdb/libunwind-frame.c 2006-07-07 03:07:33.000000000 -0300
|
||||
@@ -62,6 +62,7 @@ static unw_word_t (*unw_find_dyn_list_p)
|
||||
struct libunwind_frame_cache
|
||||
{
|
||||
CORE_ADDR base;
|
||||
+ CORE_ADDR sp;
|
||||
CORE_ADDR func_addr;
|
||||
unw_cursor_t cursor;
|
||||
};
|
||||
@@ -131,7 +132,7 @@ libunwind_frame_cache (struct frame_info
|
||||
unw_accessors_t *acc;
|
||||
unw_addr_space_t as;
|
||||
unw_cursor_t *cursor_addr;
|
||||
- unw_word_t fp;
|
||||
+ unw_word_t fp, sp;
|
||||
unw_regnum_t uw_sp_regnum;
|
||||
struct libunwind_frame_cache *cache;
|
||||
struct libunwind_descr *descr;
|
||||
@@ -176,15 +177,28 @@ libunwind_frame_cache (struct frame_info
|
||||
else /* make copy */
|
||||
cache->cursor = *cursor_addr;
|
||||
|
||||
+ /* For the base address, we have a small problem. The majority
|
||||
+ of the time, we can get the stack pointer of the previous
|
||||
+ frame to use as a frame pointer. In the case where we have
|
||||
+ a signal trampoline, the stack may change due to a sigaltstack
|
||||
+ being set up. In that case, the normal mechanism will give us
|
||||
+ an address in the regular stack which is not at the end of the
|
||||
+ sigaltstack as we want. To handle this, we record the stack
|
||||
+ address so the caller may calculate a more correct base address
|
||||
+ to use. */
|
||||
+ uw_sp_regnum = descr->gdb2uw (SP_REGNUM);
|
||||
+ ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &sp);
|
||||
+ if (ret < 0)
|
||||
+ error ("Can't get libunwind sp register.");
|
||||
+
|
||||
if (unw_step_p (&cache->cursor) < 0)
|
||||
return NULL;
|
||||
|
||||
- /* To get base address, get sp from previous frame. */
|
||||
- uw_sp_regnum = descr->gdb2uw (SP_REGNUM);
|
||||
ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp);
|
||||
if (ret < 0)
|
||||
error (_("Can't get libunwind sp register."));
|
||||
|
||||
+ cache->sp = (CORE_ADDR)sp;
|
||||
cache->base = (CORE_ADDR)fp;
|
||||
|
||||
*this_cache = cache;
|
||||
@@ -371,6 +385,31 @@ libunwind_search_unwind_table (void *as,
|
||||
di, pi, need_unwind_info, args);
|
||||
}
|
||||
|
||||
+void
|
||||
+libunwind_sigtramp_frame_this_id (struct frame_info *next_frame,
|
||||
+ void **this_cache,
|
||||
+ struct frame_id *this_id)
|
||||
+{
|
||||
+ struct libunwind_frame_cache *cache =
|
||||
+ libunwind_frame_cache (next_frame, this_cache);
|
||||
+
|
||||
+ /* Unlike a regular frame, we can't use the normal frame pointer
|
||||
+ mechanism because a sigaltstack may have been used. Instead,
|
||||
+ we return the current stack pointer for the caller to use
|
||||
+ to calculate the base address. */
|
||||
+ if (cache != NULL)
|
||||
+ (*this_id) = frame_id_build (cache->sp, cache->func_addr);
|
||||
+ else
|
||||
+ (*this_id) = null_frame_id;
|
||||
+}
|
||||
+
|
||||
+static const struct frame_unwind libunwind_sigtramp_frame_unwind =
|
||||
+{
|
||||
+ SIGTRAMP_FRAME,
|
||||
+ libunwind_sigtramp_frame_this_id,
|
||||
+ libunwind_frame_prev_register
|
||||
+};
|
||||
+
|
||||
/* Verify if we are in a sigtramp frame and we can use libunwind to unwind. */
|
||||
const struct frame_unwind *
|
||||
libunwind_sigtramp_frame_sniffer (struct frame_info *next_frame)
|
||||
@@ -403,7 +442,7 @@ libunwind_sigtramp_frame_sniffer (struct
|
||||
/* Check to see if we are in a signal frame. */
|
||||
ret = unw_is_signal_frame_p (&cursor);
|
||||
if (ret > 0)
|
||||
- return &libunwind_frame_unwind;
|
||||
+ return &libunwind_sigtramp_frame_unwind;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Index: gdb-6.5/gdb/libunwind-frame.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/libunwind-frame.h 2006-07-07 02:51:32.000000000 -0300
|
||||
+++ gdb-6.5/gdb/libunwind-frame.h 2006-07-07 03:05:49.000000000 -0300
|
||||
@@ -49,6 +49,9 @@ void libunwind_frame_set_descr (struct g
|
||||
|
||||
void libunwind_frame_this_id (struct frame_info *next_frame, void **this_cache,
|
||||
struct frame_id *this_id);
|
||||
+void libunwind_sigtramp_frame_this_id (struct frame_info *next_frame,
|
||||
+ void **this_cache,
|
||||
+ struct frame_id *this_id);
|
||||
void libunwind_frame_prev_register (struct frame_info *next_frame, void **this_cache,
|
||||
int regnum, int *optimizedp,
|
||||
enum lval_type *lvalp, CORE_ADDR *addrp,
|
||||
Index: gdb-6.5/gdb/ia64-tdep.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/ia64-tdep.c 2006-07-07 02:51:32.000000000 -0300
|
||||
+++ gdb-6.5/gdb/ia64-tdep.c 2006-07-07 03:05:49.000000000 -0300
|
||||
@@ -3031,7 +3031,7 @@ ia64_libunwind_sigtramp_frame_this_id (s
|
||||
struct frame_id id;
|
||||
CORE_ADDR prev_ip;
|
||||
|
||||
- libunwind_frame_this_id (next_frame, this_cache, &id);
|
||||
+ libunwind_sigtramp_frame_this_id (next_frame, this_cache, &id);
|
||||
if (frame_id_eq (id, null_frame_id))
|
||||
{
|
||||
(*this_id) = null_frame_id;
|
||||
@@ -3043,8 +3043,14 @@ ia64_libunwind_sigtramp_frame_this_id (s
|
||||
frame_unwind_register (next_frame, IA64_BSP_REGNUM, buf);
|
||||
bsp = extract_unsigned_integer (buf, 8);
|
||||
|
||||
- /* For a sigtramp frame, we don't make the check for previous ip being 0. */
|
||||
- (*this_id) = frame_id_build_special (id.stack_addr, id.code_addr, bsp);
|
||||
+ /* For a sigtramp frame, we don't make the check for previous ip being 0.
|
||||
+ We also must calculate the frame pointer because libunwind will give
|
||||
+ us back the current stack pointer instead of the frame pointer since
|
||||
+ it cannot figure this out when in a sigaltstack. We make a basic
|
||||
+ assumption of 16 (default size) + 8 bytes for sigcontext address.
|
||||
+ FIXME: if libunwind were to export the frame pointer address, we
|
||||
+ could eliminate the assumption and get the actual value. */
|
||||
+ (*this_id) = frame_id_build_special (id.stack_addr + 24, id.code_addr, bsp);
|
||||
|
||||
if (gdbarch_debug >= 1)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
|
@ -1,149 +0,0 @@
|
|||
2005-07-08 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* ia64-tdep.c (ia64_sigtramp_frame_prev_register): Build
|
||||
pseudo-registers the same as ia64_pseudo_register_read.
|
||||
|
||||
--- gdb-6.3/gdb/ia64-tdep.c.fix 2005-07-08 20:26:37.000000000 -0400
|
||||
+++ gdb-6.3/gdb/ia64-tdep.c 2005-07-08 20:27:41.000000000 -0400
|
||||
@@ -2037,7 +2037,100 @@ ia64_sigtramp_frame_prev_register (struc
|
||||
pc &= ~0xf;
|
||||
store_unsigned_integer (valuep, 8, pc);
|
||||
}
|
||||
- else if ((regnum >= IA64_GR32_REGNUM && regnum <= IA64_GR127_REGNUM) ||
|
||||
+ else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
|
||||
+ {
|
||||
+ /* NAT pseudo registers 0-31: get them from UNAT.
|
||||
+ * "copied" from ia64_pseudo_register_read() */
|
||||
+ CORE_ADDR addr = 0;
|
||||
+ ULONGEST unatN_val;
|
||||
+ ULONGEST unat;
|
||||
+ read_memory (cache->saved_regs[IA64_UNAT_REGNUM], (char *) &unat,
|
||||
+ register_size (current_gdbarch, IA64_UNAT_REGNUM));
|
||||
+ unatN_val = (unat & (1LL << (regnum - IA64_NAT0_REGNUM))) != 0;
|
||||
+ store_unsigned_integer (valuep, register_size (current_gdbarch, regnum),
|
||||
+ unatN_val);
|
||||
+ *lvalp = lval_memory;
|
||||
+ *addrp = cache->saved_regs[IA64_UNAT_REGNUM];
|
||||
+ }
|
||||
+ else if (IA64_NAT32_REGNUM <= regnum && regnum <= IA64_NAT127_REGNUM)
|
||||
+ {
|
||||
+ /* NAT pseudo registers 32-127.
|
||||
+ * "copied" from ia64_pseudo_register_read()
|
||||
+ * FIXME: Not currently tested -- cannot get the frame to include
|
||||
+ * NAT32-NAT127. */
|
||||
+ ULONGEST bsp;
|
||||
+ ULONGEST cfm;
|
||||
+ ULONGEST natN_val = 0;
|
||||
+ CORE_ADDR gr_addr = 0, nat_addr = 0;
|
||||
+
|
||||
+ read_memory (cache->saved_regs[IA64_BSP_REGNUM], (char *) &bsp,
|
||||
+ register_size (current_gdbarch, IA64_BSP_REGNUM));
|
||||
+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
|
||||
+ register_size (current_gdbarch, IA64_CFM_REGNUM));
|
||||
+
|
||||
+ /* The bsp points at the end of the register frame so we
|
||||
+ subtract the size of frame from it to get start of register frame. */
|
||||
+ bsp = rse_address_add (bsp, -(cfm & 0x7f));
|
||||
+
|
||||
+ if ((cfm & 0x7f) > regnum - V32_REGNUM)
|
||||
+ gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
|
||||
+
|
||||
+ if (gr_addr != 0)
|
||||
+ {
|
||||
+ /* Compute address of nat collection bits */
|
||||
+ CORE_ADDR nat_collection;
|
||||
+ nat_addr = gr_addr | 0x1f8;
|
||||
+ int nat_bit;
|
||||
+ /* If our nat collection address is bigger than bsp, we have to get
|
||||
+ the nat collection from rnat. Otherwise, we fetch the nat
|
||||
+ collection from the computed address. FIXME: Do not know if
|
||||
+ RNAT can be not stored in the frame--being extra cautious. */
|
||||
+ if (nat_addr >= bsp)
|
||||
+ {
|
||||
+ nat_addr = cache->saved_regs[IA64_RNAT_REGNUM];
|
||||
+ if (nat_addr != 0)
|
||||
+ read_memory (nat_addr, (char *) &nat_collection,
|
||||
+ register_size (current_gdbarch, IA64_RNAT_REGNUM));
|
||||
+ }
|
||||
+ else
|
||||
+ nat_collection = read_memory_integer (nat_addr, 8);
|
||||
+ if (nat_addr != 0)
|
||||
+ {
|
||||
+ nat_bit = (gr_addr >> 3) & 0x3f;
|
||||
+ natN_val = (nat_collection >> nat_bit) & 1;
|
||||
+ *lvalp = lval_memory;
|
||||
+ *addrp = nat_addr;
|
||||
+ store_unsigned_integer (valuep,
|
||||
+ register_size (current_gdbarch, regnum),
|
||||
+ natN_val);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else if (regnum == VBOF_REGNUM)
|
||||
+ {
|
||||
+ /* BOF pseudo register.
|
||||
+ * "copied" from ia64_pseudo_register_read()
|
||||
+ *
|
||||
+ * A virtual register frame start is provided for user convenience.
|
||||
+ * It can be calculated as the bsp - sof (sizeof frame). */
|
||||
+ ULONGEST bsp;
|
||||
+ ULONGEST cfm;
|
||||
+ ULONGEST bof;
|
||||
+
|
||||
+ read_memory (cache->saved_regs[IA64_BSP_REGNUM], (char *) &bsp,
|
||||
+ register_size (current_gdbarch, IA64_BSP_REGNUM));
|
||||
+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
|
||||
+ register_size (current_gdbarch, IA64_CFM_REGNUM));
|
||||
+
|
||||
+ /* The bsp points at the end of the register frame so we
|
||||
+ subtract the size of frame from it to get beginning of frame. */
|
||||
+ bof = rse_address_add (bsp, -(cfm & 0x7f));
|
||||
+
|
||||
+ store_unsigned_integer (valuep, register_size (current_gdbarch, regnum), bof);
|
||||
+ *lvalp = lval_memory;
|
||||
+ *addrp = 0; // NOTE: pseudo reg not a anywhere really...
|
||||
+ }
|
||||
+ else if ((regnum >= IA64_GR32_REGNUM && regnum <= IA64_GR127_REGNUM) ||
|
||||
(regnum >= V32_REGNUM && regnum <= V127_REGNUM))
|
||||
{
|
||||
CORE_ADDR addr = 0;
|
||||
@@ -2051,6 +2144,39 @@ ia64_sigtramp_frame_prev_register (struc
|
||||
read_memory (addr, valuep, register_size (current_gdbarch, regnum));
|
||||
}
|
||||
}
|
||||
+ else if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM)
|
||||
+ {
|
||||
+ /* VP 0-63.
|
||||
+ * "copied" from ia64_pseudo_register_read()
|
||||
+ *
|
||||
+ * FIXME: Not currently tested--cannot get the frame to include PR. */
|
||||
+ CORE_ADDR pr_addr = 0;
|
||||
+
|
||||
+ pr_addr = cache->saved_regs[IA64_PR_REGNUM];
|
||||
+ if (pr_addr != 0)
|
||||
+ {
|
||||
+ ULONGEST pr;
|
||||
+ ULONGEST cfm;
|
||||
+ ULONGEST prN_val;
|
||||
+ read_memory (pr_addr, (char *) &pr,
|
||||
+ register_size (current_gdbarch, IA64_PR_REGNUM));
|
||||
+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
|
||||
+ register_size (current_gdbarch, IA64_CFM_REGNUM));
|
||||
+
|
||||
+ /* Get the register rename base for this frame and adjust the
|
||||
+ * register name to take rotation into account. */
|
||||
+ if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM)
|
||||
+ {
|
||||
+ int rrb_pr = (cfm >> 32) & 0x3f;
|
||||
+ regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
|
||||
+ }
|
||||
+ prN_val = (pr & (1LL << (regnum - VP0_REGNUM))) != 0;
|
||||
+ store_unsigned_integer (valuep, register_size (current_gdbarch, regnum),
|
||||
+ prN_val);
|
||||
+ *lvalp = lval_memory;
|
||||
+ *addrp = pr_addr;
|
||||
+ }
|
||||
+ }
|
||||
else
|
||||
{
|
||||
/* All other registers not listed above. */
|
|
@ -1,19 +0,0 @@
|
|||
2005-03-30 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* bfd/elfcode.h: Change code to allow for idiosyncrasies of
|
||||
ia64 vsyscall page.
|
||||
|
||||
Index: gdb-6.5/bfd/elfcode.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/bfd/elfcode.h 2006-05-11 05:57:08.000000000 -0300
|
||||
+++ gdb-6.5/bfd/elfcode.h 2006-07-07 02:36:03.000000000 -0300
|
||||
@@ -1625,7 +1625,8 @@ NAME(_bfd_elf,bfd_from_remote_memory)
|
||||
if (segment_end > (bfd_vma) contents_size)
|
||||
contents_size = segment_end;
|
||||
|
||||
- if ((i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0)
|
||||
+ if ((i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0
|
||||
+ && loadbase == ehdr_vma)
|
||||
loadbase = ehdr_vma - (i_phdrs[i].p_vaddr & -i_phdrs[i].p_align);
|
||||
|
||||
last_phdr = &i_phdrs[i];
|
|
@ -1,12 +1,26 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Johnston <jjohnstn@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-inferior-notification-20050721.patch
|
||||
|
||||
;; Notify observers that the inferior has been created
|
||||
;;=fedoratest
|
||||
|
||||
2005-07-21 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.base/attach-32.exp: New test for attaching in 32-bit
|
||||
mode on 64-bit systems.
|
||||
* gdb.base/attach-32.c: Ditto.
|
||||
* gdb.base/attach-32b.c: Ditto.
|
||||
* gdb.base/attach-32.exp: New test for attaching in 32-bit
|
||||
mode on 64-bit systems.
|
||||
* gdb.base/attach-32.c: Ditto.
|
||||
* gdb.base/attach-32b.c: Ditto.
|
||||
|
||||
--- gdb-6.3/gdb/testsuite/gdb.base/attach-32.c.fix3 2005-07-21 14:23:50.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/attach-32.c 2005-07-21 14:05:56.000000000 -0400
|
||||
2007-12-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-32.c b/gdb/testsuite/gdb.base/attach-32.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-32.c
|
||||
@@ -0,0 +1,20 @@
|
||||
+/* This program is intended to be started outside of gdb, and then
|
||||
+ attached to by gdb. Thus, it simply spins in a loop. The loop
|
||||
|
@ -28,9 +42,11 @@
|
|||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
--- gdb-6.3/gdb/testsuite/gdb.base/attach-32.exp.fix3 2005-07-21 14:23:45.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/attach-32.exp 2005-07-21 17:58:28.000000000 -0400
|
||||
@@ -0,0 +1,247 @@
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-32.exp b/gdb/testsuite/gdb.base/attach-32.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-32.exp
|
||||
@@ -0,0 +1,245 @@
|
||||
+# Copyright 2005 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
|
@ -49,13 +65,6 @@
|
|||
+#
|
||||
+# This test was based on attach.exp and modified for 32/64 bit Linux systems. */
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+# On HP-UX 11.0, this test is causing a process running the program
|
||||
+# "attach" to be left around spinning. Until we figure out why, I am
|
||||
+# commenting out the test to avoid polluting tiamat (our 11.0 nightly
|
||||
|
@ -76,9 +85,9 @@
|
|||
+set testfile "attach-32"
|
||||
+set srcfile ${testfile}.c
|
||||
+set srcfile2 ${testfile}b.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile2 ${objdir}/${subdir}/${testfile}b
|
||||
+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set binfile2 [standard_output_file ${testfile}b]
|
||||
+set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]]
|
||||
+
|
||||
+#execute_anywhere "rm -f ${binfile} ${binfile2}"
|
||||
+remote_exec build "rm -f ${binfile} ${binfile2}"
|
||||
|
@ -127,7 +136,7 @@
|
|||
+
|
||||
+ send_gdb "tbreak 19\n"
|
||||
+ gdb_expect {
|
||||
+ -re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" {
|
||||
+ -re "reakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" {
|
||||
+ pass "after attach-32, set tbreak postloop"
|
||||
+ }
|
||||
+ -re "$gdb_prompt $" {
|
||||
|
@ -152,7 +161,7 @@
|
|||
+
|
||||
+ # Allow the test process to exit, to cleanup after ourselves.
|
||||
+
|
||||
+ gdb_test "continue" "Program exited normally." "after attach-32, exit"
|
||||
+ gdb_test "continue" {\[Inferior .* exited normally\]} "after attach-32, exit"
|
||||
+
|
||||
+ # Make sure we don't leave a process around to confuse
|
||||
+ # the next test run (and prevent the compile by keeping
|
||||
|
@ -233,7 +242,7 @@
|
|||
+ # Get rid of the process
|
||||
+
|
||||
+ gdb_test "p should_exit = 1"
|
||||
+ gdb_test "c" "Program exited normally."
|
||||
+ gdb_test "c" {\[Inferior .* exited normally\]}
|
||||
+
|
||||
+ # Be paranoid
|
||||
+
|
||||
|
@ -251,9 +260,12 @@
|
|||
+ # different due to the way fork/exec works.
|
||||
+ set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
|
||||
+}
|
||||
+set GDBFLAGS "--pid=$testpid"
|
||||
+
|
||||
+set GDBFLAGS_orig $GDBFLAGS
|
||||
+set GDBFLAGS "-iex \"set height 0\" --pid=$testpid"
|
||||
+gdb_start
|
||||
+set GDBFLAGS $GDBFLAGS_orig
|
||||
+
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+# This is a test of gdb's ability to attach to a running process.
|
||||
|
@ -270,16 +282,20 @@
|
|||
+ # different due to the way fork/exec works.
|
||||
+ set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
|
||||
+}
|
||||
+set GDBFLAGS "--pid=$testpid"
|
||||
+
|
||||
+set GDBFLAGS_orig $GDBFLAGS
|
||||
+set GDBFLAGS "-iex \"set height 0\" --pid=$testpid"
|
||||
+gdb_start
|
||||
+set GDBFLAGS $GDBFLAGS_orig
|
||||
+
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+do_call_attach_tests
|
||||
+
|
||||
+return 0
|
||||
--- gdb-6.3/gdb/testsuite/gdb.base/attach-32b.c.fix3 2005-07-21 14:23:57.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/attach-32b.c 2005-07-21 14:06:02.000000000 -0400
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-32b.c b/gdb/testsuite/gdb.base/attach-32b.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-32b.c
|
||||
@@ -0,0 +1,24 @@
|
||||
+/* This program is intended to be started outside of gdb, and then
|
||||
+ attached to by gdb. Thus, it simply spins in a loop. The loop
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
2005-03-24 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* valops.c (check_field_in): Use check_typedef for base classes
|
||||
to avoid problems with opaque type references.
|
||||
|
||||
Index: gdb-6.5/gdb/valops.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/valops.c 2005-12-17 20:34:03.000000000 -0200
|
||||
+++ gdb-6.5/gdb/valops.c 2006-07-07 02:35:09.000000000 -0300
|
||||
@@ -2257,8 +2257,13 @@ check_field_in (struct type *type, const
|
||||
}
|
||||
|
||||
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
|
||||
- if (check_field_in (TYPE_BASECLASS (type, i), name))
|
||||
- return 1;
|
||||
+ {
|
||||
+ /* Check the base classes. Make sure we have the real type for
|
||||
+ each base class as opposed to an opaque declaration. */
|
||||
+ struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
|
||||
+ if (check_field_in (baseclass, name))
|
||||
+ return 1;
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,3 +1,11 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Johnston <jjohnstn@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-inheritancetest-20050726.patch
|
||||
|
||||
;; Verify printing of inherited members test
|
||||
;;=fedoratest
|
||||
|
||||
2005-07-26 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.cp/b146835.exp: New testcase.
|
||||
|
@ -5,22 +13,10 @@
|
|||
* gdb.cp/b146835b.cc: Ditto.
|
||||
* gdb.cp/b146835.h: Ditto.
|
||||
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/b146835b.cc.fix3 2005-07-26 16:47:12.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/b146835b.cc 2005-07-26 16:53:31.000000000 -0400
|
||||
@@ -0,0 +1,11 @@
|
||||
+#include "b146835.h"
|
||||
+
|
||||
+C::C() { d = 0; x = 3; }
|
||||
+
|
||||
+int C::z (char *s) { return 0; }
|
||||
+
|
||||
+C::~C() {}
|
||||
+
|
||||
+void A::funcD (class E *e, class D *d) {}
|
||||
+void A::funcE (E *e, D *d) {}
|
||||
+void A::funcF (unsigned long x, D *d) {}
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/b146835.cc.fix3 2005-07-26 16:47:20.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.cc 2005-07-26 16:46:50.000000000 -0400
|
||||
diff --git a/gdb/testsuite/gdb.cp/b146835.cc b/gdb/testsuite/gdb.cp/b146835.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/b146835.cc
|
||||
@@ -0,0 +1,32 @@
|
||||
+#include "b146835.h"
|
||||
+#include <iostream>
|
||||
|
@ -54,9 +50,11 @@
|
|||
+ f.foo();
|
||||
+}
|
||||
+
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/b146835.exp.fix3 2005-07-26 16:47:26.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.exp 2005-07-26 16:46:50.000000000 -0400
|
||||
@@ -0,0 +1,55 @@
|
||||
diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/b146835.exp
|
||||
@@ -0,0 +1,47 @@
|
||||
+# This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+# Copyright 2005 Free Software Foundation, Inc.
|
||||
|
@ -78,17 +76,10 @@
|
|||
+# Check that GDB can properly print an inherited member variable
|
||||
+# (Bugzilla 146835)
|
||||
+
|
||||
+if $tracelevel {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+set testfile "b146835"
|
||||
+set srcfile ${testfile}.cc
|
||||
+set srcfile2 ${testfile}b.cc
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable {debug c++}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
|
@ -110,10 +101,11 @@
|
|||
+gdb_continue_to_breakpoint "First line foo"
|
||||
+
|
||||
+# Verify that we can access the inherited member d
|
||||
+gdb_test "p d" ".*(struct D \*.).*0x0" "Verify inherited member d accessible"
|
||||
+
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/b146835.h.fix3 2005-07-26 16:47:36.000000000 -0400
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.h 2005-07-26 16:53:18.000000000 -0400
|
||||
+gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
|
||||
diff --git a/gdb/testsuite/gdb.cp/b146835.h b/gdb/testsuite/gdb.cp/b146835.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/b146835.h
|
||||
@@ -0,0 +1,36 @@
|
||||
+
|
||||
+class A {
|
||||
|
@ -151,3 +143,19 @@
|
|||
+ int z (char *s);
|
||||
+ virtual ~C();
|
||||
+};
|
||||
diff --git a/gdb/testsuite/gdb.cp/b146835b.cc b/gdb/testsuite/gdb.cp/b146835b.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/b146835b.cc
|
||||
@@ -0,0 +1,11 @@
|
||||
+#include "b146835.h"
|
||||
+
|
||||
+C::C() { d = 0; x = 3; }
|
||||
+
|
||||
+int C::z (char *s) { return 0; }
|
||||
+
|
||||
+C::~C() {}
|
||||
+
|
||||
+void A::funcD (class E *e, class D *d) {}
|
||||
+void A::funcE (E *e, D *d) {}
|
||||
+void A::funcF (unsigned long x, D *d) {}
|
||||
|
|
|
@ -1,454 +0,0 @@
|
|||
2005-12-14 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* symfile-mem.c (read_memory): New static read callback function.
|
||||
(symfile_add_from_memory): Pass read_memory to bfd instead of
|
||||
target_read_memory.
|
||||
* target.c (target_xfer_memory): Add support for LONGEST len and
|
||||
change all callers.
|
||||
(deprecated_debug_xfer_memory, target_read_memory): Ditto.
|
||||
(target_write_memory, do_xfer_memory): Ditto.
|
||||
(target_xfer_memory_partial, target_read_memory_partial): Ditto.
|
||||
(target_write_memory_partial): Ditto.
|
||||
* infptrace.c (child_xfer_memory): Ditto.
|
||||
* linux-nat.c (linux_nat_xfer_memory): Ditto.
|
||||
(linux_nat_proc_xfer_memory): Ditto.
|
||||
* dcache.c (dcache_xfer_memory): Ditto.
|
||||
* exec.c (xfer_memory): Ditto.
|
||||
* remote.c (remote_xfer_memory): Ditto.
|
||||
* remote-sim.c (gdbsim_xfer_interior_memory): Ditto.
|
||||
* target.h: Change prototypes for functions changed above.
|
||||
* linux-nat.h: Ditto.
|
||||
* remote.h: Ditto.
|
||||
* dcache.h: Ditto.
|
||||
|
||||
Index: gdb-6.5/gdb/symfile-mem.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/symfile-mem.c 2006-07-11 02:35:34.000000000 -0300
|
||||
+++ gdb-6.5/gdb/symfile-mem.c 2006-07-11 02:35:49.000000000 -0300
|
||||
@@ -58,6 +58,14 @@
|
||||
#include "elf/common.h"
|
||||
|
||||
|
||||
+/* Local callback routine to pass to bfd to read from target memory,
|
||||
+ using a len constrained to INT_MAX. */
|
||||
+static int
|
||||
+read_target_memory (bfd_vma addr, bfd_byte *buf, int len)
|
||||
+{
|
||||
+ return target_read_memory (addr, buf, (LONGEST)len);
|
||||
+}
|
||||
+
|
||||
/* Read inferior memory at ADDR to find the header of a loaded object file
|
||||
and read its in-core symbols out of inferior memory. TEMPL is a bfd
|
||||
representing the target's format. NAME is the name to use for this
|
||||
@@ -78,7 +86,7 @@ symbol_file_add_from_memory (struct bfd
|
||||
error (_("add-symbol-file-from-memory not supported for this target"));
|
||||
|
||||
nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase,
|
||||
- target_read_memory);
|
||||
+ read_target_memory);
|
||||
if (nbfd == NULL)
|
||||
error (_("Failed to read a valid object file image from memory."));
|
||||
|
||||
Index: gdb-6.5/gdb/target.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/target.c 2006-07-11 02:35:49.000000000 -0300
|
||||
+++ gdb-6.5/gdb/target.c 2006-07-11 02:35:49.000000000 -0300
|
||||
@@ -83,8 +83,8 @@ static LONGEST default_xfer_partial (str
|
||||
partial transfers, try either target_read_memory_partial or
|
||||
target_write_memory_partial). */
|
||||
|
||||
-static int target_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
|
||||
- int write);
|
||||
+static int target_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
|
||||
+ LONGEST len, int write);
|
||||
|
||||
static void init_dummy_target (void);
|
||||
|
||||
@@ -511,8 +511,8 @@ update_current_target (void)
|
||||
de_fault (to_prepare_to_store,
|
||||
(void (*) (void))
|
||||
noprocess);
|
||||
- de_fault (deprecated_xfer_memory,
|
||||
- (int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *))
|
||||
+ de_fault (deprecated_xfer_memory,
|
||||
+ (LONGEST (*) (CORE_ADDR, gdb_byte *, LONGEST, int, struct mem_attrib *, struct target_ops *))
|
||||
nomemory);
|
||||
de_fault (to_files_info,
|
||||
(void (*) (struct target_ops *))
|
||||
@@ -940,7 +940,7 @@ target_xfer_partial (struct target_ops *
|
||||
implementing another singluar mechanism (for instance, a generic
|
||||
object:annex onto inferior:object:annex say). */
|
||||
|
||||
-static LONGEST
|
||||
+static int
|
||||
xfer_using_stratum (enum target_object object, const char *annex,
|
||||
ULONGEST offset, LONGEST len, void *readbuf,
|
||||
const void *writebuf)
|
||||
@@ -1005,7 +1005,7 @@ xfer_using_stratum (enum target_object o
|
||||
deal with partial reads should call target_read_memory_partial. */
|
||||
|
||||
int
|
||||
-target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
|
||||
+target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len)
|
||||
{
|
||||
if (target_xfer_partial_p ())
|
||||
return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL,
|
||||
@@ -1015,7 +1015,7 @@ target_read_memory (CORE_ADDR memaddr, g
|
||||
}
|
||||
|
||||
int
|
||||
-target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
|
||||
+target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len)
|
||||
{
|
||||
gdb_byte *bytes = alloca (len);
|
||||
memcpy (bytes, myaddr, len);
|
||||
@@ -1056,11 +1056,11 @@ Mode for reading from readonly sections
|
||||
|
||||
Result is -1 on error, or the number of bytes transfered. */
|
||||
|
||||
-int
|
||||
-do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
|
||||
+LONGEST
|
||||
+do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
|
||||
struct mem_attrib *attrib)
|
||||
{
|
||||
- int res;
|
||||
+ LONGEST res;
|
||||
int done = 0;
|
||||
struct target_ops *t;
|
||||
|
||||
@@ -1118,10 +1118,11 @@ do_xfer_memory (CORE_ADDR memaddr, gdb_b
|
||||
Result is 0 or errno value. */
|
||||
|
||||
static int
|
||||
-target_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write)
|
||||
+target_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
|
||||
+ LONGEST len, int write)
|
||||
{
|
||||
- int res;
|
||||
- int reg_len;
|
||||
+ LONGEST res;
|
||||
+ LONGEST reg_len;
|
||||
struct mem_region *region;
|
||||
|
||||
/* Zero length requests are ok and require no work. */
|
||||
@@ -1192,12 +1193,12 @@ target_xfer_memory (CORE_ADDR memaddr, g
|
||||
If we succeed, set *ERR to zero and return the number of bytes transferred.
|
||||
If we fail, set *ERR to a non-zero errno value, and return -1. */
|
||||
|
||||
-static int
|
||||
-target_xfer_memory_partial (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
|
||||
+static LONGEST
|
||||
+target_xfer_memory_partial (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len,
|
||||
int write_p, int *err)
|
||||
{
|
||||
- int res;
|
||||
- int reg_len;
|
||||
+ LONGEST res;
|
||||
+ LONGEST reg_len;
|
||||
struct mem_region *region;
|
||||
|
||||
/* Zero length requests are ok and require no work. */
|
||||
@@ -1256,9 +1257,9 @@ target_xfer_memory_partial (CORE_ADDR me
|
||||
return res;
|
||||
}
|
||||
|
||||
-int
|
||||
+LONGEST
|
||||
target_read_memory_partial (CORE_ADDR memaddr, gdb_byte *buf,
|
||||
- int len, int *err)
|
||||
+ LONGEST len, int *err)
|
||||
{
|
||||
if (target_xfer_partial_p ())
|
||||
{
|
||||
@@ -1285,9 +1286,9 @@ target_read_memory_partial (CORE_ADDR me
|
||||
return target_xfer_memory_partial (memaddr, buf, len, 0, err);
|
||||
}
|
||||
|
||||
-int
|
||||
+LONGEST
|
||||
target_write_memory_partial (CORE_ADDR memaddr, gdb_byte *buf,
|
||||
- int len, int *err)
|
||||
+ LONGEST len, int *err)
|
||||
{
|
||||
if (target_xfer_partial_p ())
|
||||
{
|
||||
@@ -2044,8 +2045,8 @@ debug_to_prepare_to_store (void)
|
||||
fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
|
||||
}
|
||||
|
||||
-static int
|
||||
-deprecated_debug_xfer_memory (CORE_ADDR memaddr, bfd_byte *myaddr, int len,
|
||||
+static LONGEST
|
||||
+deprecated_debug_xfer_memory (CORE_ADDR memaddr, bfd_byte *myaddr, LONGEST len,
|
||||
int write, struct mem_attrib *attrib,
|
||||
struct target_ops *target)
|
||||
{
|
||||
@@ -2055,9 +2056,9 @@ deprecated_debug_xfer_memory (CORE_ADDR
|
||||
attrib, target);
|
||||
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
- "target_xfer_memory (0x%x, xxx, %d, %s, xxx) = %d",
|
||||
+ "target_xfer_memory (0x%x, xxx, %ld, %s, xxx) = %d",
|
||||
(unsigned int) memaddr, /* possable truncate long long */
|
||||
- len, write ? "write" : "read", retval);
|
||||
+ (long)len, write ? "write" : "read", retval);
|
||||
|
||||
if (retval > 0)
|
||||
{
|
||||
Index: gdb-6.5/gdb/target.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/target.h 2006-07-11 02:35:48.000000000 -0300
|
||||
+++ gdb-6.5/gdb/target.h 2006-07-11 02:35:49.000000000 -0300
|
||||
@@ -332,10 +332,10 @@ struct target_ops
|
||||
NOTE: cagney/2004-10-01: This has been entirely superseeded by
|
||||
to_xfer_partial and inferior inheritance. */
|
||||
|
||||
- int (*deprecated_xfer_memory) (CORE_ADDR memaddr, gdb_byte *myaddr,
|
||||
- int len, int write,
|
||||
- struct mem_attrib *attrib,
|
||||
- struct target_ops *target);
|
||||
+ LONGEST (*deprecated_xfer_memory) (CORE_ADDR memaddr, gdb_byte *myaddr,
|
||||
+ LONGEST len, int write,
|
||||
+ struct mem_attrib *attrib,
|
||||
+ struct target_ops *target);
|
||||
|
||||
void (*to_files_info) (struct target_ops *);
|
||||
int (*to_insert_breakpoint) (struct bp_target_info *);
|
||||
@@ -535,21 +535,23 @@ extern void target_disconnect (char *, i
|
||||
|
||||
extern DCACHE *target_dcache;
|
||||
|
||||
-extern int do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
|
||||
- int write, struct mem_attrib *attrib);
|
||||
+extern LONGEST do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
|
||||
+ LONGEST len, int write,
|
||||
+ struct mem_attrib *attrib);
|
||||
|
||||
extern int target_read_string (CORE_ADDR, char **, int, int *);
|
||||
|
||||
-extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
|
||||
+extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
|
||||
+ LONGEST len);
|
||||
|
||||
extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
|
||||
- int len);
|
||||
+ LONGEST len);
|
||||
|
||||
-extern int xfer_memory (CORE_ADDR, gdb_byte *, int, int,
|
||||
- struct mem_attrib *, struct target_ops *);
|
||||
+extern LONGEST xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int,
|
||||
+ struct mem_attrib *, struct target_ops *);
|
||||
|
||||
-extern int child_xfer_memory (CORE_ADDR, gdb_byte *, int, int,
|
||||
- struct mem_attrib *, struct target_ops *);
|
||||
+extern LONGEST child_xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int,
|
||||
+ struct mem_attrib *, struct target_ops *);
|
||||
|
||||
/* Make a single attempt at transfering LEN bytes. On a successful
|
||||
transfer, the number of bytes actually transfered is returned and
|
||||
@@ -557,11 +559,11 @@ extern int child_xfer_memory (CORE_ADDR,
|
||||
of bytes actually transfered is not defined) and ERR is set to a
|
||||
non-zero error indication. */
|
||||
|
||||
-extern int target_read_memory_partial (CORE_ADDR addr, gdb_byte *buf,
|
||||
- int len, int *err);
|
||||
+extern LONGEST target_read_memory_partial (CORE_ADDR addr, gdb_byte *buf,
|
||||
+ LONGEST len, int *err);
|
||||
|
||||
-extern int target_write_memory_partial (CORE_ADDR addr, gdb_byte *buf,
|
||||
- int len, int *err);
|
||||
+extern LONGEST target_write_memory_partial (CORE_ADDR addr, gdb_byte *buf,
|
||||
+ LONGEST len, int *err);
|
||||
|
||||
extern char *child_pid_to_exec_file (int);
|
||||
|
||||
Index: gdb-6.5/gdb/infptrace.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/infptrace.c 2006-07-11 02:35:49.000000000 -0300
|
||||
+++ gdb-6.5/gdb/infptrace.c 2006-07-11 02:35:49.000000000 -0300
|
||||
@@ -368,17 +368,17 @@ store_inferior_registers (int regnum)
|
||||
deprecated_child_ops doesn't allow memory operations to cross below
|
||||
us in the target stack anyway. */
|
||||
|
||||
-int
|
||||
-child_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
|
||||
+LONGEST
|
||||
+child_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
|
||||
struct mem_attrib *attrib, struct target_ops *target)
|
||||
{
|
||||
- int i;
|
||||
+ LONGEST i;
|
||||
/* Round starting address down to longword boundary. */
|
||||
CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET);
|
||||
/* Round ending address up; get number of longwords that makes. */
|
||||
- int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
|
||||
- / sizeof (PTRACE_TYPE_RET));
|
||||
- int alloc = count * sizeof (PTRACE_TYPE_RET);
|
||||
+ LONGEST count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
|
||||
+ / sizeof (PTRACE_TYPE_RET));
|
||||
+ LONGEST alloc = count * sizeof (PTRACE_TYPE_RET);
|
||||
PTRACE_TYPE_RET *buffer;
|
||||
struct cleanup *old_chain = NULL;
|
||||
|
||||
Index: gdb-6.5/gdb/dcache.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/dcache.c 2006-07-11 02:35:34.000000000 -0300
|
||||
+++ gdb-6.5/gdb/dcache.c 2006-07-11 02:35:49.000000000 -0300
|
||||
@@ -527,9 +527,9 @@ dcache_free (DCACHE *dcache)
|
||||
|
||||
This routine is indended to be called by remote_xfer_ functions. */
|
||||
|
||||
-int
|
||||
+LONGEST
|
||||
dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
|
||||
- int len, int should_write)
|
||||
+ LONGEST len, int should_write)
|
||||
{
|
||||
int i;
|
||||
int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr);
|
||||
Index: gdb-6.5/gdb/dcache.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/dcache.h 2006-07-11 02:35:34.000000000 -0300
|
||||
+++ gdb-6.5/gdb/dcache.h 2006-07-11 02:35:49.000000000 -0300
|
||||
@@ -37,7 +37,7 @@ void dcache_free (DCACHE *);
|
||||
|
||||
/* Simple to call from <remote>_xfer_memory */
|
||||
|
||||
-int dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my,
|
||||
- int len, int should_write);
|
||||
+LONGEST dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my,
|
||||
+ LONGEST len, int should_write);
|
||||
|
||||
#endif /* DCACHE_H */
|
||||
Index: gdb-6.5/gdb/exec.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/exec.c 2006-07-11 02:35:34.000000000 -0300
|
||||
+++ gdb-6.5/gdb/exec.c 2006-07-11 02:35:49.000000000 -0300
|
||||
@@ -447,8 +447,8 @@ map_vmap (bfd *abfd, bfd *arch)
|
||||
The same routine is used to handle both core and exec files;
|
||||
we just tail-call it with more arguments to select between them. */
|
||||
|
||||
-int
|
||||
-xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
|
||||
+LONGEST
|
||||
+xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
|
||||
struct mem_attrib *attrib, struct target_ops *target)
|
||||
{
|
||||
int res;
|
||||
Index: gdb-6.5/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-11 02:35:49.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linux-nat.c 2006-07-11 02:36:39.000000000 -0300
|
||||
@@ -3264,7 +3264,7 @@ linux_xfer_partial (struct target_ops *o
|
||||
Revert when Bugzilla 147436 is fixed. */
|
||||
if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
|
||||
{ /* This region contains ia64 rse registers, we have to re-read. */
|
||||
- int xxfer;
|
||||
+ LONGEST xxfer;
|
||||
|
||||
/* Re-read register stack area. */
|
||||
xxfer = super_xfer_partial (ops, object, annex,
|
||||
Index: gdb-6.5/gdb/remote.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/remote.c 2006-07-11 02:35:48.000000000 -0300
|
||||
+++ gdb-6.5/gdb/remote.c 2006-07-11 02:37:02.000000000 -0300
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "gdb_string.h"
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
+#include <limits.h>
|
||||
#include "inferior.h"
|
||||
#include "bfd.h"
|
||||
#include "symfile.h"
|
||||
@@ -3701,19 +3702,27 @@ remote_read_bytes (CORE_ADDR memaddr, gd
|
||||
if SHOULD_WRITE is nonzero. Returns length of data written or
|
||||
read; 0 for error. TARGET is unused. */
|
||||
|
||||
-static int
|
||||
-remote_xfer_memory (CORE_ADDR mem_addr, gdb_byte *buffer, int mem_len,
|
||||
+static LONGEST
|
||||
+remote_xfer_memory (CORE_ADDR mem_addr, gdb_byte *buffer, LONGEST mem_len,
|
||||
int should_write, struct mem_attrib *attrib,
|
||||
struct target_ops *target)
|
||||
{
|
||||
CORE_ADDR targ_addr;
|
||||
int targ_len;
|
||||
int res;
|
||||
+ int len;
|
||||
+
|
||||
+
|
||||
+ /* This routine is not set up to handle > INT_MAX bytes. */
|
||||
+ if (mem_len >= (LONGEST)INT_MAX)
|
||||
+ return 0;
|
||||
+
|
||||
+ len = (int)mem_len;
|
||||
|
||||
/* Should this be the selected frame? */
|
||||
gdbarch_remote_translate_xfer_address (current_gdbarch,
|
||||
current_regcache,
|
||||
- mem_addr, mem_len,
|
||||
+ mem_addr, len,
|
||||
&targ_addr, &targ_len);
|
||||
if (targ_len <= 0)
|
||||
return 0;
|
||||
@@ -3723,7 +3732,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
|
||||
else
|
||||
res = remote_read_bytes (targ_addr, buffer, targ_len);
|
||||
|
||||
- return res;
|
||||
+ return (LONGEST)res;
|
||||
}
|
||||
|
||||
static void
|
||||
Index: gdb-6.5/gdb/remote-sim.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/remote-sim.c 2006-07-11 02:35:34.000000000 -0300
|
||||
+++ gdb-6.5/gdb/remote-sim.c 2006-07-11 02:35:49.000000000 -0300
|
||||
@@ -742,11 +742,14 @@ gdbsim_prepare_to_store (void)
|
||||
|
||||
Returns the number of bytes transferred. */
|
||||
|
||||
-static int
|
||||
-gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
|
||||
+static LONGEST
|
||||
+gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len,
|
||||
int write, struct mem_attrib *attrib,
|
||||
struct target_ops *target)
|
||||
{
|
||||
+ /* Convert to len type that sim_read and sim_write can handle. */
|
||||
+ int xfer_len = (int)len;
|
||||
+
|
||||
if (!program_loaded)
|
||||
error (_("No program loaded."));
|
||||
|
||||
@@ -756,22 +759,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m
|
||||
printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
|
||||
gdb_print_host_address (myaddr, gdb_stdout);
|
||||
printf_filtered (", memaddr 0x%s, len %d, write %d\n",
|
||||
- paddr_nz (memaddr), len, write);
|
||||
+ paddr_nz (memaddr), xfer_len, write);
|
||||
if (sr_get_debug () && write)
|
||||
- dump_mem (myaddr, len);
|
||||
+ dump_mem (myaddr, xfer_len);
|
||||
}
|
||||
|
||||
if (write)
|
||||
{
|
||||
- len = sim_write (gdbsim_desc, memaddr, myaddr, len);
|
||||
+ xfer_len = sim_write (gdbsim_desc, memaddr, myaddr, xfer_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
- len = sim_read (gdbsim_desc, memaddr, myaddr, len);
|
||||
- if (sr_get_debug () && len > 0)
|
||||
- dump_mem (myaddr, len);
|
||||
+ xfer_len = sim_read (gdbsim_desc, memaddr, myaddr, xfer_len);
|
||||
+ if (sr_get_debug () && xfer_len > 0)
|
||||
+ dump_mem (myaddr, xfer_len);
|
||||
}
|
||||
- return len;
|
||||
+ return (LONGEST)xfer_len;
|
||||
}
|
||||
|
||||
static void
|
|
@ -1,415 +0,0 @@
|
|||
Index: gdb-6.5/gdb/linespec.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linespec.c 2006-01-10 20:14:43.000000000 -0200
|
||||
+++ gdb-6.5/gdb/linespec.c 2006-07-07 01:04:56.000000000 -0300
|
||||
@@ -75,7 +75,8 @@ static struct symtabs_and_lines find_met
|
||||
struct symbol *sym_class);
|
||||
|
||||
static int collect_methods (char *copy, struct type *t,
|
||||
- struct symbol **sym_arr);
|
||||
+ struct symbol **sym_arr,
|
||||
+ struct minimal_symbol **msym_arr);
|
||||
|
||||
static NORETURN void cplusplus_error (const char *name,
|
||||
const char *fmt, ...)
|
||||
@@ -83,10 +84,12 @@ static NORETURN void cplusplus_error (co
|
||||
|
||||
static int total_number_of_methods (struct type *type);
|
||||
|
||||
-static int find_methods (struct type *, char *, struct symbol **);
|
||||
+static int find_methods (struct type *, char *, struct symbol **,
|
||||
+ struct minimal_symbol **);
|
||||
|
||||
static int add_matching_methods (int method_counter, struct type *t,
|
||||
- struct symbol **sym_arr);
|
||||
+ struct symbol **sym_arr,
|
||||
+ struct minimal_symbol **msym_arr);
|
||||
|
||||
static int add_constructors (int method_counter, struct type *t,
|
||||
struct symbol **sym_arr);
|
||||
@@ -101,6 +104,9 @@ static int is_objc_method_format (const
|
||||
static struct symtabs_and_lines decode_line_2 (struct symbol *[],
|
||||
int, int, char ***);
|
||||
|
||||
+static struct symtabs_and_lines decode_line_3 (struct minimal_symbol *[],
|
||||
+ int, int, char ***);
|
||||
+
|
||||
static struct symtab *symtab_from_filename (char **argptr,
|
||||
char *p, int is_quote_enclosed,
|
||||
int *not_found_ptr);
|
||||
@@ -191,12 +197,18 @@ total_number_of_methods (struct type *ty
|
||||
/* Recursive helper function for decode_line_1.
|
||||
Look for methods named NAME in type T.
|
||||
Return number of matches.
|
||||
- Put matches in SYM_ARR, which should have been allocated with
|
||||
+ Put symbol matches in SYM_ARR, which should have been allocated with
|
||||
a size of total_number_of_methods (T) * sizeof (struct symbol *).
|
||||
+ In a special case where we are looking for constructors, we may
|
||||
+ have to return minimal symbols in the array: MSYM_ARR. This occurs
|
||||
+ when the compiler does not generate mangled names for the constructor's
|
||||
+ debug info because there are multiple versions of the constructor
|
||||
+ (in-charge vs not-in-charge).
|
||||
Note that this function is g++ specific. */
|
||||
|
||||
static int
|
||||
-find_methods (struct type *t, char *name, struct symbol **sym_arr)
|
||||
+find_methods (struct type *t, char *name, struct symbol **sym_arr,
|
||||
+ struct minimal_symbol **msym_arr)
|
||||
{
|
||||
int i1 = 0;
|
||||
int ibase;
|
||||
@@ -239,7 +251,8 @@ find_methods (struct type *t, char *name
|
||||
if (strcmp_iw (name, method_name) == 0)
|
||||
/* Find all the overloaded methods with that name. */
|
||||
i1 += add_matching_methods (method_counter, t,
|
||||
- sym_arr + i1);
|
||||
+ sym_arr + i1,
|
||||
+ msym_arr);
|
||||
else if (strncmp (class_name, name, name_len) == 0
|
||||
&& (class_name[name_len] == '\0'
|
||||
|| class_name[name_len] == '<'))
|
||||
@@ -261,21 +274,83 @@ find_methods (struct type *t, char *name
|
||||
|
||||
if (i1 == 0)
|
||||
for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++)
|
||||
- i1 += find_methods (TYPE_BASECLASS (t, ibase), name, sym_arr + i1);
|
||||
+ i1 += find_methods (TYPE_BASECLASS (t, ibase), name, sym_arr + i1,
|
||||
+ msym_arr);
|
||||
|
||||
return i1;
|
||||
}
|
||||
|
||||
+static int
|
||||
+add_minsym_members (const char *class_name,
|
||||
+ const char *member_name,
|
||||
+ struct minimal_symbol **msym_arr)
|
||||
+{
|
||||
+ char *completion_name;
|
||||
+ char **list;
|
||||
+ int i;
|
||||
+ int comp_len;
|
||||
+ int counter = 0;
|
||||
+
|
||||
+ /* To find the member, we first cheat and use symbol completion.
|
||||
+ This will give us a list of all the member names including
|
||||
+ the function signature. */
|
||||
+ completion_name = xmalloc (strlen (class_name) +
|
||||
+ strlen (member_name) + 9);
|
||||
+ completion_name[0] = '\'';
|
||||
+ strcpy (completion_name+1, class_name);
|
||||
+ /* FIXME: make this the language class separator. */
|
||||
+ strcat (completion_name, "::");
|
||||
+ strcat (completion_name, member_name);
|
||||
+ strcat (completion_name, "(");
|
||||
+ list = make_symbol_completion_list (completion_name,
|
||||
+ completion_name+1);
|
||||
+
|
||||
+ /* Now that we have the list, we generate an array of their
|
||||
+ corresponding minimal symbols. */
|
||||
+ counter = 0;
|
||||
+ while (list && list[counter] != NULL)
|
||||
+ {
|
||||
+ msym_arr[counter] = lookup_minimal_symbol (list[counter], NULL, NULL);
|
||||
+ ++counter;
|
||||
+ }
|
||||
+
|
||||
+ xfree (list);
|
||||
+
|
||||
+ /* In the case of constructors, there may be in-charge vs not-in-charge
|
||||
+ constructors. Check for names with $base which indicates not-in-charge
|
||||
+ constructors. */
|
||||
+ comp_len = strlen (completion_name);
|
||||
+ strcpy (completion_name + comp_len - 1, "$base(");
|
||||
+ list = make_symbol_completion_list (completion_name,
|
||||
+ completion_name+1);
|
||||
+
|
||||
+ /* Again we have a list. Add their minimal symbols to the array. */
|
||||
+ i = 0;
|
||||
+ while (list && list[i] != NULL)
|
||||
+ {
|
||||
+ msym_arr[counter] = lookup_minimal_symbol (list[i++], NULL, NULL);
|
||||
+ ++counter;
|
||||
+ }
|
||||
+ xfree (list);
|
||||
+ xfree (completion_name);
|
||||
+
|
||||
+ return counter;
|
||||
+}
|
||||
+
|
||||
/* Add the symbols associated to methods of the class whose type is T
|
||||
and whose name matches the method indexed by METHOD_COUNTER in the
|
||||
array SYM_ARR. Return the number of methods added. */
|
||||
|
||||
static int
|
||||
add_matching_methods (int method_counter, struct type *t,
|
||||
- struct symbol **sym_arr)
|
||||
+ struct symbol **sym_arr,
|
||||
+ struct minimal_symbol **msym_arr)
|
||||
{
|
||||
int field_counter;
|
||||
int i1 = 0;
|
||||
+ int cons_index = 0;
|
||||
+ char *class_name = type_name_no_tag (t);
|
||||
+ char **list = NULL;
|
||||
|
||||
for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1;
|
||||
field_counter >= 0;
|
||||
@@ -299,6 +374,16 @@ add_matching_methods (int method_counter
|
||||
}
|
||||
else
|
||||
phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
|
||||
+
|
||||
+ /* Check for special case of looking for member that
|
||||
+ doesn't have a mangled name provided. This will happen
|
||||
+ when we have in-charge and not-in-charge constructors.
|
||||
+ Since we don't have a mangled name to work with, if we
|
||||
+ look for the symbol, we can only find the class itself.
|
||||
+ We can find the information we need in the minimal symbol
|
||||
+ table which has the full member name information we need. */
|
||||
+ if (strlen (phys_name) <= strlen (class_name))
|
||||
+ return add_minsym_members (class_name, phys_name, msym_arr);
|
||||
|
||||
/* Destructor is handled by caller, don't add it to
|
||||
the list. */
|
||||
@@ -324,6 +409,9 @@ add_matching_methods (int method_counter
|
||||
}
|
||||
}
|
||||
|
||||
+ if (list)
|
||||
+ xfree (list);
|
||||
+
|
||||
return i1;
|
||||
}
|
||||
|
||||
@@ -603,6 +691,146 @@ decode_line_2 (struct symbol *sym_arr[],
|
||||
discard_cleanups (old_chain);
|
||||
return return_values;
|
||||
}
|
||||
+
|
||||
+/* Given a list of NELTS minimal symbols in MSYM_ARR, return a list of lines to
|
||||
+ operate on (ask user if necessary).
|
||||
+ If CANONICAL is non-NULL return a corresponding array of mangled names
|
||||
+ as canonical line specs there. */
|
||||
+
|
||||
+static struct symtabs_and_lines
|
||||
+decode_line_3 (struct minimal_symbol *msym_arr[],
|
||||
+ int nelts, int funfirstline,
|
||||
+ char ***canonical)
|
||||
+{
|
||||
+ struct symtabs_and_lines values, return_values;
|
||||
+ char *args, *arg1;
|
||||
+ int i;
|
||||
+ char *prompt;
|
||||
+ char *symname;
|
||||
+ struct cleanup *old_chain;
|
||||
+ char **canonical_arr = (char **) NULL;
|
||||
+
|
||||
+ values.sals = (struct symtab_and_line *)
|
||||
+ alloca (nelts * sizeof (struct symtab_and_line));
|
||||
+ return_values.sals = (struct symtab_and_line *)
|
||||
+ xmalloc (nelts * sizeof (struct symtab_and_line));
|
||||
+ old_chain = make_cleanup (xfree, return_values.sals);
|
||||
+
|
||||
+ if (canonical)
|
||||
+ {
|
||||
+ canonical_arr = (char **) xmalloc (nelts * sizeof (char *));
|
||||
+ make_cleanup (xfree, canonical_arr);
|
||||
+ memset (canonical_arr, 0, nelts * sizeof (char *));
|
||||
+ *canonical = canonical_arr;
|
||||
+ }
|
||||
+
|
||||
+ i = 0;
|
||||
+ printf_unfiltered ("[0] cancel\n[1] all\n");
|
||||
+ while (i < nelts)
|
||||
+ {
|
||||
+ init_sal (&return_values.sals[i]); /* Initialize to zeroes. */
|
||||
+ init_sal (&values.sals[i]);
|
||||
+ if (msym_arr[i])
|
||||
+ {
|
||||
+ struct symtabs_and_lines msal = minsym_found (funfirstline,
|
||||
+ msym_arr[i]);
|
||||
+ memcpy (&values.sals[i], &msal.sals[0],
|
||||
+ sizeof (struct symtab_and_line));
|
||||
+ if (values.sals[i].symtab)
|
||||
+ printf_unfiltered ("[%d] %s at %s:%d\n",
|
||||
+ (i + 2),
|
||||
+ SYMBOL_PRINT_NAME (msym_arr[i]),
|
||||
+ values.sals[i].symtab->filename,
|
||||
+ values.sals[i].line);
|
||||
+ else
|
||||
+ printf_unfiltered ("[%d] %s at ?FILE:%d [No symtab? Probably broken debug info...]\n",
|
||||
+ (i + 2),
|
||||
+ SYMBOL_PRINT_NAME (msym_arr[i]),
|
||||
+ values.sals[i].line);
|
||||
+
|
||||
+ }
|
||||
+ else
|
||||
+ printf_unfiltered ("?HERE\n");
|
||||
+ i++;
|
||||
+ }
|
||||
+
|
||||
+ prompt = getenv ("PS2");
|
||||
+ if (prompt == NULL)
|
||||
+ {
|
||||
+ prompt = "> ";
|
||||
+ }
|
||||
+ args = command_line_input (prompt, 0, "overload-choice");
|
||||
+
|
||||
+ if (args == 0 || *args == 0)
|
||||
+ error_no_arg ("one or more choice numbers");
|
||||
+
|
||||
+ i = 0;
|
||||
+ while (*args)
|
||||
+ {
|
||||
+ int num;
|
||||
+
|
||||
+ arg1 = args;
|
||||
+ while (*arg1 >= '0' && *arg1 <= '9')
|
||||
+ arg1++;
|
||||
+ if (*arg1 && *arg1 != ' ' && *arg1 != '\t')
|
||||
+ error ("Arguments must be choice numbers.");
|
||||
+
|
||||
+ num = atoi (args);
|
||||
+
|
||||
+ if (num == 0)
|
||||
+ error ("canceled");
|
||||
+ else if (num == 1)
|
||||
+ {
|
||||
+ if (canonical_arr)
|
||||
+ {
|
||||
+ for (i = 0; i < nelts; i++)
|
||||
+ {
|
||||
+ if (canonical_arr[i] == NULL)
|
||||
+ {
|
||||
+ symname = DEPRECATED_SYMBOL_NAME (msym_arr[i]);
|
||||
+ canonical_arr[i] = savestring (symname, strlen (symname));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ memcpy (return_values.sals, values.sals,
|
||||
+ (nelts * sizeof (struct symtab_and_line)));
|
||||
+ return_values.nelts = nelts;
|
||||
+ discard_cleanups (old_chain);
|
||||
+ return return_values;
|
||||
+ }
|
||||
+
|
||||
+ if (num >= nelts + 2)
|
||||
+ {
|
||||
+ printf_unfiltered ("No choice number %d.\n", num);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ num -= 2;
|
||||
+ if (values.sals[num].pc)
|
||||
+ {
|
||||
+ if (canonical_arr)
|
||||
+ {
|
||||
+ symname = DEPRECATED_SYMBOL_NAME (msym_arr[num]);
|
||||
+ make_cleanup (xfree, symname);
|
||||
+ canonical_arr[i] = savestring (symname, strlen (symname));
|
||||
+ }
|
||||
+ return_values.sals[i++] = values.sals[num];
|
||||
+ values.sals[num].pc = 0;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf_unfiltered ("duplicate request for %d ignored.\n", num);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ args = arg1;
|
||||
+ while (*args == ' ' || *args == '\t')
|
||||
+ args++;
|
||||
+ }
|
||||
+ return_values.nelts = i;
|
||||
+ discard_cleanups (old_chain);
|
||||
+ return return_values;
|
||||
+}
|
||||
|
||||
/* The parser of linespec itself. */
|
||||
|
||||
@@ -1406,36 +1634,46 @@ find_method (int funfirstline, char ***c
|
||||
int i1; /* Counter for the symbol array. */
|
||||
struct symbol **sym_arr = alloca (total_number_of_methods (t)
|
||||
* sizeof (struct symbol *));
|
||||
+ struct minimal_symbol **msym_arr = alloca (total_number_of_methods (t)
|
||||
+ * sizeof (struct minimal_symbol *));
|
||||
+
|
||||
+ msym_arr[0] = NULL;
|
||||
|
||||
/* Find all methods with a matching name, and put them in
|
||||
sym_arr. */
|
||||
|
||||
- i1 = collect_methods (copy, t, sym_arr);
|
||||
+ i1 = collect_methods (copy, t, sym_arr, msym_arr);
|
||||
|
||||
if (i1 == 1)
|
||||
{
|
||||
/* There is exactly one field with that name. */
|
||||
- sym = sym_arr[0];
|
||||
-
|
||||
- if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
|
||||
- {
|
||||
- values.sals = (struct symtab_and_line *)
|
||||
- xmalloc (sizeof (struct symtab_and_line));
|
||||
- values.nelts = 1;
|
||||
- values.sals[0] = find_function_start_sal (sym,
|
||||
- funfirstline);
|
||||
- }
|
||||
+ if (msym_arr[0] != NULL)
|
||||
+ return minsym_found (funfirstline, msym_arr[0]);
|
||||
else
|
||||
{
|
||||
- values.sals = NULL;
|
||||
- values.nelts = 0;
|
||||
+ sym = sym_arr[0];
|
||||
+
|
||||
+ if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
|
||||
+ {
|
||||
+ values.sals = (struct symtab_and_line *)
|
||||
+ xmalloc (sizeof (struct symtab_and_line));
|
||||
+ values.nelts = 1;
|
||||
+ values.sals[0] = find_function_start_sal (sym,
|
||||
+ funfirstline);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ values.nelts = 0;
|
||||
+ }
|
||||
+ return values;
|
||||
}
|
||||
- return values;
|
||||
}
|
||||
if (i1 > 0)
|
||||
{
|
||||
/* There is more than one field with that name
|
||||
(overloaded). Ask the user which one to use. */
|
||||
+ if (msym_arr[0] != NULL)
|
||||
+ return decode_line_3 (msym_arr, i1, funfirstline, canonical);
|
||||
return decode_line_2 (sym_arr, i1, funfirstline, canonical);
|
||||
}
|
||||
else
|
||||
@@ -1462,11 +1700,12 @@ find_method (int funfirstline, char ***c
|
||||
}
|
||||
|
||||
/* Find all methods named COPY in the class whose type is T, and put
|
||||
- them in SYM_ARR. Return the number of methods found. */
|
||||
+ them in SYM_ARR or MSYM_ARR. Return the number of methods found. */
|
||||
|
||||
static int
|
||||
collect_methods (char *copy, struct type *t,
|
||||
- struct symbol **sym_arr)
|
||||
+ struct symbol **sym_arr,
|
||||
+ struct minimal_symbol **msym_arr)
|
||||
{
|
||||
int i1 = 0; /* Counter for the symbol array. */
|
||||
|
||||
@@ -1488,7 +1727,7 @@ collect_methods (char *copy, struct type
|
||||
}
|
||||
}
|
||||
else
|
||||
- i1 = find_methods (t, copy, sym_arr);
|
||||
+ i1 = find_methods (t, copy, sym_arr, msym_arr);
|
||||
|
||||
return i1;
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
2004-12-16 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* linux-thread-db.c (clear_lwpip_callback): Removed.
|
||||
(thread_db_resume): Do not iterate and call
|
||||
clear_lwp_callback.
|
||||
|
||||
--- gdb-6.3/gdb/linux-thread-db.c.fix Thu Dec 16 16:32:13 2004
|
||||
+++ gdb-6.3/gdb/linux-thread-db.c Thu Dec 16 16:32:30 2004
|
||||
@@ -822,19 +822,6 @@ thread_db_detach (char *args, int from_t
|
||||
target_beneath->to_detach (args, from_tty);
|
||||
}
|
||||
|
||||
-static int
|
||||
-clear_lwpid_callback (struct thread_info *thread, void *dummy)
|
||||
-{
|
||||
- /* If we know that our thread implementation is 1-to-1, we could save
|
||||
- a certain amount of information; it's not clear how much, so we
|
||||
- are always conservative. */
|
||||
-
|
||||
- thread->private->th_valid = 0;
|
||||
- thread->private->ti_valid = 0;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static void
|
||||
thread_db_resume (ptid_t ptid, int step, enum target_signal signo)
|
||||
{
|
||||
@@ -845,9 +832,6 @@ thread_db_resume (ptid_t ptid, int step,
|
||||
else if (is_thread (ptid))
|
||||
ptid = lwp_from_thread (ptid);
|
||||
|
||||
- /* Clear cached data which may not be valid after the resume. */
|
||||
- iterate_over_threads (clear_lwpid_callback, NULL);
|
||||
-
|
||||
target_beneath->to_resume (ptid, step, signo);
|
||||
|
||||
do_cleanups (old_chain);
|
|
@ -0,0 +1,247 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-mapping-zero-inode-test.patch
|
||||
|
||||
;; Test GCORE for shmid 0 shared memory mappings.
|
||||
;;=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.c b/gdb/testsuite/gdb.base/gcore-shmid0.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-shmid0.c
|
||||
@@ -0,0 +1,128 @@
|
||||
+/* Copyright 2007, 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or (at
|
||||
+ your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
+ Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+/*
|
||||
+ * Test GDB's handling of gcore for mapping with a name but zero inode.
|
||||
+ */
|
||||
+
|
||||
+#include <sys/ipc.h>
|
||||
+#include <sys/shm.h>
|
||||
+#include <stdio.h>
|
||||
+#include <errno.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+#include <assert.h>
|
||||
+#include <time.h>
|
||||
+
|
||||
+/* The same test running in a parallel testsuite may steal us the zero SID,
|
||||
+ even if we never get any EEXIST. Just try a while. */
|
||||
+
|
||||
+#define TIMEOUT_SEC 10
|
||||
+
|
||||
+static volatile int v;
|
||||
+
|
||||
+static void
|
||||
+initialized (void)
|
||||
+{
|
||||
+ v++;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+unresolved (void)
|
||||
+{
|
||||
+ v++;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ int sid;
|
||||
+ unsigned int *addr = (void *) -1L;
|
||||
+ int attempt, round = 0;
|
||||
+ time_t ts_start, ts;
|
||||
+
|
||||
+ if (time (&ts_start) == (time_t) -1)
|
||||
+ {
|
||||
+ printf ("time (): %m\n");
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ /* The generated SID will cycle with an increment of 32768, attempt until it
|
||||
+ * wraps to 0. */
|
||||
+
|
||||
+ for (attempt = 0; addr == (void *) -1L; attempt++)
|
||||
+ {
|
||||
+ /* kernel-2.6.25-8.fc9.x86_64 just never returns the value 0 by
|
||||
+ shmget(2). shmget returns SID range 0..1<<31 in steps of 32768,
|
||||
+ 0x1000 should be enough but wrap the range it to be sure. */
|
||||
+
|
||||
+ if (attempt > 0x21000)
|
||||
+ {
|
||||
+ if (time (&ts) == (time_t) -1)
|
||||
+ {
|
||||
+ printf ("time (): %m\n");
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ if (ts >= ts_start && ts < ts_start + TIMEOUT_SEC)
|
||||
+ {
|
||||
+ attempt = 0;
|
||||
+ round++;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ printf ("Problem is not reproducible on this kernel (attempt %d, "
|
||||
+ "round %d)\n", attempt, round);
|
||||
+ unresolved ();
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ sid = shmget ((key_t) rand (), 0x1000, IPC_CREAT | IPC_EXCL | 0777);
|
||||
+ if (sid == -1)
|
||||
+ {
|
||||
+ if (errno == EEXIST)
|
||||
+ continue;
|
||||
+
|
||||
+ printf ("shmget (%d, 0x1000, IPC_CREAT): errno %d\n", 0, errno);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ /* Use SID only if it is 0, retry it otherwise. */
|
||||
+
|
||||
+ if (sid == 0)
|
||||
+ {
|
||||
+ addr = shmat (sid, NULL, SHM_RND);
|
||||
+ if (addr == (void *) -1L)
|
||||
+ {
|
||||
+ printf ("shmat (%d, NULL, SHM_RND): errno %d\n", sid,
|
||||
+ errno);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+ }
|
||||
+ if (shmctl (sid, IPC_RMID, NULL) != 0)
|
||||
+ {
|
||||
+ printf ("shmctl (%d, IPC_RMID, NULL): errno %d\n", sid, errno);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ initialized ();
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.exp b/gdb/testsuite/gdb.base/gcore-shmid0.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-shmid0.exp
|
||||
@@ -0,0 +1,101 @@
|
||||
+# Copyright 2007, 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Test GDB's handling of gcore for mapping with a name but zero inode.
|
||||
+
|
||||
+if { [prepare_for_testing gcore-shmid0.exp gcore-shmid0] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Does this gdb support gcore?
|
||||
+set test "help gcore"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "Undefined command: .gcore.*$gdb_prompt $" {
|
||||
+ # gcore command not supported -- nothing to test here.
|
||||
+ unsupported "gdb does not support gcore on this target"
|
||||
+ return -1;
|
||||
+ }
|
||||
+ -re "Save a core file .*$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if { ! [ runto_main ] } then {
|
||||
+ untested gcore-shmid0.exp
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_breakpoint "initialized"
|
||||
+gdb_breakpoint "unresolved"
|
||||
+
|
||||
+set oldtimeout $timeout
|
||||
+set timeout [expr $oldtimeout + 120]
|
||||
+
|
||||
+set test "Continue to initialized."
|
||||
+gdb_test_multiple "continue" $test {
|
||||
+ -re "Breakpoint .*, initialized .* at .*\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "Breakpoint .*, unresolved .* at .*\r\n$gdb_prompt $" {
|
||||
+ set timeout $oldtimeout
|
||||
+ unsupported $test
|
||||
+ return -1
|
||||
+ }
|
||||
+}
|
||||
+set timeout $oldtimeout
|
||||
+
|
||||
+set escapedfilename [string_to_regexp [standard_output_file gcore-shmid0.test]]
|
||||
+
|
||||
+set test "save a corefile"
|
||||
+gdb_test_multiple "gcore [standard_output_file gcore-shmid0.test]" $test {
|
||||
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
|
||||
+ unsupported $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Be sure to remove the handle first.
|
||||
+# But it would get removed even on a kill by GDB as the handle is already
|
||||
+# deleted, just it is still attached.
|
||||
+gdb_continue_to_end "finish"
|
||||
+
|
||||
+set test "core-file command"
|
||||
+gdb_test_multiple "core-file [standard_output_file gcore-shmid0.test]" $test {
|
||||
+ -re ".* program is being debugged already.*y or n. $" {
|
||||
+ # gdb_load may connect us to a gdbserver.
|
||||
+ send_gdb "y\n"
|
||||
+ exp_continue;
|
||||
+ }
|
||||
+ -re "Core was generated by .*\r\n\#0 .*\\\(\\\).*\r\n$gdb_prompt $" {
|
||||
+ # The filename does not fit there anyway so do not check it.
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re ".*registers from core file: File in wrong format.* $" {
|
||||
+ fail "core-file command (could not read registers from core file)"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set test "backtrace"
|
||||
+gdb_test_multiple "bt" $test {
|
||||
+ -re "#0 *initialized \\\(\\\) at .*#1 .* main \\\(.*$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "#0 *initialized \\\(\\\) at .*Cannot access memory at address .*$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+}
|
|
@ -1,114 +0,0 @@
|
|||
Index: gdb-6.5/gdb/doc/observer.texi
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/doc/observer.texi 2006-07-07 04:08:37.000000000 -0300
|
||||
+++ gdb-6.5/gdb/doc/observer.texi 2006-07-07 04:19:00.000000000 -0300
|
||||
@@ -119,6 +119,10 @@ when @value{GDBN} calls this observer, t
|
||||
haven't been loaded yet.
|
||||
@end deftypefun
|
||||
|
||||
+@deftypefun void mourn_inferior (struct target_ops *@var{target})
|
||||
+@value{GDBN} has just detached from an inferior.
|
||||
+@end deftypefun
|
||||
+
|
||||
@deftypefun void solib_unloaded (struct so_list *@var{solib})
|
||||
The shared library specified by @var{solib} has been unloaded.
|
||||
@end deftypefun
|
||||
Index: gdb-6.5/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 04:00:05.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 04:20:40.000000000 -0300
|
||||
@@ -802,11 +802,23 @@ iterate_over_lwps (int (*callback) (stru
|
||||
{
|
||||
struct lwp_info *lp, *lpnext;
|
||||
|
||||
- for (lp = lwp_list; lp; lp = lpnext)
|
||||
+ if (lwp_list != NULL)
|
||||
{
|
||||
- lpnext = lp->next;
|
||||
+ for (lp = lwp_list; lp; lp = lpnext)
|
||||
+ {
|
||||
+ lpnext = lp->next;
|
||||
+ if ((*callback) (lp, data))
|
||||
+ return lp;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* We are calling iterate_over_lwps for a non-threaded program.
|
||||
+ Initialize the lwp list to the inferior's ptid. */
|
||||
+ lp = add_lwp (BUILD_LWP (GET_PID (inferior_ptid),
|
||||
+ GET_PID (inferior_ptid)));
|
||||
if ((*callback) (lp, data))
|
||||
- return lp;
|
||||
+ return lp;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -3262,6 +3274,18 @@ linux_nat_add_target (struct target_ops
|
||||
thread_db_init (t);
|
||||
}
|
||||
|
||||
+/* Observer function for a mourn inferior event. This is needed
|
||||
+ because if iterate_over_lwps is called for a non-threaded program
|
||||
+ to handle watchpoints, the lwp list gets initialized but there is
|
||||
+ no corresponding clean-up when the inferior is detached. In
|
||||
+ a threaded program, the observer is simply redundant as the
|
||||
+ same clean-up gets done in linux_nat_mourn_inferior. */
|
||||
+static void
|
||||
+linux_nat_mourn_inferior_observer (struct target_ops *objfile)
|
||||
+{
|
||||
+ init_lwp_list ();
|
||||
+}
|
||||
+
|
||||
void
|
||||
_initialize_linux_nat (void)
|
||||
{
|
||||
@@ -3276,6 +3300,8 @@ Specify any of the following keywords fo
|
||||
status -- list a different bunch of random process info.\n\
|
||||
all -- list all available /proc info."));
|
||||
|
||||
+ observer_attach_mourn_inferior (linux_nat_mourn_inferior_observer);
|
||||
+
|
||||
/* Save the original signal mask. */
|
||||
sigprocmask (SIG_SETMASK, NULL, &normal_mask);
|
||||
|
||||
Index: gdb-6.5/gdb/target.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/target.c 2006-07-07 03:52:38.000000000 -0300
|
||||
+++ gdb-6.5/gdb/target.c 2006-07-07 04:19:00.000000000 -0300
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "regcache.h"
|
||||
#include "gdb_assert.h"
|
||||
#include "gdbcore.h"
|
||||
+#include "observer.h"
|
||||
|
||||
static void target_info (char *, int);
|
||||
|
||||
@@ -267,6 +268,13 @@ target_load (char *arg, int from_tty)
|
||||
(*current_target.to_load) (arg, from_tty);
|
||||
}
|
||||
|
||||
+void
|
||||
+target_mourn_inferior (void)
|
||||
+{
|
||||
+ (*current_target.to_mourn_inferior) ();
|
||||
+ observer_notify_mourn_inferior (¤t_target);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
|
||||
struct target_ops *t)
|
||||
Index: gdb-6.5/gdb/target.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/target.h 2006-07-07 03:52:40.000000000 -0300
|
||||
+++ gdb-6.5/gdb/target.h 2006-07-07 04:19:00.000000000 -0300
|
||||
@@ -783,8 +783,7 @@ int target_follow_fork (int follow_child
|
||||
|
||||
/* The inferior process has died. Do what is right. */
|
||||
|
||||
-#define target_mourn_inferior() \
|
||||
- (*current_target.to_mourn_inferior) ()
|
||||
+extern void target_mourn_inferior (void);
|
||||
|
||||
/* Does target have enough data to do a run or attach command? */
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,28 +0,0 @@
|
|||
2004-11-24 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* printcmd.c (build_address_symbolic): Find a section for the
|
||||
address.
|
||||
|
||||
--- ./gdb/printcmd.c.1 2004-11-24 17:54:27.316295608 -0500
|
||||
+++ ./gdb/printcmd.c 2004-11-24 17:59:20.069790312 -0500
|
||||
@@ -615,6 +615,20 @@
|
||||
addr = overlay_mapped_address (addr, section);
|
||||
}
|
||||
}
|
||||
+ /* To ensure that the symbol returned belongs to the correct setion
|
||||
+ (and that the last [random] symbol from the previous section
|
||||
+ isn't returned) try to find the section containing PC. First try
|
||||
+ the overlay code (which by default returns NULL); and second try
|
||||
+ the normal section code (which almost always succeeds). */
|
||||
+ section = find_pc_overlay (addr);
|
||||
+ if (section == NULL)
|
||||
+ {
|
||||
+ struct obj_section *obj_section = find_pc_section (addr);
|
||||
+ if (obj_section == NULL)
|
||||
+ section = NULL;
|
||||
+ else
|
||||
+ section = obj_section->the_bfd_section;
|
||||
+ }
|
||||
|
||||
/* First try to find the address in the symbol table, then
|
||||
in the minsyms. Take the closest one. */
|
|
@ -1,99 +0,0 @@
|
|||
2004-10-26 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* blockframe.c (find_pc_function): Use find_pc_section to find the
|
||||
pc's section.
|
||||
* block.c, symfile.c: Ditto.
|
||||
|
||||
*** ./gdb/blockframe.c.1 2004-10-26 21:21:46.517866240 -0400
|
||||
--- ./gdb/blockframe.c 2004-10-26 21:24:16.345089040 -0400
|
||||
***************
|
||||
*** 288,294 ****
|
||||
struct symbol *
|
||||
find_pc_function (CORE_ADDR pc)
|
||||
{
|
||||
! return find_pc_sect_function (pc, find_pc_mapped_section (pc));
|
||||
}
|
||||
|
||||
/* These variables are used to cache the most recent result
|
||||
--- 288,311 ----
|
||||
struct symbol *
|
||||
find_pc_function (CORE_ADDR pc)
|
||||
{
|
||||
! struct bfd_section *section;
|
||||
! struct symbol *symbol;
|
||||
! /* To ensure that the symbol returned belongs to the correct setion
|
||||
! (and that the last [random] symbol from the previous section
|
||||
! isn't returned) try to find the section containing PC. First try
|
||||
! the overlay code (which by default returns NULL); and second try
|
||||
! the normal section code (which almost always succeeds). */
|
||||
! section = find_pc_overlay (pc);
|
||||
! if (section == NULL)
|
||||
! {
|
||||
! struct obj_section *obj_section = find_pc_section (pc);
|
||||
! if (obj_section == NULL)
|
||||
! section = NULL;
|
||||
! else
|
||||
! section = obj_section->the_bfd_section;
|
||||
! }
|
||||
! symbol = find_pc_sect_function (pc, section);
|
||||
! return symbol;
|
||||
}
|
||||
|
||||
/* These variables are used to cache the most recent result
|
||||
--- ./gdb/symtab.c.1 2004-10-26 22:47:13.650423616 -0400
|
||||
+++ ./gdb/symtab.c 2004-10-26 22:50:10.239577984 -0400
|
||||
@@ -2176,7 +2176,20 @@
|
||||
{
|
||||
asection *section;
|
||||
|
||||
+ /* To ensure that the symbol returned belongs to the correct setion
|
||||
+ (and that the last [random] symbol from the previous section
|
||||
+ isn't returned) try to find the section containing PC. First try
|
||||
+ the overlay code (which by default returns NULL); and second try
|
||||
+ the normal section code (which almost always succeeds). */
|
||||
section = find_pc_overlay (pc);
|
||||
+ if (section == NULL)
|
||||
+ {
|
||||
+ struct obj_section *obj_section = find_pc_section (pc);
|
||||
+ if (obj_section == NULL)
|
||||
+ section = NULL;
|
||||
+ else
|
||||
+ section = obj_section->the_bfd_section;
|
||||
+ }
|
||||
if (pc_in_unmapped_range (pc, section))
|
||||
pc = overlay_mapped_address (pc, section);
|
||||
return find_pc_sect_line (pc, section, notcurrent);
|
||||
--- ./gdb/block.c.1 2004-10-27 00:22:56.881319808 -0400
|
||||
+++ ./gdb/block.c 2004-10-27 00:24:17.364084568 -0400
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "symfile.h"
|
||||
#include "gdb_obstack.h"
|
||||
#include "cp-support.h"
|
||||
+#include "objfiles.h"
|
||||
|
||||
/* This is used by struct block to store namespace-related info for
|
||||
C++ files, namely using declarations and the current namespace in
|
||||
@@ -153,7 +154,22 @@
|
||||
struct block *
|
||||
block_for_pc (CORE_ADDR pc)
|
||||
{
|
||||
- return block_for_pc_sect (pc, find_pc_mapped_section (pc));
|
||||
+ struct bfd_section *section;
|
||||
+ /* To ensure that the symbol returned belongs to the correct setion
|
||||
+ (and that the last [random] symbol from the previous section
|
||||
+ isn't returned) try to find the section containing PC. First try
|
||||
+ the overlay code (which by default returns NULL); and second try
|
||||
+ the normal section code (which almost always succeeds). */
|
||||
+ section = find_pc_overlay (pc);
|
||||
+ if (section == NULL)
|
||||
+ {
|
||||
+ struct obj_section *obj_section = find_pc_section (pc);
|
||||
+ if (obj_section == NULL)
|
||||
+ section = NULL;
|
||||
+ else
|
||||
+ section = obj_section->the_bfd_section;
|
||||
+ }
|
||||
+ return block_for_pc_sect (pc, section);
|
||||
}
|
||||
|
||||
/* Now come some functions designed to deal with C++ namespace issues.
|
|
@ -1,112 +0,0 @@
|
|||
2004-06-22 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* rs6000-tdep.c (struct rs6000_framedata): Add field "func_start".
|
||||
(skip_prologue): Delete local variable "orig_pc", use
|
||||
"func_start". Add local variable "num_skip_linux_syscall_insn",
|
||||
use to skip over first half of a GNU/Linux syscall and update
|
||||
"func_start".
|
||||
|
||||
Index: gdb-6.5/gdb/rs6000-tdep.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/rs6000-tdep.c 2006-07-11 02:57:24.000000000 -0300
|
||||
+++ gdb-6.5/gdb/rs6000-tdep.c 2006-07-11 12:32:05.000000000 -0300
|
||||
@@ -76,6 +76,7 @@
|
||||
|
||||
struct rs6000_framedata
|
||||
{
|
||||
+ CORE_ADDR func_start; /* True function start. */
|
||||
int offset; /* total size of frame --- the distance
|
||||
by which we decrement sp to allocate
|
||||
the frame */
|
||||
@@ -905,7 +906,6 @@ store_param_on_stack_p (unsigned long op
|
||||
static CORE_ADDR
|
||||
skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
|
||||
{
|
||||
- CORE_ADDR orig_pc = pc;
|
||||
CORE_ADDR last_prologue_pc = pc;
|
||||
CORE_ADDR li_found_pc = 0;
|
||||
gdb_byte buf[4];
|
||||
@@ -923,6 +923,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
|
||||
int minimal_toc_loaded = 0;
|
||||
int prev_insn_was_prologue_insn = 1;
|
||||
int num_skip_non_prologue_insns = 0;
|
||||
+ int num_skip_ppc64_gnu_linux_syscall_insn = 0;
|
||||
int r0_contains_arg = 0;
|
||||
const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch);
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
|
||||
@@ -943,6 +944,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
|
||||
lim_pc = refine_prologue_limit (pc, lim_pc);
|
||||
|
||||
memset (fdata, 0, sizeof (struct rs6000_framedata));
|
||||
+ fdata->func_start = pc;
|
||||
fdata->saved_gpr = -1;
|
||||
fdata->saved_fpr = -1;
|
||||
fdata->saved_vr = -1;
|
||||
@@ -971,6 +973,55 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
|
||||
break;
|
||||
op = extract_signed_integer (buf, 4);
|
||||
|
||||
+ /* A PPC64 GNU/Linux system call function is split into two
|
||||
+ sub-functions: a non-threaded fast-path (__NAME_nocancel)
|
||||
+ which does not use a frame; and a threaded slow-path
|
||||
+ (Lpseudo_cancel) that does create a frame. Ref:
|
||||
+ nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
|
||||
+
|
||||
+ *INDENT-OFF*
|
||||
+ NAME:
|
||||
+ SINGLE_THREAD_P
|
||||
+ bne- .Lpseudo_cancel
|
||||
+ __NAME_nocancel:
|
||||
+ li r0,162
|
||||
+ sc
|
||||
+ bnslr+
|
||||
+ b 0x7fe014ef64 <.__syscall_error>
|
||||
+ Lpseudo_cancel:
|
||||
+ stdu r1,-128(r1)
|
||||
+ ...
|
||||
+ *INDENT-ON*
|
||||
+
|
||||
+ Unfortunatly, because the latter case uses a local label (not
|
||||
+ in the symbol table) a PC in "Lpseudo_cancel" appears to be
|
||||
+ in "__NAME_nocancel". The following code recognizes this,
|
||||
+ adjusting FUNC_START to point to where "Lpseudo_cancel"
|
||||
+ should be, and parsing the prologue sequence as if
|
||||
+ "Lpseudo_cancel" was the entry point. */
|
||||
+
|
||||
+ if (((op & 0xffff0000) == 0x38000000 /* li r0,N */
|
||||
+ && pc == fdata->func_start + 0
|
||||
+ && num_skip_ppc64_gnu_linux_syscall_insn == 0)
|
||||
+ || (op == 0x44000002 /* sc */
|
||||
+ && pc == fdata->func_start + 4
|
||||
+ && num_skip_ppc64_gnu_linux_syscall_insn == 1)
|
||||
+ || (op == 0x4ca30020 /* bnslr+ */
|
||||
+ && pc == fdata->func_start + 8
|
||||
+ && num_skip_ppc64_gnu_linux_syscall_insn == 2))
|
||||
+ {
|
||||
+ num_skip_ppc64_gnu_linux_syscall_insn++;
|
||||
+ continue;
|
||||
+ }
|
||||
+ else if ((op & 0xfc000003) == 0x48000000 /* b __syscall_error */
|
||||
+ && pc == fdata->func_start + 12
|
||||
+ && num_skip_ppc64_gnu_linux_syscall_insn == 3)
|
||||
+ {
|
||||
+ num_skip_ppc64_gnu_linux_syscall_insn = -1;
|
||||
+ fdata->func_start = pc;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
if ((op & 0xfc1fffff) == 0x7c0802a6)
|
||||
{ /* mflr Rx */
|
||||
/* Since shared library / PIC code, which needs to get its
|
||||
@@ -1138,9 +1189,9 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
|
||||
we have no line table information or the line info tells
|
||||
us that the subroutine call is not part of the line
|
||||
associated with the prologue. */
|
||||
- if ((pc - orig_pc) > 8)
|
||||
+ if ((pc - fdata->func_start) > 8)
|
||||
{
|
||||
- struct symtab_and_line prologue_sal = find_pc_line (orig_pc, 0);
|
||||
+ struct symtab_and_line prologue_sal = find_pc_line (fdata->func_start, 0);
|
||||
struct symtab_and_line this_sal = find_pc_line (pc, 0);
|
||||
|
||||
if ((prologue_sal.line == 0) || (prologue_sal.line != this_sal.line))
|
|
@ -1,66 +0,0 @@
|
|||
2004-10-22 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* solib-svr4.c (enable_break): Convert a symbol descriptor into
|
||||
the corresponding function entry point.
|
||||
(solib_break_names): Delete "._dl_debug_state", no longer needed.
|
||||
|
||||
*** ./gdb/solib-svr4.c.dist Fri Oct 22 11:50:31 2004
|
||||
--- ./gdb/solib-svr4.c Fri Oct 22 11:53:19 2004
|
||||
***************
|
||||
*** 86,102 ****
|
||||
"_dl_debug_state",
|
||||
"rtld_db_dlactivity",
|
||||
"_rtld_debug_state",
|
||||
-
|
||||
- /* On the 64-bit PowerPC, the linker symbol with the same name as
|
||||
- the C function points to a function descriptor, not to the entry
|
||||
- point. The linker symbol whose name is the C function name
|
||||
- prefixed with a '.' points to the function's entry point. So
|
||||
- when we look through this table, we ignore symbols that point
|
||||
- into the data section (thus skipping the descriptor's symbol),
|
||||
- and eventually try this one, giving us the real entry point
|
||||
- address. */
|
||||
- "._dl_debug_state",
|
||||
-
|
||||
NULL
|
||||
};
|
||||
|
||||
--- 86,91 ----
|
||||
***************
|
||||
*** 1284,1301 ****
|
||||
/* Now try to set a breakpoint in the dynamic linker. */
|
||||
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
|
||||
{
|
||||
! /* On ABI's that use function descriptors, there are usually
|
||||
! two linker symbols associated with each C function: one
|
||||
! pointing at the actual entry point of the machine code,
|
||||
! and one pointing at the function's descriptor. The
|
||||
! latter symbol has the same name as the C function.
|
||||
!
|
||||
! What we're looking for here is the machine code entry
|
||||
! point, so we are only interested in symbols in code
|
||||
! sections. */
|
||||
! sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep, SEC_CODE);
|
||||
if (sym_addr != 0)
|
||||
! break;
|
||||
}
|
||||
|
||||
/* We're done with both the temporary bfd and target. Remember,
|
||||
--- 1273,1289 ----
|
||||
/* Now try to set a breakpoint in the dynamic linker. */
|
||||
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
|
||||
{
|
||||
! sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep, 0);
|
||||
if (sym_addr != 0)
|
||||
! {
|
||||
! /* The symbol might be a descriptor, convert to into the
|
||||
! corresponding code address. */
|
||||
! sym_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
|
||||
! sym_addr,
|
||||
! tmp_bfd_target);
|
||||
! if (sym_addr != 0)
|
||||
! break;
|
||||
! }
|
||||
}
|
||||
|
||||
/* We're done with both the temporary bfd and target. Remember,
|
|
@ -1,86 +0,0 @@
|
|||
2004-11-18 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* dwarf2read.c: Include "top.c".
|
||||
(dwarf2_has_info): Check for readnever_symbol_files.
|
||||
* symfile.c (readnever_symbol_files): Define.
|
||||
* top.h (readnever_symbol_files): Declare.
|
||||
* main.c (captured_main): Add --readnever option.
|
||||
(print_gdb_help): Ditto.
|
||||
|
||||
2004-11-18 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* gdb.texinfo (File Options): Document --readnever.
|
||||
|
||||
--- gdb-6.3/gdb/doc/gdb.texinfo.fix 2005-09-07 13:32:23.000000000 -0400
|
||||
+++ gdb-6.3/gdb/doc/gdb.texinfo 2005-09-07 13:33:21.000000000 -0400
|
||||
@@ -952,6 +952,12 @@ Read each symbol file's entire symbol ta
|
||||
the default, which is to read it incrementally as it is needed.
|
||||
This makes startup slower, but makes future operations faster.
|
||||
|
||||
+@item --readnever
|
||||
+@cindex @code{--readnever}
|
||||
+Do not read each symbol file's symbolic debug information. This makes
|
||||
+startup faster but at the expense of not being able to perform
|
||||
+symbolic debugging.
|
||||
+
|
||||
@end table
|
||||
|
||||
You typically combine the @code{-mapped} and @code{-readnow} options in
|
||||
--- gdb-6.3/gdb/main.c.fix 2005-09-07 13:31:43.000000000 -0400
|
||||
+++ gdb-6.3/gdb/main.c 2005-09-07 13:33:21.000000000 -0400
|
||||
@@ -250,6 +250,7 @@ captured_main (void *data)
|
||||
{"xdb", no_argument, &xdb_commands, 1},
|
||||
{"dbx", no_argument, &dbx_commands, 1},
|
||||
{"readnow", no_argument, &readnow_symbol_files, 1},
|
||||
+ {"readnever", no_argument, &readnever_symbol_files, 1},
|
||||
{"r", no_argument, &readnow_symbol_files, 1},
|
||||
{"quiet", no_argument, &quiet, 1},
|
||||
{"q", no_argument, &quiet, 1},
|
||||
@@ -861,6 +862,7 @@ Options:\n\n\
|
||||
fputs_unfiltered (_(" file.\n\
|
||||
--quiet Do not print version number on startup.\n\
|
||||
--readnow Fully read symbol files on first access.\n\
|
||||
+ --readnever Do not read symbol files.\n\
|
||||
"), stream);
|
||||
fputs_unfiltered (_("\
|
||||
--se=FILE Use FILE as symbol file and executable file.\n\
|
||||
--- gdb-6.3/gdb/symfile.c.fix 2005-09-07 13:31:48.000000000 -0400
|
||||
+++ gdb-6.3/gdb/symfile.c 2005-09-07 13:33:21.000000000 -0400
|
||||
@@ -75,6 +75,7 @@ static void clear_symtab_users_cleanup (
|
||||
|
||||
/* Global variables owned by this file */
|
||||
int readnow_symbol_files; /* Read full symbols immediately */
|
||||
+int readnever_symbol_files; /* Never read full symbols. */
|
||||
|
||||
/* External variables and functions referenced. */
|
||||
|
||||
--- gdb-6.3/gdb/dwarf2read.c.fix 2005-09-07 13:31:58.000000000 -0400
|
||||
+++ gdb-6.3/gdb/dwarf2read.c 2005-09-07 13:34:03.000000000 -0400
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "dwarf2loc.h"
|
||||
#include "cp-support.h"
|
||||
#include "hashtab.h"
|
||||
+#include "top.h"
|
||||
#include "command.h"
|
||||
#include "gdbcmd.h"
|
||||
|
||||
@@ -1100,7 +1101,8 @@ dwarf2_has_info (struct objfile *objfile
|
||||
dwarf_loc_section = 0;
|
||||
|
||||
bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
|
||||
- return (dwarf_info_section != NULL && dwarf_abbrev_section != NULL);
|
||||
+ return (!readnever_symbol_files
|
||||
+ && dwarf_info_section != NULL && dwarf_abbrev_section != NULL);
|
||||
}
|
||||
|
||||
/* This function is mapped across the sections and remembers the
|
||||
--- gdb-6.3/gdb/top.h.fix 2005-09-07 13:32:08.000000000 -0400
|
||||
+++ gdb-6.3/gdb/top.h 2005-09-07 13:33:21.000000000 -0400
|
||||
@@ -57,6 +57,7 @@ extern void set_prompt (char *);
|
||||
|
||||
/* From random places. */
|
||||
extern int readnow_symbol_files;
|
||||
+extern int readnever_symbol_files;
|
||||
|
||||
/* Perform _initialize initialization */
|
||||
extern void gdb_init (char *);
|
|
@ -1,29 +0,0 @@
|
|||
2004-11-30 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* breakpoint.c (remove_breakpoints): Continue removing breakpoints
|
||||
even if an error occurs. Remove a failure code for the last failure
|
||||
only.
|
||||
|
||||
--- gdb+dejagnu-20040607/gdb/breakpoint.c.fix2 Tue Nov 30 18:01:33 2004
|
||||
+++ gdb+dejagnu-20040607/gdb/breakpoint.c Tue Nov 30 18:06:01 2004
|
||||
@@ -1297,6 +1297,7 @@ remove_breakpoints (void)
|
||||
{
|
||||
struct bp_location *b;
|
||||
int val;
|
||||
+ int return_val = 0;
|
||||
|
||||
ALL_BP_LOCATIONS (b)
|
||||
{
|
||||
@@ -1304,10 +1305,10 @@ remove_breakpoints (void)
|
||||
{
|
||||
val = remove_breakpoint (b, mark_uninserted);
|
||||
if (val != 0)
|
||||
- return val;
|
||||
+ return_val = val;
|
||||
}
|
||||
}
|
||||
- return 0;
|
||||
+ return return_val;
|
||||
}
|
||||
|
||||
int
|
|
@ -1,28 +0,0 @@
|
|||
--- /dev/null 2004-12-02 09:02:32.308608576 -0500
|
||||
+++ ./gdb/doc/ChangeLog.RedHat 2004-12-02 10:25:01.938353424 -0500
|
||||
@@ -0,0 +1,11 @@
|
||||
+2004-12-02 Andrew Cagney <cagney@redhat.com>
|
||||
+
|
||||
+ * New file.
|
||||
+
|
||||
+
|
||||
+Local Variables:
|
||||
+mode: change-log
|
||||
+left-margin: 8
|
||||
+fill-column: 74
|
||||
+version-control: never
|
||||
+End:
|
||||
--- /dev/null 2004-12-02 09:02:32.308608576 -0500
|
||||
+++ ./gdb/ChangeLog.RedHat 2004-12-02 10:45:45.430313912 -0500
|
||||
@@ -0,0 +1,11 @@
|
||||
+2004-12-02 Andrew Cagney <cagney@redhat.com>
|
||||
+
|
||||
+ * New file.
|
||||
+
|
||||
+
|
||||
+Local Variables:
|
||||
+mode: change-log
|
||||
+left-margin: 8
|
||||
+fill-column: 74
|
||||
+version-control: never
|
||||
+End:
|
|
@ -1,22 +0,0 @@
|
|||
2003-07-11 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* lib/gdb.exp (setup_kfail, kfail): Redefine procedures.
|
||||
|
||||
--- ./gdb/testsuite/lib/gdb.exp.1 2004-11-24 15:59:46.131394720 -0500
|
||||
+++ ./gdb/testsuite/lib/gdb.exp 2004-11-24 16:01:06.304206600 -0500
|
||||
@@ -63,6 +63,15 @@
|
||||
|
||||
### Only procedures should come after this point.
|
||||
|
||||
+if {![llength [info procs kfail]]} {
|
||||
+ proc setup_kfail { args } {
|
||||
+ #setup_xfail args
|
||||
+ }
|
||||
+ proc kfail { bugid message } {
|
||||
+ fail $message
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#
|
||||
# gdb_version -- extract and print the version number of GDB
|
||||
#
|
|
@ -1,76 +0,0 @@
|
|||
2003-11-17 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
From Jeff Johnston <jjohnstn@redhat.com>
|
||||
* gdb.arch/ia64-libunwind.exp: New file.
|
||||
* gdb.arch/ia64-libunwind.c: New file.
|
||||
|
||||
--- /dev/null Thu Apr 11 10:25:15 2002
|
||||
+++ gdb+dejagnu-20040223/gdb/testsuite/gdb.arch/ia64-libunwind.exp Mon Nov 17 15:57:04 2003
|
||||
@@ -0,0 +1,55 @@
|
||||
+# Copyright 2003 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+# This file was written by Jeff Johnston (jjohnstn@redhat.com)
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+#
|
||||
+# test running programs
|
||||
+#
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+if ![istarget "ia64-*-*"] then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "ia64-libunwind"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+send_gdb "set debug arch 1\n"
|
||||
+send_gdb "break main\n"
|
||||
+gdb_test "run" ".*acquire_unwind_info.*"
|
||||
+
|
||||
--- /dev/null Thu Apr 11 10:25:15 2002
|
||||
+++ gdb+dejagnu-20040223/gdb/testsuite/gdb.arch/ia64-libunwind.c Mon Nov 17 15:58:27 2003
|
||||
@@ -0,0 +1,9 @@
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ printf ("hello world\n");
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
|
@ -1,14 +0,0 @@
|
|||
2004-08-03 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.arch/ia64-libunwind.exp: Fix test string to match
|
||||
current code base.
|
||||
|
||||
--- gdb+dejagnu-20040607/gdb/testsuite/gdb.arch/ia64-libunwind.exp.fix Tue Aug 3 18:29:22 2004
|
||||
+++ gdb+dejagnu-20040607/gdb/testsuite/gdb.arch/ia64-libunwind.exp Tue Aug 3 18:41:01 2004
|
||||
@@ -51,5 +51,5 @@ gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
send_gdb "set debug arch 1\n"
|
||||
send_gdb "break main\n"
|
||||
-gdb_test "run" ".*acquire_unwind_info.*"
|
||||
+gdb_test "run" ".*ia64_find_proc_info_x.*"
|
||||
|
|
@ -1,17 +1,38 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Elena Zannoni <ezannoni@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-rh-testversion-20041202.patch
|
||||
|
||||
;; Match the Fedora's version info.
|
||||
;;=fedora
|
||||
|
||||
2003-02-24 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* gdb.gdb/selftest.exp: Add matching on specific Red Hat only version
|
||||
string.
|
||||
|
||||
--- ./gdb/testsuite/gdb.gdb/selftest.exp.1 Fri Jul 11 09:44:09 2003
|
||||
+++ ./gdb/testsuite/gdb.gdb/selftest.exp Fri Jul 11 09:44:16 2003
|
||||
@@ -314,7 +314,10 @@ proc test_with_self { executable } {
|
||||
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
--- a/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
@@ -53,6 +53,9 @@ proc test_with_self { } {
|
||||
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
|
||||
pass "printed version with cast"
|
||||
}
|
||||
+ -re ".\[0-9\]+ = .Red Hat Linux \[\\(\\)0-9.a-z\\-\]+.*$gdb_prompt $" {
|
||||
+ pass "printed version Red Had Linux only"
|
||||
+ -re ".\[0-9\]+ = .(Fedora|Red Hat Enterprise Linux) \[\\(\\)0-9.a-z\\-\]+.*$gdb_prompt $" {
|
||||
+ pass "printed version Fedora or Red Hat Enterprise Linux only"
|
||||
+ }
|
||||
-re ".*$gdb_prompt $" { fail "printed version" }
|
||||
timeout { fail "(timeout) printed version" }
|
||||
}
|
||||
|
||||
# start the "xgdb" process
|
||||
diff --git a/gdb/top.c b/gdb/top.c
|
||||
--- a/gdb/top.c
|
||||
+++ b/gdb/top.c
|
||||
@@ -2163,7 +2163,7 @@ init_gdb_version_vars (void)
|
||||
struct internalvar *major_version_var = create_internalvar ("_gdb_major");
|
||||
struct internalvar *minor_version_var = create_internalvar ("_gdb_minor");
|
||||
int vmajor = 0, vminor = 0, vrevision = 0;
|
||||
- sscanf (version, "%d.%d.%d", &vmajor, &vminor, &vrevision);
|
||||
+ sscanf (version, "Fedora %d.%d.%d", &vmajor, &vminor, &vrevision);
|
||||
set_internalvar_integer (major_version_var, vmajor);
|
||||
set_internalvar_integer (minor_version_var, vminor + (vrevision > 0));
|
||||
}
|
||||
|
|
|
@ -1,207 +0,0 @@
|
|||
2005-06-09 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.base/gdbinit.exp: New testcase.
|
||||
* gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
|
||||
|
||||
2005-06-08 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* Makefile.in (cli-cmds.o): Update.
|
||||
* configure.in: Add check for getuid.
|
||||
* configure: Regenerated.
|
||||
* config.in: Ditto.
|
||||
* main.c (captured_main): Pass -1 to source_command when loading
|
||||
gdbinit files.
|
||||
* cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
|
||||
(source_command): Update documentation. Check permissions if
|
||||
FROM_TTY is -1.
|
||||
|
||||
Index: gdb-6.5/gdb/cli/cli-cmds.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/cli/cli-cmds.c 2006-07-11 03:22:45.000000000 -0300
|
||||
+++ gdb-6.5/gdb/cli/cli-cmds.c 2006-07-11 03:26:36.000000000 -0300
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "objfiles.h"
|
||||
#include "source.h"
|
||||
#include "disasm.h"
|
||||
+#include "gdb_stat.h"
|
||||
|
||||
#include "ui-out.h"
|
||||
|
||||
@@ -453,12 +454,31 @@ source_command (char *args, int from_tty
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
- if (from_tty)
|
||||
+ if (from_tty > 0)
|
||||
perror_with_name (file);
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
+#ifdef HAVE_GETUID
|
||||
+ if (from_tty == -1)
|
||||
+ {
|
||||
+ struct stat statbuf;
|
||||
+ if (fstat (fd, &statbuf) < 0)
|
||||
+ {
|
||||
+ perror_with_name (file);
|
||||
+ close (fd);
|
||||
+ return;
|
||||
+ }
|
||||
+ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
|
||||
+ {
|
||||
+ warning (_("not using untrusted file \"%s\""), file);
|
||||
+ close (fd);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
stream = fdopen (fd, FOPEN_RT);
|
||||
script_from_file (stream, file);
|
||||
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.base/gdbinit.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/gdbinit.exp 2006-07-11 03:22:48.000000000 -0300
|
||||
@@ -0,0 +1,98 @@
|
||||
+# Copyright 2005
|
||||
+# Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+# are we on a target board
|
||||
+if [is_remote target] {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+
|
||||
+global verbose
|
||||
+global GDB
|
||||
+global GDBFLAGS
|
||||
+global gdb_prompt
|
||||
+global timeout
|
||||
+global gdb_spawn_id;
|
||||
+
|
||||
+gdb_stop_suppressing_tests;
|
||||
+
|
||||
+verbose "Spawning $GDB -nw"
|
||||
+
|
||||
+if [info exists gdb_spawn_id] {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+if ![is_remote host] {
|
||||
+ if { [which $GDB] == 0 } then {
|
||||
+ perror "$GDB does not exist."
|
||||
+ exit 1
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set env(HOME) [pwd]
|
||||
+remote_exec build "rm .gdbinit"
|
||||
+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
|
||||
+remote_exec build "chmod 646 .gdbinit"
|
||||
+
|
||||
+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
|
||||
+if { $res < 0 || $res == "" } {
|
||||
+ perror "Spawning $GDB failed."
|
||||
+ return 1;
|
||||
+}
|
||||
+gdb_expect 360 {
|
||||
+ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
|
||||
+ pass "untrusted .gdbinit caught."
|
||||
+ }
|
||||
+ -re "$gdb_prompt $" {
|
||||
+ fail "untrusted .gdbinit caught."
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "(timeout) untrusted .gdbinit caught."
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+remote_exec build "chmod 644 .gdbinit"
|
||||
+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
|
||||
+if { $res < 0 || $res == "" } {
|
||||
+ perror "Spawning $GDB failed."
|
||||
+ return 1;
|
||||
+}
|
||||
+gdb_expect 360 {
|
||||
+ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
|
||||
+ fail "trusted .gdbinit allowed."
|
||||
+ }
|
||||
+ -re "in gdbinit.*$gdb_prompt $" {
|
||||
+ pass "trusted .gdbinit allowed."
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "(timeout) trusted .gdbinit allowed."
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+remote_exec build "rm .gdbinit"
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.base/gdbinit.sample
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/gdbinit.sample 2006-07-11 03:22:48.000000000 -0300
|
||||
@@ -0,0 +1 @@
|
||||
+echo "\nin gdbinit"
|
||||
Index: gdb-6.5/gdb/main.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/main.c 2006-07-11 03:22:45.000000000 -0300
|
||||
+++ gdb-6.5/gdb/main.c 2006-07-11 03:27:03.000000000 -0300
|
||||
@@ -643,7 +643,7 @@ extern int gdbtk_test (char *);
|
||||
|
||||
if (!inhibit_gdbinit)
|
||||
{
|
||||
- catch_command_errors (source_command, homeinit, 0, RETURN_MASK_ALL);
|
||||
+ catch_command_errors (source_command, homeinit, -1, RETURN_MASK_ALL);
|
||||
}
|
||||
|
||||
/* Do stats; no need to do them elsewhere since we'll only
|
||||
@@ -730,7 +730,7 @@ extern int gdbtk_test (char *);
|
||||
|| memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
|
||||
if (!inhibit_gdbinit)
|
||||
{
|
||||
- catch_command_errors (source_command, gdbinit, 0, RETURN_MASK_ALL);
|
||||
+ catch_command_errors (source_command, gdbinit, -1, RETURN_MASK_ALL);
|
||||
}
|
||||
|
||||
for (i = 0; i < ncmd; i++)
|
||||
Index: gdb-6.5/gdb/Makefile.in
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/Makefile.in 2006-07-11 03:22:45.000000000 -0300
|
||||
+++ gdb-6.5/gdb/Makefile.in 2006-07-11 03:22:48.000000000 -0300
|
||||
@@ -2859,7 +2859,7 @@ cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(d
|
||||
$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
|
||||
$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
|
||||
$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
|
||||
- $(tui_h)
|
||||
+ $(tui_h) $(gdb_stat_h)
|
||||
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
|
||||
cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
|
||||
$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
|
|
@ -1,85 +0,0 @@
|
|||
2005-04-02 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* symfile.c (separate_debug_file_exists): When the CRCs mismatch
|
||||
print a warning.
|
||||
(find_separate_debug_file): Pass in the objfile's name.
|
||||
|
||||
--- ../gdb-6.3/./gdb/symfile.c 2005-04-02 16:02:22.000000000 -0500
|
||||
+++ ./gdb/symfile.c 2005-04-02 13:05:10.000000000 -0500
|
||||
@@ -1043,7 +1043,8 @@
|
||||
}
|
||||
|
||||
static int
|
||||
-separate_debug_file_exists (const char *name, unsigned long crc)
|
||||
+separate_debug_file_exists (const char *name, unsigned long crc,
|
||||
+ const char *parent_name)
|
||||
{
|
||||
unsigned long file_crc = 0;
|
||||
int fd;
|
||||
@@ -1052,6 +1053,12 @@
|
||||
|
||||
fd = open (name, O_RDONLY | O_BINARY);
|
||||
if (fd < 0)
|
||||
+ /* Fail silently, this preserves existing behavior. The
|
||||
+ assumption here is that the file wasn't found because there's
|
||||
+ no file to find (we shouldn't be printing warnings about
|
||||
+ missing debug info files when the user hasn't installed them).
|
||||
+ The alternative is to complain here - that better belongs in a
|
||||
+ warning. */
|
||||
return 0;
|
||||
|
||||
while ((count = read (fd, buffer, sizeof (buffer))) > 0)
|
||||
@@ -1059,7 +1066,16 @@
|
||||
|
||||
close (fd);
|
||||
|
||||
- return crc == file_crc;
|
||||
+ if (crc != file_crc)
|
||||
+ {
|
||||
+ warning (_("the debug information found in \"%s\""
|
||||
+ " does not match \"%s\" (CRC mismatch).\n"),
|
||||
+ name, parent_name);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* No worries! */
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
static char *debug_file_directory = NULL;
|
||||
@@ -1083,6 +1099,8 @@
|
||||
basename = get_debug_link_info (objfile, &crc32);
|
||||
|
||||
if (basename == NULL)
|
||||
+ /* There's no separate debug info, hence there's no way we could
|
||||
+ load it => no warning. */
|
||||
return NULL;
|
||||
|
||||
dir = xstrdup (objfile->name);
|
||||
@@ -1110,7 +1128,7 @@
|
||||
strcpy (debugfile, dir);
|
||||
strcat (debugfile, basename);
|
||||
|
||||
- if (separate_debug_file_exists (debugfile, crc32))
|
||||
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
|
||||
{
|
||||
xfree (basename);
|
||||
xfree (dir);
|
||||
@@ -1123,7 +1141,7 @@
|
||||
strcat (debugfile, "/");
|
||||
strcat (debugfile, basename);
|
||||
|
||||
- if (separate_debug_file_exists (debugfile, crc32))
|
||||
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
|
||||
{
|
||||
xfree (basename);
|
||||
xfree (dir);
|
||||
@@ -1136,7 +1154,7 @@
|
||||
strcat (debugfile, dir);
|
||||
strcat (debugfile, basename);
|
||||
|
||||
- if (separate_debug_file_exists (debugfile, crc32))
|
||||
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
|
||||
{
|
||||
xfree (basename);
|
||||
xfree (dir);
|
|
@ -1,58 +0,0 @@
|
|||
2004-06-21 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* i386-tdep.c (i386_gdbarch_init): Move the the dwarf2-frame
|
||||
sniffer registration to after the signal trampoline frame sniffer.
|
||||
* amd64-tdep.c (amd64_init_abi): Include "dwarf2-frame.h".
|
||||
Register the dwarf2-frame sniffer, but after the signal trampoline
|
||||
sniffer.
|
||||
|
||||
Index: ./gdb/amd64-tdep.c
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
|
||||
retrieving revision 1.15
|
||||
diff -p -u -r1.15 amd64-tdep.c
|
||||
--- ./gdb/amd64-tdep.c 7 Jun 2004 02:02:45 -0000 1.15
|
||||
+++ ./gdb/amd64-tdep.c 21 Jun 2004 20:16:34 -0000
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "regcache.h"
|
||||
#include "regset.h"
|
||||
#include "symfile.h"
|
||||
-
|
||||
+#include "dwarf2-frame.h"
|
||||
#include "gdb_assert.h"
|
||||
|
||||
#include "amd64-tdep.h"
|
||||
@@ -1171,6 +1171,8 @@ amd64_init_abi (struct gdbarch_info info
|
||||
set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
|
||||
|
||||
frame_unwind_append_sniffer (gdbarch, amd64_sigtramp_frame_sniffer);
|
||||
+ /* Hook in the DWARF CFI frame unwinder after sigtramp. */
|
||||
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
|
||||
frame_unwind_append_sniffer (gdbarch, amd64_frame_sniffer);
|
||||
frame_base_set_default (gdbarch, &amd64_frame_base);
|
||||
|
||||
Index: ./gdb/i386-tdep.c
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
|
||||
retrieving revision 1.197
|
||||
diff -p -u -r1.197 i386-tdep.c
|
||||
--- ./gdb/i386-tdep.c 18 Jun 2004 16:06:24 -0000 1.197
|
||||
+++ ./gdb/i386-tdep.c 21 Jun 2004 20:16:34 -0000
|
||||
@@ -2131,15 +2131,14 @@ i386_gdbarch_init (struct gdbarch_info i
|
||||
/* Helper for function argument information. */
|
||||
set_gdbarch_fetch_pointer_argument (gdbarch, i386_fetch_pointer_argument);
|
||||
|
||||
- /* Hook in the DWARF CFI frame unwinder. */
|
||||
- frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
|
||||
-
|
||||
frame_base_set_default (gdbarch, &i386_frame_base);
|
||||
|
||||
/* Hook in ABI-specific overrides, if they have been registered. */
|
||||
gdbarch_init_osabi (info, gdbarch);
|
||||
|
||||
frame_unwind_append_sniffer (gdbarch, i386_sigtramp_frame_sniffer);
|
||||
+ /* Hook in the DWARF CFI frame unwinder after sigtramp. */
|
||||
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
|
||||
frame_unwind_append_sniffer (gdbarch, i386_frame_sniffer);
|
||||
|
||||
/* If we have a register mapping, enable the generic core file
|
|
@ -1,433 +0,0 @@
|
|||
2005-02-11 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* target.h (target_waitstatus): Add new step_thread_exit flag.
|
||||
* infrun.c (init_execution_control_state): Initialize step_thread_exit.
|
||||
(handle_inferior_event): If step_thread_exit flag is set, print
|
||||
out special message and reset flag.
|
||||
(currently_stepping): Do not return true if step_thread_exit flag
|
||||
is set.
|
||||
* linux-nat.c (resume_callback): Use second parameter to notify
|
||||
if the resume should be a PTRACE_SINGLESTEP or PTRACE_CONT.
|
||||
(stop_and_resume_callback): Pass on data parameter to resume_callback.
|
||||
(linux_nat_resume): Don't attempt to resume if lp is NULL.
|
||||
(linux_nat_wait): Do not wait on step_lp as first wait. After
|
||||
wait, check if step_lp has an event or not. If the step lwp has
|
||||
exited, issue a stop on the first non-step_lp lwp in the lwp list.
|
||||
Change the delayed stop code to not ignore an intentional stop.
|
||||
If we see an event on an lwp which isn't the step_lp, verify if
|
||||
the step_lp has exited or not. Set the step_thread_exit flag if
|
||||
we have verified that the step_lp is gone.
|
||||
* testsuite/gdb.threads/step-thread-exit.c: New testcase.
|
||||
* testsuite/gdb.threads/step-thread-exit.exp: Ditto.
|
||||
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.c 2006-07-12 03:18:47.000000000 -0300
|
||||
@@ -0,0 +1,50 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
+ Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+#include <pthread.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+void *thread_function (void *ptr)
|
||||
+{
|
||||
+ int *x = (int *)ptr;
|
||||
+ printf("In thread_function, *x is %d\n", *x);
|
||||
+} /* thread_function_end */
|
||||
+
|
||||
+volatile int repeat = 0;
|
||||
+
|
||||
+main()
|
||||
+{
|
||||
+ int ret;
|
||||
+ pthread_t th;
|
||||
+ int i = 3;
|
||||
+
|
||||
+ ret = pthread_create (&th, NULL, thread_function, &i);
|
||||
+ do
|
||||
+ {
|
||||
+ repeat = 0;
|
||||
+ sleep (3); /* sleep */
|
||||
+ }
|
||||
+ while (repeat);
|
||||
+ pthread_join (th, NULL);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp 2006-07-12 03:22:30.000000000 -0300
|
||||
@@ -0,0 +1,113 @@
|
||||
+# This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+# Copyright 2005 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Check that GDB can step over a thread exit.
|
||||
+
|
||||
+if $tracelevel {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+set testfile "step-thread-exit"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+# Reset the debug file directory so we can't debug within the C library
|
||||
+gdb_test "set debug-file-directory ." "" ""
|
||||
+
|
||||
+#
|
||||
+# Run to `main' where we begin our tests.
|
||||
+#
|
||||
+
|
||||
+if ![runto_main] then {
|
||||
+ gdb_suppress_tests
|
||||
+}
|
||||
+
|
||||
+set sleep_line [expr [gdb_get_line_number "sleep"]]
|
||||
+set end_line [expr [gdb_get_line_number "thread_function_end"]]
|
||||
+
|
||||
+gdb_breakpoint "$end_line"
|
||||
+gdb_test "continue" "Break.*thread_function.*" "continue to thread_function 1"
|
||||
+
|
||||
+# Keep nexting until we cause the thread to exit. We expect the main
|
||||
+# thread to be stopped and a message printed to tell us we have stepped
|
||||
+# over the thread exit.
|
||||
+set test "step over thread exit 1"
|
||||
+gdb_test_multiple "next" "$test" {
|
||||
+ -re "\}.*$gdb_prompt $" {
|
||||
+ send_gdb "next\n"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ -re "Stepped over thread exit.*Program received signal SIGSTOP.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+ -re "start_thread.*$gdb_prompt $" {
|
||||
+ send_gdb "next\n"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test "bt" ".*sleep.*main.*$sleep_line.*" "backtrace after step 1"
|
||||
+
|
||||
+runto_main
|
||||
+gdb_breakpoint "$sleep_line"
|
||||
+gdb_breakpoint "$end_line"
|
||||
+set test "continue to thread_function 2"
|
||||
+gdb_test_multiple "continue" "$test" {
|
||||
+ -re "Break.*thread_function.*$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "Break.*$sleep_line.*$gdb_prompt $" {
|
||||
+ gdb_test "set repeat=1" "" ""
|
||||
+ send_gdb "continue\n"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Keep nexting until we cause the thread to exit. In this case, we
|
||||
+# expect the breakpoint in the main thread to have already triggered
|
||||
+# and so we should stop there with a message that we stepped over
|
||||
+# the thread exit.
|
||||
+set test "step over thread exit 2"
|
||||
+gdb_test_multiple "next" "$test" {
|
||||
+ -re "\}.*$gdb_prompt $" {
|
||||
+ send_gdb "next\n"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ -re "Stepped over thread exit.*Break.*$sleep_line.*$gdb_prompt $" {
|
||||
+ pass "$test (breakpoint hit)"
|
||||
+ }
|
||||
+ -re "Stepped over thread exit.*$gdb_prompt $" {
|
||||
+ pass "$test (breakpoint not hit)"
|
||||
+ }
|
||||
+ -re "start_thread.*$gdb_prompt $" {
|
||||
+ send_gdb "next\n"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
Index: gdb-6.5/gdb/infrun.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/infrun.c 2006-07-12 01:54:29.000000000 -0300
|
||||
+++ gdb-6.5/gdb/infrun.c 2006-07-12 03:22:41.000000000 -0300
|
||||
@@ -1088,6 +1088,7 @@ init_execution_control_state (struct exe
|
||||
ecs->current_symtab = ecs->sal.symtab;
|
||||
ecs->infwait_state = infwait_normal_state;
|
||||
ecs->waiton_ptid = pid_to_ptid (-1);
|
||||
+ ecs->ws.step_thread_exit = 0;
|
||||
ecs->wp = &(ecs->ws);
|
||||
}
|
||||
|
||||
@@ -1307,6 +1308,16 @@ handle_inferior_event (struct execution_
|
||||
ui_out_text (uiout, "]\n");
|
||||
}
|
||||
|
||||
+ /* Check if were stepping a thread and we stepped over the exit.
|
||||
+ In such a case, we will have found another event to process.
|
||||
+ Clear any stepping state and process that event. */
|
||||
+ if (ecs->ws.step_thread_exit)
|
||||
+ {
|
||||
+ printf_unfiltered ("[Stepped over thread exit]\n");
|
||||
+ clear_proceed_status ();
|
||||
+ ecs->ws.step_thread_exit = 0;
|
||||
+ }
|
||||
+
|
||||
switch (ecs->ws.kind)
|
||||
{
|
||||
case TARGET_WAITKIND_LOADED:
|
||||
@@ -2697,11 +2708,12 @@ process_event_stop_test:
|
||||
static int
|
||||
currently_stepping (struct execution_control_state *ecs)
|
||||
{
|
||||
- return ((!ecs->handling_longjmp
|
||||
- && ((step_range_end && step_resume_breakpoint == NULL)
|
||||
- || trap_expected))
|
||||
- || ecs->stepping_through_solib_after_catch
|
||||
- || bpstat_should_step ());
|
||||
+ return (!ecs->ws.step_thread_exit
|
||||
+ && ((!ecs->handling_longjmp
|
||||
+ && ((step_range_end && step_resume_breakpoint == NULL)
|
||||
+ || trap_expected))
|
||||
+ || ecs->stepping_through_solib_after_catch
|
||||
+ || bpstat_should_step ()));
|
||||
}
|
||||
|
||||
/* Subroutine call with source code we should not step over. Do step
|
||||
Index: gdb-6.5/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-12 01:54:29.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linux-nat.c 2006-07-12 03:22:42.000000000 -0300
|
||||
@@ -1137,18 +1137,21 @@ linux_nat_detach (char *args, int from_t
|
||||
static int
|
||||
resume_callback (struct lwp_info *lp, void *data)
|
||||
{
|
||||
+ int step = (data != NULL);
|
||||
+
|
||||
if (lp->stopped && lp->status == 0)
|
||||
{
|
||||
struct thread_info *tp;
|
||||
|
||||
linux_ops->to_resume (pid_to_ptid (GET_LWP (lp->ptid)),
|
||||
- 0, TARGET_SIGNAL_0);
|
||||
+ step, TARGET_SIGNAL_0);
|
||||
if (debug_linux_nat)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
- "RC: PTRACE_CONT %s, 0, 0 (resume sibling)\n",
|
||||
+ "RC: %s %s, 0, 0 (resume sibling)\n",
|
||||
+ step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
|
||||
target_pid_to_str (lp->ptid));
|
||||
lp->stopped = 0;
|
||||
- lp->step = 0;
|
||||
+ lp->step = step;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1259,13 +1262,17 @@ linux_nat_resume (ptid_t ptid, int step,
|
||||
if (resume_all)
|
||||
iterate_over_lwps (resume_callback, NULL);
|
||||
|
||||
- linux_ops->to_resume (ptid, step, signo);
|
||||
- if (debug_linux_nat)
|
||||
- fprintf_unfiltered (gdb_stdlog,
|
||||
- "LLR: %s %s, %s (resume event thread)\n",
|
||||
- step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
|
||||
- target_pid_to_str (ptid),
|
||||
- signo ? strsignal (signo) : "0");
|
||||
+ if (lp)
|
||||
+ {
|
||||
+ linux_ops->to_resume (ptid, step, signo);
|
||||
+
|
||||
+ if (debug_linux_nat)
|
||||
+ fprintf_unfiltered (gdb_stdlog,
|
||||
+ "LLR: %s %s, %s (resume event thread)\n",
|
||||
+ step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
|
||||
+ target_pid_to_str (ptid),
|
||||
+ signo ? strsignal (signo) : "0");
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Issue kill to specified lwp. */
|
||||
@@ -1863,7 +1870,7 @@ stop_and_resume_callback (struct lwp_inf
|
||||
for (ptr = lwp_list; ptr; ptr = ptr->next)
|
||||
if (lp == ptr)
|
||||
{
|
||||
- resume_callback (lp, NULL);
|
||||
+ resume_callback (lp, data);
|
||||
resume_set_callback (lp, NULL);
|
||||
}
|
||||
}
|
||||
@@ -1874,8 +1881,10 @@ static ptid_t
|
||||
linux_nat_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
||||
{
|
||||
struct lwp_info *lp = NULL;
|
||||
+ struct lwp_info *step_lp = NULL;
|
||||
int options = 0;
|
||||
int status = 0;
|
||||
+ int intentional_stop = 0;
|
||||
pid_t pid = PIDGET (ptid);
|
||||
sigset_t flush_mask;
|
||||
|
||||
@@ -1913,14 +1922,12 @@ retry:
|
||||
gets the expected trap so we don't want to wait on any LWP.
|
||||
This has ramifications when adjustment of the PC is required which can be
|
||||
different after a breakpoint vs a step (e.g. x86). */
|
||||
- lp = iterate_over_lwps (find_singlestep_lwp_callback, NULL);
|
||||
- if (lp) {
|
||||
+ step_lp = iterate_over_lwps (find_singlestep_lwp_callback, NULL);
|
||||
+ if (step_lp) {
|
||||
if (debug_linux_nat)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"LLW: Found step lwp %s.\n",
|
||||
- target_pid_to_str (lp->ptid));
|
||||
- ptid = lp->ptid;
|
||||
- pid = PIDGET (ptid);
|
||||
+ target_pid_to_str (step_lp->ptid));
|
||||
}
|
||||
|
||||
/* If any pid, check if there is a LWP with a wait status pending. */
|
||||
@@ -2161,8 +2168,9 @@ retry:
|
||||
}
|
||||
|
||||
/* Make sure we don't report a SIGSTOP that we sent
|
||||
- ourselves in an attempt to stop an LWP. */
|
||||
- if (lp->signalled
|
||||
+ ourselves in an attempt to stop an LWP, unless we
|
||||
+ intentionally want to see the SIGSTOP. */
|
||||
+ if (lp->signalled && !intentional_stop
|
||||
&& WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP)
|
||||
{
|
||||
if (debug_linux_nat)
|
||||
@@ -2196,6 +2204,20 @@ retry:
|
||||
|
||||
if (pid == -1)
|
||||
{
|
||||
+ lp = NULL;
|
||||
+ if (step_lp && errno == ECHILD)
|
||||
+ {
|
||||
+ /* We have stepped over a thread exit. We want to stop
|
||||
+ the first existing lwp we find and report a stop event. */
|
||||
+ for (lp = lwp_list; lp && lp == step_lp; lp = lp->next)
|
||||
+ ; /* empty */
|
||||
+ }
|
||||
+ if (lp != NULL)
|
||||
+ {
|
||||
+ stop_callback (lp, NULL);
|
||||
+ intentional_stop = 1;
|
||||
+ }
|
||||
+
|
||||
/* Alternate between checking cloned and uncloned processes. */
|
||||
options ^= __WCLONE;
|
||||
|
||||
@@ -2268,6 +2290,42 @@ retry:
|
||||
fprintf_unfiltered (gdb_stdlog, "LLW: Candidate event %s in %s.\n",
|
||||
status_to_str (status), target_pid_to_str (lp->ptid));
|
||||
|
||||
+ /* Check if there is any LWP that is being single-stepped. We need to
|
||||
+ wait specifically on such an LWP because the higher-level code is
|
||||
+ expecting a step operation to find an event on the stepped LWP.
|
||||
+ It is possible for other events to occur before the step operation
|
||||
+ gets the expected trap so we don't want to wait on any LWP.
|
||||
+ This has ramifications when adjustment of the PC is required which can be
|
||||
+ different after a breakpoint vs a step (e.g. x86). */
|
||||
+ if (step_lp && step_lp != lp)
|
||||
+ {
|
||||
+ struct lwp_info *ptr;
|
||||
+ int arg = 1;
|
||||
+ if (debug_linux_nat)
|
||||
+ fprintf_unfiltered (gdb_stdlog,
|
||||
+ "LLW: Found step lwp %s.\n",
|
||||
+ target_pid_to_str (step_lp->ptid));
|
||||
+ stop_and_resume_callback (step_lp, &arg);
|
||||
+ for (ptr = lwp_list; ptr; ptr = ptr->next)
|
||||
+ if (step_lp == ptr)
|
||||
+ break;
|
||||
+
|
||||
+ if (ptr)
|
||||
+ {
|
||||
+ if (debug_linux_nat)
|
||||
+ fprintf_unfiltered (gdb_stdlog,
|
||||
+ "LLW: Continuing step lwp %s.\n",
|
||||
+ target_pid_to_str (step_lp->ptid));
|
||||
+ ptid = step_lp->ptid;
|
||||
+ pid = PIDGET (ptid);
|
||||
+ lp->status = status;
|
||||
+ status = 0;
|
||||
+ options = WNOHANG | (step_lp->cloned ? __WCLONE : 0);
|
||||
+ pid = GET_LWP (ptid);
|
||||
+ goto retry;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Now stop all other LWP's ... */
|
||||
iterate_over_lwps (stop_callback, NULL);
|
||||
|
||||
@@ -2306,6 +2364,10 @@ retry:
|
||||
else
|
||||
store_waitstatus (ourstatus, status);
|
||||
|
||||
+ /* If we were stepping a thread and it exited, mark this. */
|
||||
+ if (step_lp && step_lp != lp)
|
||||
+ ourstatus->step_thread_exit = 1;
|
||||
+
|
||||
return lp->ptid;
|
||||
}
|
||||
|
||||
Index: gdb-6.5/gdb/target.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/target.h 2006-07-12 01:54:29.000000000 -0300
|
||||
+++ gdb-6.5/gdb/target.h 2006-07-12 03:22:40.000000000 -0300
|
||||
@@ -136,6 +136,7 @@ enum target_waitkind
|
||||
struct target_waitstatus
|
||||
{
|
||||
enum target_waitkind kind;
|
||||
+ int step_thread_exit; /* non-zero if we step over a thread exit. */
|
||||
|
||||
/* Forked child pid, execd pathname, exit status or signal number. */
|
||||
union
|
|
@ -1,24 +0,0 @@
|
|||
2005-02-14 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* top.c (gdb_readline_wrapper): Ensure terminal is gdb's before calling
|
||||
readline.
|
||||
|
||||
Index: gdb-6.5/gdb/top.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/top.c 2006-03-29 19:53:33.000000000 -0300
|
||||
+++ gdb-6.5/gdb/top.c 2006-07-07 02:29:42.000000000 -0300
|
||||
@@ -728,6 +728,14 @@ gdb_readline_wrapper (char *prompt)
|
||||
after_char_processing_hook = NULL;
|
||||
}
|
||||
|
||||
+ /* Before calling readline, ensure we have the terminal. If we don't
|
||||
+ have the terminal and call readline, we risk the possibility of
|
||||
+ gdb being thrown into the background. This problem occurs when
|
||||
+ we attach to a background process on the same terminal the background
|
||||
+ process was started from and then perform some action which requires
|
||||
+ a page break prompt. */
|
||||
+ terminal_ours ();
|
||||
+
|
||||
return readline (prompt);
|
||||
}
|
||||
|
|
@ -1,13 +1,16 @@
|
|||
Index: gdb/testsuite/ChangeLog
|
||||
2005-01-21 Jeff Johnston <jjohnstn@redhat.com>
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-test-dtorfix-20050121.patch
|
||||
|
||||
* gdb.cp/constructortest.exp: New test.
|
||||
* gdb.cp/constructortest.cc: Ditto.
|
||||
* gdb.cp/templates.exp: Change break of dtor to be fully quoted.
|
||||
;; Test support of multiple destructors just like multiple constructors
|
||||
;;=fedoratest
|
||||
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/constructortest.cc.fix Fri Jan 21 17:06:56 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/constructortest.cc Fri Jan 21 17:05:18 2005
|
||||
@@ -0,0 +1,64 @@
|
||||
diff --git a/gdb/testsuite/gdb.cp/constructortest.cc b/gdb/testsuite/gdb.cp/constructortest.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/constructortest.cc
|
||||
@@ -0,0 +1,99 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005 Free Software Foundation, Inc.
|
||||
|
@ -45,12 +48,33 @@ Index: gdb/testsuite/ChangeLog
|
|||
+ int y;
|
||||
+};
|
||||
+
|
||||
+/* C and D are for the $delete destructor. */
|
||||
+
|
||||
+class C
|
||||
+{
|
||||
+ public:
|
||||
+ C();
|
||||
+ virtual ~C();
|
||||
+ private:
|
||||
+ int x;
|
||||
+};
|
||||
+
|
||||
+class D: public C
|
||||
+{
|
||||
+ public:
|
||||
+ D();
|
||||
+ private:
|
||||
+ int y;
|
||||
+};
|
||||
+
|
||||
+int main(int argc, char *argv[])
|
||||
+{
|
||||
+ A* a = new A;
|
||||
+ B* b = new B;
|
||||
+ D* d = new D;
|
||||
+ delete a;
|
||||
+ delete b;
|
||||
+ delete d;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
|
@ -72,12 +96,28 @@ Index: gdb/testsuite/ChangeLog
|
|||
+ k = 5;
|
||||
+}
|
||||
+
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/constructortest.exp.fix Fri Jan 21 17:07:02 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/constructortest.exp Fri Jan 21 17:05:29 2005
|
||||
@@ -0,0 +1,98 @@
|
||||
+C::C() /* Constructor C */
|
||||
+{
|
||||
+ x = 1; /* First line C */
|
||||
+}
|
||||
+
|
||||
+C::~C() /* Destructor C */
|
||||
+{
|
||||
+ x = 3; /* First line ~C */
|
||||
+}
|
||||
+
|
||||
+D::D()
|
||||
+{
|
||||
+ y = 2; /* First line D */
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.cp/constructortest.exp b/gdb/testsuite/gdb.cp/constructortest.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/constructortest.exp
|
||||
@@ -0,0 +1,130 @@
|
||||
+# This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+# Copyright 2005 Free Software Foundation, Inc.
|
||||
+# Copyright 2005, 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
|
@ -95,17 +135,12 @@ Index: gdb/testsuite/ChangeLog
|
|||
+
|
||||
+# Check that GDB can break at multiple forms of constructors.
|
||||
+
|
||||
+if $tracelevel {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+set testfile "constructortest"
|
||||
+set srcfile ${testfile}.cc
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+# PIE is required for testing proper BREAKPOINT_RE_SET of the multiple-PC
|
||||
+# breakpoints.
|
||||
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++ "additional_flags=-fpie -pie"}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
|
@ -122,14 +157,9 @@ Index: gdb/testsuite/ChangeLog
|
|||
+ gdb_suppress_tests
|
||||
+}
|
||||
+
|
||||
+# Break on the various forms of the A::A constructor
|
||||
+gdb_test_multiple "break A\:\:A" "breaking on A::A" {
|
||||
+ -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. A::A\\(\\) at .*\[\r\n\]*.3. A::A\\\$base\\(\\) at .*\[\r\n\]*> $" {
|
||||
+ gdb_test "1" \
|
||||
+ ".*Multiple breakpoints were set.*" \
|
||||
+ "break on multiple constructors"
|
||||
+ }
|
||||
+}
|
||||
+# Break on the various forms of the A::A constructor.
|
||||
+# " (2 locations)" is displayed depending on G++ version.
|
||||
+gdb_test "break A\:\:A" "Breakpoint 2 at .*" "breaking on A::A"
|
||||
+
|
||||
+# Verify that we break for the A constructor two times
|
||||
+# Once for new A and once for new B
|
||||
|
@ -140,7 +170,6 @@ Index: gdb/testsuite/ChangeLog
|
|||
+
|
||||
+# Now do the same for destructors
|
||||
+gdb_test "break 'A::~A()'" ""
|
||||
+gdb_test "break 'A::~A\$base()'" ""
|
||||
+
|
||||
+# Verify that we break for the A destructor two times
|
||||
+# Once for delete a and once for delete b
|
||||
|
@ -156,7 +185,8 @@ Index: gdb/testsuite/ChangeLog
|
|||
+gdb_test "break 'A::A()'" "" "break in constructor A 2"
|
||||
+gdb_continue_to_breakpoint "First line A"
|
||||
+set second_line [gdb_get_line_number "Second line A"]
|
||||
+gdb_test "break $second_line" ".*$second_line.*$second_line.*Multiple breakpoints were set.*" "break by line in constructor"
|
||||
+# " (2 locations)" is displayed depending on G++ version.
|
||||
+gdb_test "break $second_line" "Breakpoint .*, line $second_line\\..*" "break by line in constructor"
|
||||
+gdb_continue_to_breakpoint "Second line A"
|
||||
+gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in in-charge A::A second line"
|
||||
+gdb_continue_to_breakpoint "Second line A"
|
||||
|
@ -167,26 +197,51 @@ Index: gdb/testsuite/ChangeLog
|
|||
+gdb_test "break 'A::~A()'" "" "break in constructor ~A 2"
|
||||
+gdb_continue_to_breakpoint "First line ~A"
|
||||
+set second_line_dtor [gdb_get_line_number "Second line ~A"]
|
||||
+gdb_test "break $second_line_dtor" ".*$second_line_dtor.*$second_line_dtor.*Multiple breakpoints were set.*" "break by line in destructor"
|
||||
+# " (2 locations)" is displayed depending on G++ version.
|
||||
+gdb_test "break $second_line_dtor" "Breakpoint .*, line $second_line_dtor\\..*" "break by line in destructor"
|
||||
+gdb_continue_to_breakpoint "Second line ~A"
|
||||
+gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in in-charge A::~A second line"
|
||||
+# FIXME: Analyse this case better.
|
||||
+gdb_continue_to_breakpoint "Second line ~A"
|
||||
+gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in A::~A second line #2"
|
||||
+gdb_continue_to_breakpoint "Second line ~A"
|
||||
+gdb_test "bt" "#0.*A.*#1.*B.*#2.*main.*" "Verify in not-in-charge A::~A second line"
|
||||
+
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/templates.exp.fix Fri Jan 21 17:07:10 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/templates.exp Fri Jan 21 17:09:09 2005
|
||||
@@ -1,4 +1,4 @@
|
||||
-# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004
|
||||
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -142,7 +142,7 @@ proc test_template_breakpoints {} {
|
||||
# See CLLbs14792
|
||||
if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792}
|
||||
|
||||
- gdb_test_multiple "break T5<int>::~T5" "destructor_breakpoint" {
|
||||
+ gdb_test_multiple "break 'T5<int>::~T5()'" "destructor_breakpoint" {
|
||||
-re "Breakpoint.*at.* file .*${testfile}.cc, line.*$gdb_prompt $"
|
||||
{
|
||||
pass "destructor breakpoint"
|
||||
+
|
||||
+# Test now the $delete destructors.
|
||||
+
|
||||
+gdb_load ${binfile}
|
||||
+runto_main
|
||||
+
|
||||
+set first_line_dtor [gdb_get_line_number "First line ~C"]
|
||||
+set define_line_dtor [gdb_get_line_number "Destructor C"]
|
||||
+# Break on the various forms of the C::~C destructor
|
||||
+# " ([23] locations)" is displayed depending on G++ version.
|
||||
+gdb_test "break C\:\:~C" "Breakpoint .*: C::~C\\. \\(2 locations\\)" "breaking on C::~C"
|
||||
+gdb_continue_to_breakpoint "First line ~C"
|
||||
+
|
||||
+# Verify that we can break by line number in a destructor and find
|
||||
+# the $delete occurence
|
||||
+
|
||||
+gdb_load ${binfile}
|
||||
+delete_breakpoints
|
||||
+
|
||||
+# " (3 locations)" is displayed depending on G++ version.
|
||||
+gdb_test "break $first_line_dtor" "Breakpoint .*, line $first_line_dtor\\..*" "break by line in destructor"
|
||||
+
|
||||
+# Run to `main' where we begin our tests.
|
||||
+# Set the breakpoints first to test PIE multiple-PC BREAKPOINT_RE_SET.
|
||||
+# RUNTO_MAIN or RUNTO MAIN are not usable here as it runs DELETE_BREAKPOINTS.
|
||||
+
|
||||
+if ![gdb_breakpoint main] {
|
||||
+ gdb_suppress_tests
|
||||
+}
|
||||
+gdb_run_cmd
|
||||
+set test "running to main"
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "Breakpoint \[0-9\]*, main .*$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_continue_to_breakpoint "First line ~C"
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Elena Zannoni <ezannoni@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-test-movedir-20050125.patch
|
||||
|
||||
;; Fix to support executable moving
|
||||
;;=fedoratest
|
||||
|
||||
2005-01-25 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* gdb.base/move-dir.exp: New test.
|
||||
* gdb.base/move-dir.c: Ditto.
|
||||
* gdb.base/move-dir.h: Ditto.
|
||||
|
||||
--- gdb-6.3/gdb/testsuite/gdb.base/move-dir.c.fix Tue Jan 25 19:13:14 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.c Tue Jan 25 19:12:40 2005
|
||||
@@ -0,0 +1,9 @@
|
||||
diff --git a/gdb/testsuite/gdb.base/move-dir.c b/gdb/testsuite/gdb.base/move-dir.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/move-dir.c
|
||||
@@ -0,0 +1,10 @@
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include "move-dir.h"
|
||||
+
|
||||
|
@ -16,9 +27,11 @@
|
|||
+ other();
|
||||
+}
|
||||
+
|
||||
--- gdb-6.3/gdb/testsuite/gdb.base/move-dir.exp.fix Tue Jan 25 19:13:21 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.exp Tue Jan 25 19:12:40 2005
|
||||
@@ -0,0 +1,67 @@
|
||||
diff --git a/gdb/testsuite/gdb.base/move-dir.exp b/gdb/testsuite/gdb.base/move-dir.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/move-dir.exp
|
||||
@@ -0,0 +1,57 @@
|
||||
+# Copyright 2005
|
||||
+# Free Software Foundation, Inc.
|
||||
+
|
||||
|
@ -36,30 +49,20 @@
|
|||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+set testfile "move-dir"
|
||||
+set srcfile ${testfile}.c
|
||||
+set incfile ${testfile}.h
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+set testdir "${objdir}/${subdir}/incdir"
|
||||
+set testdir [standard_output_file incdir]
|
||||
+
|
||||
+remote_exec build "mkdir $testdir"
|
||||
+remote_exec build "cp ${srcdir}/${subdir}/${srcfile} ${objdir}/${subdir}"
|
||||
+remote_exec build "cp ${srcdir}/${subdir}/${incfile} ${testdir}"
|
||||
+remote_exec build "cp ${srcdir}/${subdir}/${srcfile} [standard_output_file ${srcfile}]"
|
||||
+remote_exec build "cp ${srcdir}/${subdir}/${incfile} [standard_output_file ${incfile}]"
|
||||
+
|
||||
+set additional_flags "additional_flags=-I${subdir}/incdir"
|
||||
+
|
||||
+if { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
|
||||
+if { [gdb_compile [standard_output_file ${srcfile}] "${binfile}" executable [list debug $additional_flags]] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
|
@ -86,8 +89,10 @@
|
|||
+
|
||||
+set timeout $oldtimeout
|
||||
+return 0
|
||||
--- gdb-6.3/gdb/testsuite/gdb.base/move-dir.h.fix Tue Jan 25 19:17:50 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.h Tue Jan 25 19:19:20 2005
|
||||
diff --git a/gdb/testsuite/gdb.base/move-dir.h b/gdb/testsuite/gdb.base/move-dir.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/move-dir.h
|
||||
@@ -0,0 +1,7 @@
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,11 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Elena Zannoni <ezannoni@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-test-self-20050110.patch
|
||||
|
||||
;; Get selftest working with sep-debug-info
|
||||
;;=fedoratest
|
||||
|
||||
2004-02-23 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* gdb.gdb/selftest.exp: Make sure that the debug directory is
|
||||
|
@ -6,88 +14,29 @@
|
|||
* gdb.gdb/xfullpath.exp: Ditto.
|
||||
* gdb.gdb/observer.exp: Ditto.
|
||||
|
||||
--- gdb-6.3/gdb/testsuite/gdb.gdb/complaints.exp.fix Mon Jan 10 19:21:20 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.gdb/complaints.exp Mon Jan 10 19:24:38 2005
|
||||
@@ -304,13 +304,13 @@ proc find_gdb { arg } {
|
||||
set GDB_FULLPATH [find_gdb $GDB]
|
||||
diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
|
||||
--- a/gdb/testsuite/lib/selftest-support.exp
|
||||
+++ b/gdb/testsuite/lib/selftest-support.exp
|
||||
@@ -152,18 +152,18 @@ proc do_self_tests {function body} {
|
||||
}
|
||||
|
||||
# Remove any old copy lying around.
|
||||
-remote_file host delete x$tool
|
||||
+#remote_file host delete x$tool
|
||||
# Remove any old copy lying around.
|
||||
- remote_file host delete $xgdb
|
||||
+ #remote_file host delete $xgdb
|
||||
|
||||
gdb_start
|
||||
gdb_start
|
||||
- set file [remote_download host $GDB_FULLPATH $xgdb]
|
||||
+ #set file [remote_download host $GDB_FULLPATH $xgdb]
|
||||
|
||||
-set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
+#set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
- set result [selftest_setup $file $function]
|
||||
+ set result [selftest_setup $GDB_FULLPATH $function]
|
||||
if {$result == 0} then {
|
||||
set result [uplevel $body]
|
||||
}
|
||||
|
||||
-set setup_result [setup_test $file ]
|
||||
+set setup_result [setup_test $GDB_FULLPATH ]
|
||||
if {$setup_result <0} then {
|
||||
return -1
|
||||
}
|
||||
@@ -321,4 +321,4 @@ test_short_complaints
|
||||
test_empty_complaints
|
||||
gdb_exit
|
||||
- catch "remote_file host delete $file"
|
||||
+ #catch "remote_file host delete $file"
|
||||
|
||||
gdb_exit;
|
||||
-catch "remote_file host delete $file";
|
||||
+#catch "remote_file host delete $file";
|
||||
--- gdb-6.3/gdb/testsuite/gdb.gdb/observer.exp.fix Mon Jan 10 19:21:27 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.gdb/observer.exp Mon Jan 10 19:24:38 2005
|
||||
@@ -259,13 +259,13 @@ proc find_gdb { arg } {
|
||||
set GDB_FULLPATH [find_gdb $GDB]
|
||||
|
||||
# Remove any old copy lying around.
|
||||
-remote_file host delete x$tool
|
||||
+#remote_file host delete x$tool
|
||||
|
||||
gdb_start
|
||||
-set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
-set result [test_observer_normal_stop $file];
|
||||
+#set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
+set result [test_observer_normal_stop $GDB_FULLPATH];
|
||||
gdb_exit;
|
||||
-catch "remote_file host delete $file";
|
||||
+#catch "remote_file host delete $file";
|
||||
|
||||
if {$result <0} then {
|
||||
warning "Couldn't test self"
|
||||
--- gdb-6.3/gdb/testsuite/gdb.gdb/selftest.exp.fix Mon Jan 10 19:21:33 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.gdb/selftest.exp Mon Jan 10 19:24:38 2005
|
||||
@@ -512,13 +512,13 @@ proc find_gdb { arg } {
|
||||
set GDB_FULLPATH [find_gdb $GDB]
|
||||
|
||||
# Remove any old copy lying around.
|
||||
-remote_file host delete x$tool
|
||||
+#remote_file host delete x$tool
|
||||
|
||||
gdb_start
|
||||
-set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
-set result [test_with_self $file];
|
||||
+#set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
+set result [test_with_self $GDB_FULLPATH];
|
||||
gdb_exit;
|
||||
-catch "remote_file host delete $file";
|
||||
+#catch "remote_file host delete $file";
|
||||
|
||||
if {$result <0} then {
|
||||
warning "Couldn't test self"
|
||||
--- gdb-6.3/gdb/testsuite/gdb.gdb/xfullpath.exp.fix Mon Jan 10 19:21:40 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.gdb/xfullpath.exp Mon Jan 10 19:24:38 2005
|
||||
@@ -181,13 +181,13 @@ proc find_gdb { arg } {
|
||||
set GDB_FULLPATH [find_gdb $GDB]
|
||||
|
||||
# Remove any old copy lying around.
|
||||
-remote_file host delete x$tool
|
||||
+#remote_file host delete x$tool
|
||||
|
||||
gdb_start
|
||||
-set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
-set result [test_with_self $file];
|
||||
+#set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
+set result [test_with_self $GDB_FULLPATH];
|
||||
gdb_exit;
|
||||
-catch "remote_file host delete $file";
|
||||
+#catch "remote_file host delete $file";
|
||||
|
||||
if {$result <0} then {
|
||||
warning "Couldn't test self"
|
||||
if {$result < 0} then {
|
||||
warning "Couldn't test self"
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
Index: ./gdb/testsuite/ChangeLog
|
||||
2005-04-02 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* gdb.base/sepdebug.exp: Check that things fail when the debug
|
||||
info is corrupt.
|
||||
* gdb.base/sepdebug2.c (main): New file.
|
||||
|
||||
--- ../gdb-6.3/./gdb/testsuite/gdb.base/sepdebug.exp 2004-01-14 10:09:37.000000000 -0500
|
||||
+++ ./gdb/testsuite/gdb.base/sepdebug.exp 2005-04-02 15:57:17.000000000 -0500
|
||||
@@ -985,3 +985,35 @@
|
||||
send_gdb "set args main\n"
|
||||
gdb_expect -re ".*$gdb_prompt $" {}
|
||||
}
|
||||
+
|
||||
+
|
||||
+# Compile up a second, different, object file. Copy its debug info
|
||||
+# over the top of the new debug info. Note that somewhere in the
|
||||
+# above the "set debug-file-directory" variable is set to
|
||||
+# ${objdir}/${subdir} so need to move things there.
|
||||
+
|
||||
+set existing_binfile $binfile
|
||||
+set testfile "sepdebug2"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set corrupt_debug_file [separate_debug_filename $binfile]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+if [gdb_gnu_strip_debug $binfile] {
|
||||
+ # check that you have a recent version of strip and objcopy installed
|
||||
+ unsupported "cannot produce separate debug info files"
|
||||
+ return -1
|
||||
+}
|
||||
+remote_exec build "cp $corrupt_debug_file ${existing_binfile}.debug"
|
||||
+
|
||||
+set test "A corrupt debug file gets a warning"
|
||||
+gdb_test_multiple "file $existing_binfile" "$test" {
|
||||
+ -re "warning:.*mismatch.*" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+ -re ".y or n. " {
|
||||
+ send_gdb "y\n"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+}
|
||||
--- /dev/null 2005-04-02 11:30:32.604931736 -0500
|
||||
+++ ./gdb/testsuite/gdb.base/sepdebug2.c 2005-04-02 13:09:31.000000000 -0500
|
||||
@@ -0,0 +1,5 @@
|
||||
+int
|
||||
+main (int argc, char *argv[], char *envp[])
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
|
@ -1,58 +0,0 @@
|
|||
2004-12-07 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* linux-nat.c (find_singlestep_lwp_callback): New function.
|
||||
(linux-nat-wait): Before waiting on any pid, check if there
|
||||
is a stepping lwp and if so, wait on it specifically.
|
||||
|
||||
--- gdb-6.3/gdb/linux-nat.c.fix Tue Dec 7 19:39:34 2004
|
||||
+++ gdb-6.3/gdb/linux-nat.c Tue Dec 7 19:39:46 2004
|
||||
@@ -1489,9 +1489,21 @@ count_events_callback (struct lwp_info *
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/* Select the LWP (if any) that is currently being single-stepped. */
|
||||
+/* Find an LWP (if any) that is currently being single-stepped. */
|
||||
|
||||
static int
|
||||
+find_singlestep_lwp_callback (struct lwp_info *lp, void *data)
|
||||
+{
|
||||
+ if (lp->step)
|
||||
+ return 1;
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Select the LWP with an event (if any) that is currently being
|
||||
+ single-stepped. */
|
||||
+
|
||||
+static int
|
||||
select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
|
||||
{
|
||||
if (lp->step && lp->status != 0)
|
||||
@@ -1774,7 +1786,25 @@ retry:
|
||||
least if there are any LWPs at all. */
|
||||
gdb_assert (num_lwps == 0 || iterate_over_lwps (resumed_callback, NULL));
|
||||
|
||||
- /* First check if there is a LWP with a wait status pending. */
|
||||
+ /* Check if there is any LWP that is being single-stepped. We need to
|
||||
+ wait specifically on such an LWP because the higher-level code is
|
||||
+ expecting a step operation to find an event on the stepped LWP.
|
||||
+ It is possible for other events to occur before the step operation
|
||||
+ gets the expected trap so we don't want to wait on any LWP.
|
||||
+ This has ramifications when adjustment of the PC is required which can be
|
||||
+ different after a breakpoint vs a step (e.g. x86). */
|
||||
+ lp = iterate_over_lwps (find_singlestep_lwp_callback, NULL);
|
||||
+ if (lp) {
|
||||
+ if (debug_linux_nat)
|
||||
+ fprintf_unfiltered (gdb_stdlog,
|
||||
+ "LLW: Found step lwp %s.\n",
|
||||
+ target_pid_to_str (lp->ptid));
|
||||
+ ptid = lp->ptid;
|
||||
+ pid = PIDGET (ptid);
|
||||
+ }
|
||||
+
|
||||
+ /* If any pid, check if there is a LWP with a wait status pending. */
|
||||
+
|
||||
if (pid == -1)
|
||||
{
|
||||
/* Any LWP that's been resumed will do. */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,11 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Johnston <jjohnstn@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-threaded-watchpoints2-20050225.patch
|
||||
|
||||
;; Test sibling threads to set threaded watchpoints for x86 and x86-64
|
||||
;;=fedoratest
|
||||
|
||||
2005-02-28 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* config/i386/nm-linux.h: Change dr register routines to
|
||||
|
@ -32,171 +40,20 @@
|
|||
(amd64_linux_hw_breakpoint, amd64_linux_remove_hw_breakpoint): Ditto.
|
||||
(amd64_linux_new_thread): Ditto.
|
||||
(_initialize_amd64_linux_nat): Register linux new thread observer.
|
||||
* testsuite/gdb.threads/watchthreads2.c: New test case.
|
||||
* testsuite/gdb.threads/watchthreads2.exp: Ditto.
|
||||
* testsuite/gdb.threads/watchthreads-threaded.c: New test case.
|
||||
* testsuite/gdb.threads/watchthreads-threaded.exp: Ditto.
|
||||
|
||||
Index: gdb-6.5/gdb/config/i386/nm-linux64.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/config/i386/nm-linux64.h 2006-07-12 01:54:10.000000000 -0300
|
||||
+++ gdb-6.5/gdb/config/i386/nm-linux64.h 2006-07-12 01:54:29.000000000 -0300
|
||||
@@ -35,22 +35,59 @@
|
||||
|
||||
/* Provide access to the i386 hardware debugging registers. */
|
||||
|
||||
-extern void amd64_linux_dr_set_control (unsigned long control);
|
||||
+extern void amd64_linux_dr_set_control (ptid_t ptid, unsigned long control);
|
||||
#define I386_DR_LOW_SET_CONTROL(control) \
|
||||
- amd64_linux_dr_set_control (control)
|
||||
+ amd64_linux_dr_set_control (inferior_ptid, control)
|
||||
|
||||
-extern void amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr);
|
||||
+extern void amd64_linux_dr_set_addr (ptid_t ptid, int regnum, CORE_ADDR addr);
|
||||
#define I386_DR_LOW_SET_ADDR(regnum, addr) \
|
||||
- amd64_linux_dr_set_addr (regnum, addr)
|
||||
+ amd64_linux_dr_set_addr (inferior_ptid, regnum, addr)
|
||||
|
||||
-extern void amd64_linux_dr_reset_addr (int regnum);
|
||||
+extern void amd64_linux_dr_reset_addr (ptid_t ptid, int regnum);
|
||||
#define I386_DR_LOW_RESET_ADDR(regnum) \
|
||||
- amd64_linux_dr_reset_addr (regnum)
|
||||
+ amd64_linux_dr_reset_addr (inferior_ptid, regnum)
|
||||
|
||||
-extern unsigned long amd64_linux_dr_get_status (void);
|
||||
+extern unsigned long amd64_linux_dr_get_status (ptid_t ptid);
|
||||
#define I386_DR_LOW_GET_STATUS() \
|
||||
- amd64_linux_dr_get_status ()
|
||||
+ amd64_linux_dr_get_status (inferior_ptid)
|
||||
|
||||
+/* Watchpoints and hardware breakpoints. */
|
||||
+
|
||||
+/* Insert a watchpoint to watch a memory region which starts at
|
||||
+ * * address ADDR and whose length is LEN bytes. Watch memory accesses
|
||||
+ * * of the type TYPE. Return 0 on success, -1 on failure. */
|
||||
+extern int amd64_linux_insert_watchpoint (CORE_ADDR addr, int len, int type);
|
||||
+
|
||||
+/* Remove a watchpoint that watched the memory region which starts at
|
||||
+ * * address ADDR, whose length is LEN bytes, and for accesses of the
|
||||
+ * * type TYPE. Return 0 on success, -1 on failure. */
|
||||
+extern int amd64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type);
|
||||
+
|
||||
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
|
||||
+ * * unused. Return 0 on success, EBUSY on failure. */
|
||||
+extern int amd64_linux_insert_hw_breakpoint (struct bp_target_info *bp_tgt);
|
||||
+
|
||||
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
|
||||
+ * * unused. Return 0 on success, -1 on failure. */
|
||||
+extern int amd64_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt);
|
||||
+
|
||||
+/* Override basic amd64 macros for watchpoint and hardware breakpoint
|
||||
+ * insertion/removal to support threads. */
|
||||
+#undef target_insert_watchpoint
|
||||
+#define target_insert_watchpoint(addr, len, type) \
|
||||
+ amd64_linux_insert_watchpoint (addr, len, type)
|
||||
+
|
||||
+#undef target_remove_watchpoint
|
||||
+#define target_remove_watchpoint(addr, len, type) \
|
||||
+ amd64_linux_remove_watchpoint (addr, len, type)
|
||||
+
|
||||
+#undef target_insert_hw_breakpoint
|
||||
+#define target_insert_hw_breakpoint(bp_tgt) \
|
||||
+ amd64_linux_insert_hw_breakpoint (bp_tgt)
|
||||
+
|
||||
+#undef target_remove_hw_breakpoint
|
||||
+#define target_remove_hw_breakpoint(bp_tgt) \
|
||||
+ amd64_linux_remove_hw_breakpoint (bp_tgt)
|
||||
|
||||
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
|
||||
#define FETCH_INFERIOR_REGISTERS
|
||||
Index: gdb-6.5/gdb/config/i386/nm-linux.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/config/i386/nm-linux.h 2006-07-12 01:54:10.000000000 -0300
|
||||
+++ gdb-6.5/gdb/config/i386/nm-linux.h 2006-07-12 01:54:29.000000000 -0300
|
||||
@@ -46,23 +46,61 @@ extern CORE_ADDR register_u_addr (CORE_A
|
||||
|
||||
/* Provide access to the i386 hardware debugging registers. */
|
||||
|
||||
-extern void i386_linux_dr_set_control (unsigned long control);
|
||||
+extern void i386_linux_dr_set_control (ptid_t ptid, unsigned long control);
|
||||
#define I386_DR_LOW_SET_CONTROL(control) \
|
||||
- i386_linux_dr_set_control (control)
|
||||
+ i386_linux_dr_set_control (inferior_ptid, control)
|
||||
|
||||
-extern void i386_linux_dr_set_addr (int regnum, CORE_ADDR addr);
|
||||
+extern void i386_linux_dr_set_addr (ptid_t ptid, int regnum, CORE_ADDR addr);
|
||||
#define I386_DR_LOW_SET_ADDR(regnum, addr) \
|
||||
- i386_linux_dr_set_addr (regnum, addr)
|
||||
+ i386_linux_dr_set_addr (inferior_ptid, regnum, addr)
|
||||
|
||||
-extern void i386_linux_dr_reset_addr (int regnum);
|
||||
+extern void i386_linux_dr_reset_addr (ptid_t ptid, int regnum);
|
||||
#define I386_DR_LOW_RESET_ADDR(regnum) \
|
||||
- i386_linux_dr_reset_addr (regnum)
|
||||
+ i386_linux_dr_reset_addr (inferior_ptid, regnum)
|
||||
|
||||
-extern unsigned long i386_linux_dr_get_status (void);
|
||||
+extern unsigned long i386_linux_dr_get_status (ptid_t ptid);
|
||||
#define I386_DR_LOW_GET_STATUS() \
|
||||
- i386_linux_dr_get_status ()
|
||||
+ i386_linux_dr_get_status (inferior_ptid)
|
||||
|
||||
|
||||
+/* Watchpoints and hardware breakpoints. */
|
||||
+
|
||||
+/* Insert a watchpoint to watch a memory region which starts at
|
||||
+ * address ADDR and whose length is LEN bytes. Watch memory accesses
|
||||
+ * of the type TYPE. Return 0 on success, -1 on failure. */
|
||||
+extern int i386_linux_insert_watchpoint (CORE_ADDR addr, int len, int type);
|
||||
+
|
||||
+/* Remove a watchpoint that watched the memory region which starts at
|
||||
+ * address ADDR, whose length is LEN bytes, and for accesses of the
|
||||
+ * type TYPE. Return 0 on success, -1 on failure. */
|
||||
+extern int i386_linux_remove_watchpoint (CORE_ADDR addr, int len, int type);
|
||||
+
|
||||
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
|
||||
+ * unused. Return 0 on success, EBUSY on failure. */
|
||||
+extern int i386_linux_insert_hw_breakpoint (struct bp_target_info *bp_tgt);
|
||||
+
|
||||
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
|
||||
+ * unused. Return 0 on success, -1 on failure. */
|
||||
+extern int i386_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt);
|
||||
+
|
||||
+/* Override basic i386 macros for watchpoint and hardware breakpoint
|
||||
+ insertion/removal to support threads. */
|
||||
+#undef target_insert_watchpoint
|
||||
+#define target_insert_watchpoint(addr, len, type) \
|
||||
+ i386_linux_insert_watchpoint (addr, len, type)
|
||||
+
|
||||
+#undef target_remove_watchpoint
|
||||
+#define target_remove_watchpoint(addr, len, type) \
|
||||
+ i386_linux_remove_watchpoint (addr, len, type)
|
||||
+
|
||||
+#undef target_insert_hw_breakpoint
|
||||
+#define target_insert_hw_breakpoint(bp_tgt) \
|
||||
+ i386_linux_insert_hw_breakpoint (bp_tgt)
|
||||
+
|
||||
+#undef target_remove_hw_breakpoint
|
||||
+#define target_remove_hw_breakpoint(bp_tgt) \
|
||||
+ i386_linux_remove_hw_breakpoint (bp_tgt)
|
||||
+
|
||||
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
|
||||
#define FETCH_INFERIOR_REGISTERS
|
||||
|
||||
Index: gdb-6.5/gdb/i386-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/i386-nat.c 2006-07-12 01:54:10.000000000 -0300
|
||||
+++ gdb-6.5/gdb/i386-nat.c 2006-07-12 01:54:29.000000000 -0300
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "defs.h"
|
||||
#include "breakpoint.h"
|
||||
+#include "inferior.h"
|
||||
#include "command.h"
|
||||
#include "gdbcmd.h"
|
||||
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c 2006-07-12 01:54:29.000000000 -0300
|
||||
[ With recent upstream GDB (6.8) reduced only to the testcase. ]
|
||||
|
||||
[ It was called watchthreads2.{exp,c} before but it conflicted with FSF GDB new
|
||||
testcase of the same name. ]
|
||||
|
||||
FIXME: The testcase does not expects multiple watchpoints hits per one stop.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.c b/gdb/testsuite/gdb.threads/watchthreads-threaded.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.c
|
||||
@@ -0,0 +1,66 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
|
@ -264,11 +121,11 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c
|
|||
+ pthread_exit(NULL);
|
||||
+}
|
||||
+
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp 2006-07-12 01:54:29.000000000 -0300
|
||||
@@ -0,0 +1,133 @@
|
||||
diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
|
||||
@@ -0,0 +1,126 @@
|
||||
+# This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+# Copyright 2005 Free Software Foundation, Inc.
|
||||
|
@ -289,22 +146,15 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp
|
|||
+
|
||||
+# Check that GDB can support multiple watchpoints across threads.
|
||||
+
|
||||
+if $tracelevel {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set prms_id 0
|
||||
+set bug_id 0
|
||||
+
|
||||
+# This test verifies that a watchpoint is detected in the proper thread
|
||||
+# so the test is only meaningful on a system with hardware watchpoints.
|
||||
+if [target_info exists gdb,no_hardware_watchpoints] {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+set testfile "watchthreads2"
|
||||
+set testfile "watchthreads-threaded"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
|
@ -359,13 +209,13 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp
|
|||
+for {set i 0} {$i < 30} {incr i} {
|
||||
+ set test_flag 0
|
||||
+ gdb_test_multiple "continue" "threaded watch loop" {
|
||||
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads2.c:$init_line.*$gdb_prompt $"
|
||||
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $"
|
||||
+ { set args_2 1; set test_flag 1 }
|
||||
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads2.c:$init_line.*$gdb_prompt $"
|
||||
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $"
|
||||
+ { set args_3 1; set test_flag 1 }
|
||||
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*in thread_function \\\(arg=0x2\\\) at .*watchthreads2.c:$inc_line.*$gdb_prompt $"
|
||||
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*in thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
|
||||
+ { set args_2 [expr $args_2+1]; set test_flag 1 }
|
||||
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*in thread_function \\\(arg=0x3\\\) at .*watchthreads2.c:$inc_line.*$gdb_prompt $"
|
||||
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*in thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
|
||||
+ { set args_3 [expr $args_3+1]; set test_flag 1 }
|
||||
+ }
|
||||
+ # If we fail above, don't bother continuing loop
|
||||
|
@ -402,458 +252,3 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp
|
|||
+} else {
|
||||
+ fail $message
|
||||
+}
|
||||
Index: gdb-6.5/gdb/i386-linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/i386-linux-nat.c 2006-07-12 01:54:28.000000000 -0300
|
||||
+++ gdb-6.5/gdb/i386-linux-nat.c 2006-07-12 01:57:19.000000000 -0300
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "inferior.h"
|
||||
#include "gdbcore.h"
|
||||
#include "regcache.h"
|
||||
+#include "observer.h"
|
||||
#include "target.h"
|
||||
#include "linux-nat.h"
|
||||
|
||||
@@ -614,14 +615,14 @@ i386_linux_store_inferior_registers (int
|
||||
/* Support for debug registers. */
|
||||
|
||||
static unsigned long
|
||||
-i386_linux_dr_get (int regnum)
|
||||
+i386_linux_dr_get (ptid_t ptid, int regnum)
|
||||
{
|
||||
int tid;
|
||||
unsigned long value;
|
||||
|
||||
- tid = TIDGET (inferior_ptid);
|
||||
+ tid = TIDGET (ptid);
|
||||
if (tid == 0)
|
||||
- tid = PIDGET (inferior_ptid);
|
||||
+ tid = PIDGET (ptid);
|
||||
|
||||
/* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
|
||||
ptrace call fails breaks debugging remote targets. The correct
|
||||
@@ -642,13 +643,13 @@ i386_linux_dr_get (int regnum)
|
||||
}
|
||||
|
||||
static void
|
||||
-i386_linux_dr_set (int regnum, unsigned long value)
|
||||
+i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
|
||||
{
|
||||
int tid;
|
||||
|
||||
- tid = TIDGET (inferior_ptid);
|
||||
+ tid = TIDGET (ptid);
|
||||
if (tid == 0)
|
||||
- tid = PIDGET (inferior_ptid);
|
||||
+ tid = PIDGET (ptid);
|
||||
|
||||
errno = 0;
|
||||
ptrace (PTRACE_POKEUSER, tid,
|
||||
@@ -658,34 +659,158 @@ i386_linux_dr_set (int regnum, unsigned
|
||||
}
|
||||
|
||||
void
|
||||
-i386_linux_dr_set_control (unsigned long control)
|
||||
+i386_linux_dr_set_control (ptid_t ptid, unsigned long control)
|
||||
{
|
||||
- i386_linux_dr_set (DR_CONTROL, control);
|
||||
+ i386_linux_dr_set (ptid, DR_CONTROL, control);
|
||||
}
|
||||
|
||||
void
|
||||
-i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
|
||||
+i386_linux_dr_set_addr (ptid_t ptid, int regnum, CORE_ADDR addr)
|
||||
{
|
||||
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
|
||||
|
||||
- i386_linux_dr_set (DR_FIRSTADDR + regnum, addr);
|
||||
+ i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
|
||||
}
|
||||
|
||||
void
|
||||
-i386_linux_dr_reset_addr (int regnum)
|
||||
+i386_linux_dr_reset_addr (ptid_t ptid, int regnum)
|
||||
{
|
||||
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
|
||||
|
||||
- i386_linux_dr_set (DR_FIRSTADDR + regnum, 0L);
|
||||
+ i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, 0L);
|
||||
}
|
||||
|
||||
unsigned long
|
||||
-i386_linux_dr_get_status (void)
|
||||
+i386_linux_dr_get_status (ptid_t ptid)
|
||||
{
|
||||
- return i386_linux_dr_get (DR_STATUS);
|
||||
+ return i386_linux_dr_get (ptid, DR_STATUS);
|
||||
}
|
||||
|
||||
|
||||
+/* Structure used to sync debug registers for all threads. */
|
||||
+struct i386_debug_register_state
|
||||
+{
|
||||
+ int tid;
|
||||
+ CORE_ADDR addr[DR_LASTADDR - DR_FIRSTADDR + 1];
|
||||
+ unsigned long control;
|
||||
+};
|
||||
+
|
||||
+static void
|
||||
+i386_linux_set_debug_regs_for_thread (ptid_t ptid,
|
||||
+ struct i386_debug_register_state *dbs)
|
||||
+{
|
||||
+ int i;
|
||||
+ for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
|
||||
+ i386_linux_dr_set_addr (ptid, i, dbs->addr[i]);
|
||||
+ i386_linux_dr_set_control (ptid, dbs->control);
|
||||
+}
|
||||
+
|
||||
+/* Iterator function to support syncing debug registers across all threads. */
|
||||
+static int
|
||||
+i386_linux_sync_debug_registers_callback (struct lwp_info *lwp, void *data)
|
||||
+{
|
||||
+ struct i386_debug_register_state *args = data;
|
||||
+ int i, tid;
|
||||
+
|
||||
+ tid = TIDGET (lwp->ptid);
|
||||
+ if (tid == 0)
|
||||
+ tid = PIDGET (lwp->ptid);
|
||||
+
|
||||
+ if (tid != args->tid)
|
||||
+ i386_linux_set_debug_regs_for_thread (lwp->ptid, args);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Sync the debug registers for all known threads to the current
|
||||
+ thread that has just performed an operation. This is required
|
||||
+ because the debug registers are thread-specific. We want
|
||||
+ watchpoints and hardware breakpoints to be treated globally
|
||||
+ across all threads. */
|
||||
+static int
|
||||
+i386_linux_sync_debug_registers_across_threads (void)
|
||||
+{
|
||||
+ int i, tid;
|
||||
+ struct i386_debug_register_state args;
|
||||
+
|
||||
+ tid = TIDGET (inferior_ptid);
|
||||
+ if (tid == 0)
|
||||
+ tid = PIDGET (inferior_ptid);
|
||||
+
|
||||
+ args.tid = tid;
|
||||
+ for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
|
||||
+ args.addr[i] = i386_linux_dr_get (inferior_ptid, DR_FIRSTADDR + i);
|
||||
+ args.control = i386_linux_dr_get (inferior_ptid, DR_CONTROL);
|
||||
+
|
||||
+ iterate_over_lwps (&i386_linux_sync_debug_registers_callback, &args);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Insert a watchpoint to watch a memory region which starts at
|
||||
+ address ADDR and whose length is LEN bytes. Watch memory accesses
|
||||
+ of the type TYPE. Return 0 on success, -1 on failure. */
|
||||
+int
|
||||
+i386_linux_insert_watchpoint (CORE_ADDR addr, int len, int type)
|
||||
+{
|
||||
+ int rc;
|
||||
+ rc = i386_insert_watchpoint (addr, len, type);
|
||||
+ if (!rc)
|
||||
+ i386_linux_sync_debug_registers_across_threads ();
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/* Remove a watchpoint that watched the memory region which starts at
|
||||
+ address ADDR, whose length is LEN bytes, and for accesses of the
|
||||
+ type TYPE. Return 0 on success, -1 on failure. */
|
||||
+int
|
||||
+i386_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
|
||||
+{
|
||||
+ int rc;
|
||||
+ rc = i386_remove_watchpoint (addr, len, type);
|
||||
+ if (!rc)
|
||||
+ i386_linux_sync_debug_registers_across_threads ();
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
|
||||
+ unused. Return 0 on success, EBUSY on failure. */
|
||||
+int
|
||||
+i386_linux_insert_hw_breakpoint (struct bp_target_info *bp_tgt)
|
||||
+{
|
||||
+ int rc;
|
||||
+ rc = i386_insert_hw_breakpoint (bp_tgt);
|
||||
+ if (!rc)
|
||||
+ i386_linux_sync_debug_registers_across_threads ();
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
|
||||
+ unused. Return 0 on success, -1 on failure. */
|
||||
+int
|
||||
+i386_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt)
|
||||
+{
|
||||
+ int rc;
|
||||
+ rc = i386_remove_hw_breakpoint (bp_tgt);
|
||||
+ if (!rc)
|
||||
+ i386_linux_sync_debug_registers_across_threads ();
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/* Observer function for a new thread attach. We need to insert
|
||||
+ existing watchpoints and hardware breakpoints on the new thread. */
|
||||
+static void
|
||||
+i386_linux_new_thread (ptid_t ptid)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct i386_debug_register_state dbs;
|
||||
+
|
||||
+ for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
|
||||
+ dbs.addr[i] = i386_linux_dr_get (inferior_ptid, DR_FIRSTADDR + i);
|
||||
+ dbs.control = i386_linux_dr_get (inferior_ptid, DR_CONTROL);
|
||||
+
|
||||
+ i386_linux_set_debug_regs_for_thread (ptid, &dbs);
|
||||
+}
|
||||
+
|
||||
/* Called by libthread_db. Returns a pointer to the thread local
|
||||
storage (or its descriptor). */
|
||||
|
||||
@@ -843,4 +968,6 @@ _initialize_i386_linux_nat (void)
|
||||
|
||||
/* Register the target. */
|
||||
linux_nat_add_target (t);
|
||||
+
|
||||
+ observer_attach_linux_new_thread (i386_linux_new_thread);
|
||||
}
|
||||
Index: gdb-6.5/gdb/amd64-linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/amd64-linux-nat.c 2006-07-12 01:54:28.000000000 -0300
|
||||
+++ gdb-6.5/gdb/amd64-linux-nat.c 2006-07-12 01:54:29.000000000 -0300
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "inferior.h"
|
||||
#include "gdbcore.h"
|
||||
#include "regcache.h"
|
||||
+#include "observer.h"
|
||||
#include "linux-nat.h"
|
||||
|
||||
#include "gdb_assert.h"
|
||||
@@ -229,14 +230,14 @@ amd64_linux_store_inferior_registers (in
|
||||
|
||||
|
||||
static unsigned long
|
||||
-amd64_linux_dr_get (int regnum)
|
||||
+amd64_linux_dr_get (ptid_t ptid, int regnum)
|
||||
{
|
||||
int tid;
|
||||
unsigned long value;
|
||||
|
||||
- tid = TIDGET (inferior_ptid);
|
||||
+ tid = TIDGET (ptid);
|
||||
if (tid == 0)
|
||||
- tid = PIDGET (inferior_ptid);
|
||||
+ tid = PIDGET (ptid);
|
||||
|
||||
/* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
|
||||
ptrace call fails breaks debugging remote targets. The correct
|
||||
@@ -257,13 +258,13 @@ amd64_linux_dr_get (int regnum)
|
||||
}
|
||||
|
||||
static void
|
||||
-amd64_linux_dr_set (int regnum, unsigned long value)
|
||||
+amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
|
||||
{
|
||||
int tid;
|
||||
|
||||
- tid = TIDGET (inferior_ptid);
|
||||
+ tid = TIDGET (ptid);
|
||||
if (tid == 0)
|
||||
- tid = PIDGET (inferior_ptid);
|
||||
+ tid = PIDGET (ptid);
|
||||
|
||||
errno = 0;
|
||||
ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value);
|
||||
@@ -272,34 +273,158 @@ amd64_linux_dr_set (int regnum, unsigned
|
||||
}
|
||||
|
||||
void
|
||||
-amd64_linux_dr_set_control (unsigned long control)
|
||||
+amd64_linux_dr_set_control (ptid_t ptid, unsigned long control)
|
||||
{
|
||||
- amd64_linux_dr_set (DR_CONTROL, control);
|
||||
+ amd64_linux_dr_set (ptid, DR_CONTROL, control);
|
||||
}
|
||||
|
||||
void
|
||||
-amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
|
||||
+amd64_linux_dr_set_addr (ptid_t ptid, int regnum, CORE_ADDR addr)
|
||||
{
|
||||
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
|
||||
|
||||
- amd64_linux_dr_set (DR_FIRSTADDR + regnum, addr);
|
||||
+ amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
|
||||
}
|
||||
|
||||
void
|
||||
-amd64_linux_dr_reset_addr (int regnum)
|
||||
+amd64_linux_dr_reset_addr (ptid_t ptid, int regnum)
|
||||
{
|
||||
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
|
||||
|
||||
- amd64_linux_dr_set (DR_FIRSTADDR + regnum, 0L);
|
||||
+ amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, 0L);
|
||||
}
|
||||
|
||||
unsigned long
|
||||
-amd64_linux_dr_get_status (void)
|
||||
+amd64_linux_dr_get_status (ptid_t ptid)
|
||||
{
|
||||
- return amd64_linux_dr_get (DR_STATUS);
|
||||
+ return amd64_linux_dr_get (ptid, DR_STATUS);
|
||||
}
|
||||
|
||||
|
||||
+/* Structure used to sync debug registers for all threads. */
|
||||
+struct amd64_debug_register_state
|
||||
+{
|
||||
+ int tid;
|
||||
+ CORE_ADDR addr[DR_LASTADDR - DR_FIRSTADDR + 1];
|
||||
+ unsigned long control;
|
||||
+};
|
||||
+
|
||||
+static void
|
||||
+amd64_linux_set_debug_regs_for_thread (ptid_t ptid,
|
||||
+ struct amd64_debug_register_state *dbs)
|
||||
+{
|
||||
+ int i;
|
||||
+ for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
|
||||
+ amd64_linux_dr_set_addr (ptid, i, dbs->addr[i]);
|
||||
+ amd64_linux_dr_set_control (ptid, dbs->control);
|
||||
+}
|
||||
+
|
||||
+/* Iterator function to support syncing debug registers across all threads. */
|
||||
+static int
|
||||
+amd64_linux_sync_debug_registers_callback (struct lwp_info *lwp, void *data)
|
||||
+{
|
||||
+ struct amd64_debug_register_state *args = data;
|
||||
+ int i, tid;
|
||||
+
|
||||
+ tid = TIDGET (lwp->ptid);
|
||||
+ if (tid == 0)
|
||||
+ tid = PIDGET (lwp->ptid);
|
||||
+
|
||||
+ if (tid != args->tid)
|
||||
+ amd64_linux_set_debug_regs_for_thread (lwp->ptid, args);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Sync the debug registers for all known threads to the current
|
||||
+ thread that has just performed an operation. This is required
|
||||
+ because the debug registers are thread-specific. We want
|
||||
+ watchpoints and hardware breakpoints to be treated globally
|
||||
+ across all threads. */
|
||||
+static int
|
||||
+amd64_linux_sync_debug_registers_across_threads (void)
|
||||
+{
|
||||
+ int i, tid;
|
||||
+ struct amd64_debug_register_state args;
|
||||
+
|
||||
+ tid = TIDGET (inferior_ptid);
|
||||
+ if (tid == 0)
|
||||
+ tid = PIDGET (inferior_ptid);
|
||||
+
|
||||
+ args.tid = tid;
|
||||
+ for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
|
||||
+ args.addr[i] = amd64_linux_dr_get (inferior_ptid, DR_FIRSTADDR + i);
|
||||
+ args.control = amd64_linux_dr_get (inferior_ptid, DR_CONTROL);
|
||||
+
|
||||
+ iterate_over_lwps (&amd64_linux_sync_debug_registers_callback, &args);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Insert a watchpoint to watch a memory region which starts at
|
||||
+ address ADDR and whose length is LEN bytes. Watch memory accesses
|
||||
+ of the type TYPE. Return 0 on success, -1 on failure. */
|
||||
+int
|
||||
+amd64_linux_insert_watchpoint (CORE_ADDR addr, int len, int type)
|
||||
+{
|
||||
+ int rc;
|
||||
+ rc = i386_insert_watchpoint (addr, len, type);
|
||||
+ if (!rc)
|
||||
+ amd64_linux_sync_debug_registers_across_threads ();
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/* Remove a watchpoint that watched the memory region which starts at
|
||||
+ address ADDR, whose length is LEN bytes, and for accesses of the
|
||||
+ type TYPE. Return 0 on success, -1 on failure. */
|
||||
+int
|
||||
+amd64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
|
||||
+{
|
||||
+ int rc;
|
||||
+ rc = i386_remove_watchpoint (addr, len, type);
|
||||
+ if (!rc)
|
||||
+ amd64_linux_sync_debug_registers_across_threads ();
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
|
||||
+ unused. Return 0 on success, EBUSY on failure. */
|
||||
+int
|
||||
+amd64_linux_insert_hw_breakpoint (struct bp_target_info *bp_tgt)
|
||||
+{
|
||||
+ int rc;
|
||||
+ rc = i386_insert_hw_breakpoint (bp_tgt);
|
||||
+ if (!rc)
|
||||
+ amd64_linux_sync_debug_registers_across_threads ();
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
|
||||
+ unused. Return 0 on success, -1 on failure. */
|
||||
+int
|
||||
+amd64_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt)
|
||||
+{
|
||||
+ int rc;
|
||||
+ rc = i386_remove_hw_breakpoint (bp_tgt);
|
||||
+ if (!rc)
|
||||
+ amd64_linux_sync_debug_registers_across_threads ();
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/* Observer function for a new thread attach. We need to insert
|
||||
+ existing watchpoints and hardware breakpoints on the new thread. */
|
||||
+static void
|
||||
+amd64_linux_new_thread (ptid_t ptid)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct amd64_debug_register_state dbs;
|
||||
+
|
||||
+ for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
|
||||
+ dbs.addr[i] = amd64_linux_dr_get (inferior_ptid, DR_FIRSTADDR + i);
|
||||
+ dbs.control = amd64_linux_dr_get (inferior_ptid, DR_CONTROL);
|
||||
+
|
||||
+ amd64_linux_set_debug_regs_for_thread (ptid, &dbs);
|
||||
+}
|
||||
+
|
||||
/* This function is called by libthread_db as part of its handling of
|
||||
a request for a thread's local storage address. */
|
||||
|
||||
@@ -399,4 +524,6 @@ _initialize_amd64_linux_nat (void)
|
||||
|
||||
/* Register the target. */
|
||||
linux_nat_add_target (t);
|
||||
+
|
||||
+ observer_attach_linux_new_thread (amd64_linux_new_thread);
|
||||
}
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/testsuite/gdb.threads/watchthreads.c 2006-07-12 01:55:19.000000000 -0300
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads.c 2006-07-12 01:56:51.000000000 -0300
|
||||
@@ -58,7 +58,7 @@ void *thread_function(void *arg) {
|
||||
/* Don't run forever. Run just short of it :) */
|
||||
while (*myp > 0)
|
||||
{
|
||||
- (*myp) ++; /* Loop increment. */
|
||||
+ (*myp) ++; usleep (1); /* Loop increment. */
|
||||
}
|
||||
|
||||
pthread_exit(NULL);
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
2004-12-13 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* dwarf2read.c (read_type_die): Ensure that structures, unions,
|
||||
enumerations, and base types create symbols.
|
||||
|
||||
--- gdb-6.3/gdb/dwarf2read.c.fix2 Mon Dec 13 19:44:08 2004
|
||||
+++ gdb-6.3/gdb/dwarf2read.c Mon Dec 13 20:00:42 2004
|
||||
@@ -7178,9 +7178,11 @@ read_type_die (struct die_info *die, str
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_union_type:
|
||||
read_structure_type (die, cu);
|
||||
+ process_structure_scope (die, cu);
|
||||
break;
|
||||
case DW_TAG_enumeration_type:
|
||||
read_enumeration_type (die, cu);
|
||||
+ process_enumeration_scope (die, cu);
|
||||
break;
|
||||
case DW_TAG_subprogram:
|
||||
case DW_TAG_subroutine_type:
|
||||
@@ -7215,6 +7217,7 @@ read_type_die (struct die_info *die, str
|
||||
break;
|
||||
case DW_TAG_base_type:
|
||||
read_base_type (die, cu);
|
||||
+ new_symbol (die, die->type, cu);
|
||||
break;
|
||||
default:
|
||||
complaint (&symfile_complaints, "unexepected tag in read_type_die: '%s'",
|
|
@ -1,584 +0,0 @@
|
|||
Index: gdb-6.5/gdb/configure
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/configure 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/configure 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -20125,7 +20125,8 @@ fi
|
||||
# gdb/doc/gdbint.texinfo.
|
||||
build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
|
||||
-Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \
|
||||
--Wunused-label -Wunused-function -Wno-pointer-sign"
|
||||
+-Wunused-label -Wunused-function -Wno-pointer-sign -Wno-unused \
|
||||
+-Wp,-U_FORTIFY_SOURCE"
|
||||
|
||||
# GCC supports -Wuninitialized only with -O or -On, n != 0.
|
||||
if test x${CFLAGS+set} = xset; then
|
||||
Index: gdb-6.5/gdb/mi/mi-cmd-env.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/mi/mi-cmd-env.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/mi/mi-cmd-env.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -126,7 +126,7 @@ mi_cmd_env_path (char *command, char **a
|
||||
static struct mi_opt opts[] =
|
||||
{
|
||||
{"r", RESET_OPT, 0},
|
||||
- 0
|
||||
+ {0}
|
||||
};
|
||||
|
||||
dont_repeat ();
|
||||
@@ -198,7 +198,7 @@ mi_cmd_env_dir (char *command, char **ar
|
||||
static struct mi_opt opts[] =
|
||||
{
|
||||
{"r", RESET_OPT, 0},
|
||||
- 0
|
||||
+ {0}
|
||||
};
|
||||
|
||||
dont_repeat ();
|
||||
Index: gdb-6.5/gdb/mi/mi-getopt.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/mi/mi-getopt.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/mi/mi-getopt.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -82,7 +82,7 @@ mi_valid_noargs (const char *prefix, int
|
||||
char *optarg;
|
||||
static struct mi_opt opts[] =
|
||||
{
|
||||
- 0
|
||||
+ {0}
|
||||
};
|
||||
|
||||
if (mi_getopt (prefix, argc, argv, opts, &optind, &optarg) == -1)
|
||||
Index: gdb-6.5/gdb/mi/mi-cmd-break.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/mi/mi-cmd-break.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/mi/mi-cmd-break.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -90,7 +90,7 @@ mi_cmd_break_insert (char *command, char
|
||||
{"c", CONDITION_OPT, 1},
|
||||
{"i", IGNORE_COUNT_OPT, 1},
|
||||
{"p", THREAD_OPT, 1},
|
||||
- 0
|
||||
+ {0}
|
||||
};
|
||||
|
||||
/* Parse arguments. It could be -r or -h or -t, <location> or ``--''
|
||||
@@ -196,7 +196,7 @@ mi_cmd_break_watch (char *command, char
|
||||
{
|
||||
{"r", READ_OPT, 0},
|
||||
{"a", ACCESS_OPT, 0},
|
||||
- 0
|
||||
+ {0}
|
||||
};
|
||||
|
||||
/* Parse arguments. */
|
||||
Index: gdb-6.5/gdb/mi/mi-cmd-disas.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/mi/mi-cmd-disas.c 2006-07-11 15:01:22.000000000 -0300
|
||||
+++ gdb-6.5/gdb/mi/mi-cmd-disas.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -84,7 +84,7 @@ mi_cmd_disassemble (char *command, char
|
||||
{"n", NUM_OPT, 1},
|
||||
{"s", START_OPT, 1},
|
||||
{"e", END_OPT, 1},
|
||||
- 0
|
||||
+ {0}
|
||||
};
|
||||
|
||||
/* Get the options with their arguments. Keep track of what we
|
||||
Index: gdb-6.5/gdb/mi/mi-main.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/mi/mi-main.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/mi/mi-main.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -773,7 +773,7 @@ mi_cmd_data_read_memory (char *command,
|
||||
static struct mi_opt opts[] =
|
||||
{
|
||||
{"o", OFFSET_OPT, 1},
|
||||
- 0
|
||||
+ {0}
|
||||
};
|
||||
|
||||
while (1)
|
||||
@@ -975,7 +975,7 @@ mi_cmd_data_write_memory (char *command,
|
||||
static struct mi_opt opts[] =
|
||||
{
|
||||
{"o", OFFSET_OPT, 1},
|
||||
- 0
|
||||
+ {0}
|
||||
};
|
||||
|
||||
while (1)
|
||||
Index: gdb-6.5/gdb/p-valprint.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/p-valprint.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/p-valprint.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -753,7 +753,7 @@ pascal_object_print_value_fields (struct
|
||||
int dont_print_statmem)
|
||||
{
|
||||
int i, len, n_baseclasses;
|
||||
- struct obstack tmp_obstack;
|
||||
+ struct obstack tmp_obstack = {0};
|
||||
char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
|
||||
|
||||
CHECK_TYPEDEF (type);
|
||||
@@ -922,7 +922,7 @@ pascal_object_print_value (struct type *
|
||||
enum val_prettyprint pretty,
|
||||
struct type **dont_print_vb)
|
||||
{
|
||||
- struct obstack tmp_obstack;
|
||||
+ struct obstack tmp_obstack = {0};
|
||||
struct type **last_dont_print
|
||||
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
|
||||
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
|
||||
Index: gdb-6.5/gdb/cp-valprint.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/cp-valprint.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/cp-valprint.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -265,7 +265,7 @@ cp_print_value_fields (struct type *type
|
||||
struct type **dont_print_vb,int dont_print_statmem)
|
||||
{
|
||||
int i, len, n_baseclasses;
|
||||
- struct obstack tmp_obstack;
|
||||
+ struct obstack tmp_obstack = {0};
|
||||
char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
|
||||
int fields_seen = 0;
|
||||
|
||||
@@ -524,7 +524,7 @@ cp_print_value (struct type *type, struc
|
||||
struct ui_file *stream, int format, int recurse,
|
||||
enum val_prettyprint pretty, struct type **dont_print_vb)
|
||||
{
|
||||
- struct obstack tmp_obstack;
|
||||
+ struct obstack tmp_obstack = {0};
|
||||
struct type **last_dont_print
|
||||
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
|
||||
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
|
||||
Index: gdb-6.5/gdb/tui/tui-layout.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/tui/tui-layout.c 2006-07-11 15:01:22.000000000 -0300
|
||||
+++ gdb-6.5/gdb/tui/tui-layout.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -755,7 +755,7 @@ show_source_disasm_command (void)
|
||||
if (TUI_DISASM_WIN == NULL)
|
||||
{
|
||||
make_disasm_window (&TUI_DISASM_WIN, asm_height, src_height - 1);
|
||||
- init_and_make_win ((void **) & locator,
|
||||
+ init_and_make_win ((void **)(char *) & locator,
|
||||
LOCATOR_WIN,
|
||||
2 /* 1 */ ,
|
||||
tui_term_width (),
|
||||
@@ -848,7 +848,7 @@ show_data (enum tui_layout_type new_layo
|
||||
make_source_window (&tui_win_list[win_type], src_height, data_height - 1);
|
||||
else
|
||||
make_disasm_window (&tui_win_list[win_type], src_height, data_height - 1);
|
||||
- init_and_make_win ((void **) & locator,
|
||||
+ init_and_make_win ((void **)(char *) & locator,
|
||||
LOCATOR_WIN,
|
||||
2 /* 1 */ ,
|
||||
tui_term_width (),
|
||||
@@ -963,7 +963,7 @@ make_source_or_disasm_window (struct tui
|
||||
execution_info = tui_source_exec_info_win_ptr ();
|
||||
else
|
||||
execution_info = tui_disassem_exec_info_win_ptr ();
|
||||
- init_and_make_win ((void **) & execution_info,
|
||||
+ init_and_make_win ((void **)(char *) & execution_info,
|
||||
EXEC_INFO_WIN,
|
||||
height,
|
||||
3,
|
||||
@@ -1013,7 +1013,7 @@ show_source_or_disasm_and_command (enum
|
||||
make_source_window (win_info_ptr, src_height - 1, 0);
|
||||
else
|
||||
make_disasm_window (win_info_ptr, src_height - 1, 0);
|
||||
- init_and_make_win ((void **) & locator,
|
||||
+ init_and_make_win ((void **)(char *) & locator,
|
||||
LOCATOR_WIN,
|
||||
2 /* 1 */ ,
|
||||
tui_term_width (),
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.base/move-dir.h
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/testsuite/gdb.base/move-dir.h 2006-07-11 15:01:23.000000000 -0300
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/move-dir.h 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -1,4 +1,4 @@
|
||||
-#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
|
||||
void other() {
|
||||
const char* ostring = "other";
|
||||
Index: gdb-6.5/gdb/testsuite/gdb.base/sigrepeat.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/testsuite/gdb.base/sigrepeat.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/sigrepeat.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
+#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
static volatile int done[2];
|
||||
Index: gdb-6.5/gdb/s390-tdep.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/s390-tdep.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/s390-tdep.c 2006-07-11 15:02:37.000000000 -0300
|
||||
@@ -2277,6 +2277,9 @@ s390_return_value (struct gdbarch *gdbar
|
||||
case RETURN_VALUE_STRUCT_CONVENTION:
|
||||
error (_("Cannot set function return value."));
|
||||
break;
|
||||
+
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
else if (out)
|
||||
@@ -2309,6 +2312,9 @@ s390_return_value (struct gdbarch *gdbar
|
||||
case RETURN_VALUE_STRUCT_CONVENTION:
|
||||
error (_("Function return value unknown."));
|
||||
break;
|
||||
+
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
Index: gdb-6.5/gdb/remote.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/remote.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/remote.c 2006-07-11 15:02:32.000000000 -0300
|
||||
@@ -2523,10 +2523,10 @@ cleanup_sigint_signal_handler (void *dum
|
||||
{
|
||||
signal (SIGINT, handle_sigint);
|
||||
if (sigint_remote_twice_token)
|
||||
- delete_async_signal_handler ((struct async_signal_handler **)
|
||||
+ delete_async_signal_handler ((struct async_signal_handler **) (char *)
|
||||
&sigint_remote_twice_token);
|
||||
if (sigint_remote_token)
|
||||
- delete_async_signal_handler ((struct async_signal_handler **)
|
||||
+ delete_async_signal_handler ((struct async_signal_handler **) (char *)
|
||||
&sigint_remote_token);
|
||||
}
|
||||
|
||||
Index: gdb-6.5/gdb/f-exp.y
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/f-exp.y 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/f-exp.y 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -567,6 +567,8 @@ ptype : typebase
|
||||
case tp_function:
|
||||
follow_type = lookup_function_type (follow_type);
|
||||
break;
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
$$ = follow_type;
|
||||
}
|
||||
Index: gdb-6.5/gdb/remote-fileio.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/remote-fileio.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/remote-fileio.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -1317,19 +1317,19 @@ static struct {
|
||||
char *name;
|
||||
void (*func)(char *);
|
||||
} remote_fio_func_map[] = {
|
||||
- "open", remote_fileio_func_open,
|
||||
- "close", remote_fileio_func_close,
|
||||
- "read", remote_fileio_func_read,
|
||||
- "write", remote_fileio_func_write,
|
||||
- "lseek", remote_fileio_func_lseek,
|
||||
- "rename", remote_fileio_func_rename,
|
||||
- "unlink", remote_fileio_func_unlink,
|
||||
- "stat", remote_fileio_func_stat,
|
||||
- "fstat", remote_fileio_func_fstat,
|
||||
- "gettimeofday", remote_fileio_func_gettimeofday,
|
||||
- "isatty", remote_fileio_func_isatty,
|
||||
- "system", remote_fileio_func_system,
|
||||
- NULL, NULL
|
||||
+ {"open", remote_fileio_func_open},
|
||||
+ {"close", remote_fileio_func_close},
|
||||
+ {"read", remote_fileio_func_read},
|
||||
+ {"write", remote_fileio_func_write},
|
||||
+ {"lseek", remote_fileio_func_lseek},
|
||||
+ {"rename", remote_fileio_func_rename},
|
||||
+ {"unlink", remote_fileio_func_unlink},
|
||||
+ {"stat", remote_fileio_func_stat},
|
||||
+ {"fstat", remote_fileio_func_fstat},
|
||||
+ {"gettimeofday", remote_fileio_func_gettimeofday},
|
||||
+ {"isatty", remote_fileio_func_isatty},
|
||||
+ {"system", remote_fileio_func_system},
|
||||
+ {NULL, NULL}
|
||||
};
|
||||
|
||||
static int
|
||||
Index: gdb-6.5/gdb/source.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/source.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/source.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -160,7 +160,7 @@ get_current_source_symtab_and_line (void
|
||||
void
|
||||
set_default_source_symtab_and_line (void)
|
||||
{
|
||||
- struct symtab_and_line cursal;
|
||||
+ struct symtab_and_line cursal = {0};
|
||||
|
||||
if (!have_full_symbols () && !have_partial_symbols ())
|
||||
error (_("No symbol table is loaded. Use the \"file\" command."));
|
||||
@@ -1314,7 +1314,7 @@ static void
|
||||
line_info (char *arg, int from_tty)
|
||||
{
|
||||
struct symtabs_and_lines sals;
|
||||
- struct symtab_and_line sal;
|
||||
+ struct symtab_and_line sal = {0};
|
||||
CORE_ADDR start_pc, end_pc;
|
||||
int i;
|
||||
|
||||
Index: gdb-6.5/gdb/symfile.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/symfile.c 2006-07-11 15:01:22.000000000 -0300
|
||||
+++ gdb-6.5/gdb/symfile.c 2006-07-11 15:02:34.000000000 -0300
|
||||
@@ -2877,6 +2877,8 @@ add_psymbol_with_dem_name_to_list (char
|
||||
deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache);
|
||||
break;
|
||||
/* FIXME What should be done for the default case? Ignoring for now. */
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
|
||||
/* val and coreaddr are mutually exclusive, one of them *will* be zero */
|
||||
Index: gdb-6.5/gdb/linespec.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linespec.c 2006-07-11 15:01:23.000000000 -0300
|
||||
+++ gdb-6.5/gdb/linespec.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -1631,7 +1631,7 @@ static struct symtabs_and_lines
|
||||
find_method (int funfirstline, char ***canonical, char *saved_arg,
|
||||
char *copy, struct type *t, struct symbol *sym_class)
|
||||
{
|
||||
- struct symtabs_and_lines values;
|
||||
+ struct symtabs_and_lines values = {0};
|
||||
struct symbol *sym = 0;
|
||||
int i1; /* Counter for the symbol array. */
|
||||
struct symbol **sym_arr = alloca (total_number_of_methods (t)
|
||||
Index: gdb-6.5/gdb/macroscope.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/macroscope.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/macroscope.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -33,7 +33,7 @@
|
||||
struct macro_scope *
|
||||
sal_macro_scope (struct symtab_and_line sal)
|
||||
{
|
||||
- struct macro_source_file *main, *inclusion;
|
||||
+ struct macro_source_file *main_sf, *inclusion;
|
||||
struct macro_scope *ms;
|
||||
|
||||
if (! sal.symtab
|
||||
@@ -42,8 +42,8 @@ sal_macro_scope (struct symtab_and_line
|
||||
|
||||
ms = (struct macro_scope *) xmalloc (sizeof (*ms));
|
||||
|
||||
- main = macro_main (sal.symtab->macro_table);
|
||||
- inclusion = macro_lookup_inclusion (main, sal.symtab->filename);
|
||||
+ main_sf = macro_main (sal.symtab->macro_table);
|
||||
+ inclusion = macro_lookup_inclusion (main_sf, sal.symtab->filename);
|
||||
|
||||
if (inclusion)
|
||||
{
|
||||
@@ -66,7 +66,7 @@ sal_macro_scope (struct symtab_and_line
|
||||
|
||||
For the time being, though, we'll just treat these as
|
||||
occurring at the end of the main source file. */
|
||||
- ms->file = main;
|
||||
+ ms->file = main_sf;
|
||||
ms->line = -1;
|
||||
|
||||
complaint (&symfile_complaints,
|
||||
@@ -83,7 +83,6 @@ struct macro_scope *
|
||||
default_macro_scope (void)
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
- struct macro_source_file *main;
|
||||
struct macro_scope *ms;
|
||||
|
||||
/* If there's a selected frame, use its PC. */
|
||||
Index: gdb-6.5/gdb/target.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/target.c 2006-07-11 15:01:22.000000000 -0300
|
||||
+++ gdb-6.5/gdb/target.c 2006-07-11 15:02:33.000000000 -0300
|
||||
@@ -1142,6 +1142,9 @@ target_xfer_memory (CORE_ADDR memaddr, g
|
||||
if (!write)
|
||||
return EIO;
|
||||
break;
|
||||
+
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
|
||||
while (reg_len > 0)
|
||||
@@ -1220,6 +1223,9 @@ target_xfer_memory_partial (CORE_ADDR me
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
+
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
|
||||
if (region->attrib.cache)
|
||||
Index: gdb-6.5/gdb/gdb-events.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/gdb-events.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/gdb-events.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -321,6 +321,8 @@ gdb_events_deliver (struct gdb_events *v
|
||||
case architecture_changed:
|
||||
vector->architecture_changed ();
|
||||
break;
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
delivering_events = event->next;
|
||||
xfree (event);
|
||||
Index: gdb-6.5/gdb/dwarf2read.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/dwarf2read.c 2006-07-11 15:01:23.000000000 -0300
|
||||
+++ gdb-6.5/gdb/dwarf2read.c 2006-07-11 15:02:33.000000000 -0300
|
||||
@@ -9179,6 +9179,7 @@ dwarf_decode_macros (struct line_header
|
||||
for (;;)
|
||||
{
|
||||
enum dwarf_macinfo_record_type macinfo_type;
|
||||
+ int tmp;
|
||||
|
||||
/* Do we at least have room for a macinfo type byte? */
|
||||
if (mac_ptr >= mac_end)
|
||||
@@ -9190,13 +9191,16 @@ dwarf_decode_macros (struct line_header
|
||||
macinfo_type = read_1_byte (abfd, mac_ptr);
|
||||
mac_ptr++;
|
||||
|
||||
+ /* Check for a zero macinfo type which indicates the end of the macro
|
||||
+ information. We do this as the compiler may warn us if we
|
||||
+ try and look for 0 in the switch below because 0 is not
|
||||
+ an enumerated value. */
|
||||
+ tmp = (int)macinfo_type;
|
||||
+ if (tmp == 0)
|
||||
+ return;
|
||||
+
|
||||
switch (macinfo_type)
|
||||
{
|
||||
- /* A zero macinfo type indicates the end of the macro
|
||||
- information. */
|
||||
- case 0:
|
||||
- return;
|
||||
-
|
||||
case DW_MACINFO_define:
|
||||
case DW_MACINFO_undef:
|
||||
{
|
||||
Index: gdb-6.5/gdb/stabsread.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/stabsread.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/stabsread.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -1794,7 +1794,8 @@ again:
|
||||
struct type *domain = read_type (pp, objfile);
|
||||
struct type *return_type;
|
||||
struct field *args;
|
||||
- int nargs, varargs;
|
||||
+ int nargs = 0;
|
||||
+ int varargs = 0;
|
||||
|
||||
if (**pp != ',')
|
||||
/* Invalid member type data format. */
|
||||
Index: gdb-6.5/gdb/dwarf2expr.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/dwarf2expr.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/dwarf2expr.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -559,6 +559,8 @@ execute_stack_op (struct dwarf_expr_cont
|
||||
op_ptr = read_uleb128 (op_ptr, op_end, ®);
|
||||
result += reg;
|
||||
break;
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
break;
|
||||
|
||||
Index: gdb-6.5/gdb/varobj.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/varobj.c 2006-07-11 15:01:22.000000000 -0300
|
||||
+++ gdb-6.5/gdb/varobj.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -325,10 +325,9 @@ struct language_specific
|
||||
|
||||
/* Array of known source language routines. */
|
||||
static struct language_specific
|
||||
- languages[vlang_end][sizeof (struct language_specific)] = {
|
||||
+ languages[vlang_end] = {
|
||||
/* Unknown (try treating as C */
|
||||
- {
|
||||
- vlang_unknown,
|
||||
+ {vlang_unknown,
|
||||
c_number_of_children,
|
||||
c_name_of_variable,
|
||||
c_name_of_child,
|
||||
@@ -339,8 +338,7 @@ static struct language_specific
|
||||
c_value_of_variable}
|
||||
,
|
||||
/* C */
|
||||
- {
|
||||
- vlang_c,
|
||||
+ {vlang_c,
|
||||
c_number_of_children,
|
||||
c_name_of_variable,
|
||||
c_name_of_child,
|
||||
@@ -351,8 +349,7 @@ static struct language_specific
|
||||
c_value_of_variable}
|
||||
,
|
||||
/* C++ */
|
||||
- {
|
||||
- vlang_cplus,
|
||||
+ {vlang_cplus,
|
||||
cplus_number_of_children,
|
||||
cplus_name_of_variable,
|
||||
cplus_name_of_child,
|
||||
@@ -363,8 +360,7 @@ static struct language_specific
|
||||
cplus_value_of_variable}
|
||||
,
|
||||
/* Java */
|
||||
- {
|
||||
- vlang_java,
|
||||
+ {vlang_java,
|
||||
java_number_of_children,
|
||||
java_name_of_variable,
|
||||
java_name_of_child,
|
||||
@@ -519,7 +515,7 @@ varobj_create (char *objname,
|
||||
|
||||
/* Set language info */
|
||||
lang = variable_language (var);
|
||||
- var->root->lang = languages[lang];
|
||||
+ var->root->lang = &languages[lang];
|
||||
|
||||
/* Set ourselves as our root */
|
||||
var->root->rootvar = var;
|
||||
Index: gdb-6.5/gdb/configure.ac
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/configure.ac 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/configure.ac 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -1133,7 +1133,8 @@ fi
|
||||
# gdb/doc/gdbint.texinfo.
|
||||
build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
|
||||
-Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \
|
||||
--Wunused-label -Wunused-function -Wno-pointer-sign"
|
||||
+-Wunused-label -Wunused-function -Wno-pointer-sign -Wno-unused \
|
||||
+-Wp,-U_FORTIFY_SOURCE"
|
||||
|
||||
# GCC supports -Wuninitialized only with -O or -On, n != 0.
|
||||
if test x${CFLAGS+set} = xset; then
|
||||
Index: gdb-6.5/gdb/doublest.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/doublest.c 2006-07-11 15:00:08.000000000 -0300
|
||||
+++ gdb-6.5/gdb/doublest.c 2006-07-11 15:01:23.000000000 -0300
|
||||
@@ -94,15 +94,10 @@ get_field (const bfd_byte *data, enum fl
|
||||
{
|
||||
result |= (unsigned long)*(data + cur_byte) << cur_bitshift;
|
||||
cur_bitshift += FLOATFORMAT_CHAR_BIT;
|
||||
- switch (order)
|
||||
- {
|
||||
- case floatformat_little:
|
||||
- ++cur_byte;
|
||||
- break;
|
||||
- case floatformat_big:
|
||||
- --cur_byte;
|
||||
- break;
|
||||
- }
|
||||
+ if (order == floatformat_little)
|
||||
+ ++cur_byte;
|
||||
+ else
|
||||
+ --cur_byte;
|
||||
}
|
||||
if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT)
|
||||
/* Mask out bits which are not part of the field */
|
|
@ -1,21 +0,0 @@
|
|||
2005-09-22 Bastien Nocera <bnocera@redhat.com>
|
||||
|
||||
* symtab.c (find_line_pc_range): Don't free up pc_list
|
||||
unconditionally as it may not be allocated.
|
||||
|
||||
--- gdb-6.3/gdb/symtab.c.fix 2005-09-22 16:24:06.000000000 -0400
|
||||
+++ gdb-6.3/gdb/symtab.c 2005-09-22 16:26:17.000000000 -0400
|
||||
@@ -2427,9 +2427,10 @@ find_line_pc_range (struct symtab_and_li
|
||||
/* FIXME: have to handle ctors/dtors where line equates to multiple
|
||||
pc ranges. */
|
||||
if (startaddr == 0)
|
||||
- startaddr = pc_list[0];
|
||||
-
|
||||
- xfree (pc_list);
|
||||
+ {
|
||||
+ startaddr = pc_list[0];
|
||||
+ xfree (pc_list);
|
||||
+ }
|
||||
|
||||
/* This whole function is based on address. For example, if line 10 has
|
||||
two parts, one from 0x100 to 0x200 and one from 0x300 to 0x400, then
|
|
@ -0,0 +1,938 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-BEA-testsuite.patch
|
||||
|
||||
;; Improved testsuite results by the testsuite provided by the courtesy of BEA.
|
||||
;;=fedoratest: For upstream it should be rewritten as a dejagnu test, the test of no "??" was useful.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/threadcrash.c b/gdb/testsuite/gdb.threads/threadcrash.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threadcrash.c
|
||||
@@ -0,0 +1,301 @@
|
||||
+/*
|
||||
+ * The point of this program is to crash in a multi-threaded app.
|
||||
+ * There are seven threads, doing the following things:
|
||||
+ * * Spinning
|
||||
+ * * Spinning inside a signal handler
|
||||
+ * * Spinning inside a signal handler executing on the altstack
|
||||
+ * * In a syscall
|
||||
+ * * In a syscall inside a signal handler
|
||||
+ * * In a syscall inside a signal handler executing on the altstack
|
||||
+ * * Finally, the main thread crashes in main, with no frills.
|
||||
+ *
|
||||
+ * These are the things threads in JRockit tend to be doing. If gdb
|
||||
+ * can handle those things, both in core files and during live
|
||||
+ * debugging, that will help (at least) JRockit development.
|
||||
+ *
|
||||
+ * Let the program create a core file, then load the core file into
|
||||
+ * gdb. Inside gdb, you should be able to do something like this:
|
||||
+ *
|
||||
+ * (gdb) t a a bt
|
||||
+ *
|
||||
+ * Thread 7 (process 4352):
|
||||
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
|
||||
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
|
||||
+ * #2 0x080488a2 in makeSyscall (ignored=0x0) at threadcrash.c:118
|
||||
+ * #3 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #4 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 6 (process 4353):
|
||||
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
|
||||
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
|
||||
+ * #2 0x0804898f in syscallingSighandler (signo=10, info=0xb6be76f0, context=0xb6be7770)
|
||||
+ * at threadcrash.c:168
|
||||
+ * #3 <signal handler called>
|
||||
+ * #4 0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
|
||||
+ * #5 0x08048a51 in makeSyscallFromSighandler (ignored=0x0) at threadcrash.c:204
|
||||
+ * #6 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #7 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 5 (process 4354):
|
||||
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
|
||||
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
|
||||
+ * #2 0x08048936 in syscallingAltSighandler (signo=3, info=0x959cd70, context=0x959cdf0)
|
||||
+ * at threadcrash.c:144
|
||||
+ * #3 <signal handler called>
|
||||
+ * #4 0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
|
||||
+ * #5 0x080489e2 in makeSyscallFromAltSighandler (ignored=0x0) at threadcrash.c:190
|
||||
+ * #6 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #7 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 4 (process 4355):
|
||||
+ * #0 spin (ignored=0x0) at threadcrash.c:242
|
||||
+ * #1 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #2 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 3 (process 4356):
|
||||
+ * #0 spinningSighandler (signo=12, info=0xb4de46f0, context=0xb4de4770) at threadcrash.c:180
|
||||
+ * #1 <signal handler called>
|
||||
+ * #2 0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
|
||||
+ * #3 0x08048b2f in spinFromSighandler (ignored=0x0) at threadcrash.c:232
|
||||
+ * #4 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #5 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 2 (process 4357):
|
||||
+ * #0 spinningAltSighandler (signo=14, info=0x959ee50, context=0x959eed0) at threadcrash.c:156
|
||||
+ * #1 <signal handler called>
|
||||
+ * #2 0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
|
||||
+ * #3 0x08048ac0 in spinFromAltSighandler (ignored=0x0) at threadcrash.c:218
|
||||
+ * #4 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #5 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 1 (process 4351):
|
||||
+ * #0 0x08048cf3 in main (argc=1, argv=0xbfff9d74) at threadcrash.c:273
|
||||
+ * (gdb)
|
||||
+ */
|
||||
+
|
||||
+#include <pthread.h>
|
||||
+#include <signal.h>
|
||||
+#include <assert.h>
|
||||
+#include <unistd.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+#define SIGSYSCALL_ALT SIGQUIT
|
||||
+#define SIGSYSCALL SIGUSR1
|
||||
+#define SIGSPIN_ALT SIGALRM
|
||||
+#define SIGSPIN SIGUSR2
|
||||
+
|
||||
+typedef void (*sigaction_t)(int, siginfo_t *, void *);
|
||||
+
|
||||
+static void installHandler(int signo, sigaction_t handler, int onAltstack) {
|
||||
+ struct sigaction action;
|
||||
+ sigset_t sigset;
|
||||
+ int result;
|
||||
+ stack_t altstack;
|
||||
+ stack_t oldaltstack;
|
||||
+
|
||||
+ memset(&action, 0, sizeof(action));
|
||||
+ memset(&altstack, 0, sizeof(altstack));
|
||||
+ memset(&oldaltstack, 0, sizeof(oldaltstack));
|
||||
+
|
||||
+ if (onAltstack) {
|
||||
+ altstack.ss_sp = malloc(SIGSTKSZ);
|
||||
+ assert(altstack.ss_sp != NULL);
|
||||
+ altstack.ss_size = SIGSTKSZ;
|
||||
+ altstack.ss_flags = 0;
|
||||
+ result = sigaltstack(&altstack, &oldaltstack);
|
||||
+ assert(result == 0);
|
||||
+ assert(oldaltstack.ss_flags == SS_DISABLE);
|
||||
+ }
|
||||
+
|
||||
+ sigemptyset(&sigset);
|
||||
+
|
||||
+ action.sa_handler = NULL;
|
||||
+ action.sa_sigaction = handler;
|
||||
+ action.sa_mask = sigset;
|
||||
+ action.sa_flags = SA_SIGINFO;
|
||||
+ if (onAltstack) {
|
||||
+ action.sa_flags |= SA_ONSTACK;
|
||||
+ }
|
||||
+
|
||||
+ result = sigaction(signo, &action, NULL);
|
||||
+ assert(result == 0);
|
||||
+}
|
||||
+
|
||||
+static void installNormalHandler(int signo, sigaction_t handler) {
|
||||
+ installHandler(signo, handler, 0);
|
||||
+}
|
||||
+
|
||||
+static void installAlthandler(int signo, sigaction_t handler) {
|
||||
+ installHandler(signo, handler, 1);
|
||||
+}
|
||||
+
|
||||
+static void *makeSyscall(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ sleep(42);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+/* Return true if we're currently executing on the altstack */
|
||||
+static int onAltstack(void) {
|
||||
+ stack_t stack;
|
||||
+ int result;
|
||||
+
|
||||
+ result = sigaltstack(NULL, &stack);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ return stack.ss_flags & SS_ONSTACK;
|
||||
+}
|
||||
+
|
||||
+static void syscallingAltSighandler(int signo, siginfo_t *info, void *context) {
|
||||
+ (void)signo;
|
||||
+ (void)info;
|
||||
+ (void)context;
|
||||
+
|
||||
+ if (!onAltstack()) {
|
||||
+ printf("%s() not running on altstack!\n", __FUNCTION__);
|
||||
+ }
|
||||
+
|
||||
+ sleep(42);
|
||||
+}
|
||||
+
|
||||
+static void spinningAltSighandler(int signo, siginfo_t *info, void *context) {
|
||||
+ (void)signo;
|
||||
+ (void)info;
|
||||
+ (void)context;
|
||||
+
|
||||
+ if (!onAltstack()) {
|
||||
+ printf("%s() not running on altstack!\n", __FUNCTION__);
|
||||
+ }
|
||||
+
|
||||
+ while (1);
|
||||
+}
|
||||
+
|
||||
+static void syscallingSighandler(int signo, siginfo_t *info, void *context) {
|
||||
+ (void)signo;
|
||||
+ (void)info;
|
||||
+ (void)context;
|
||||
+
|
||||
+ if (onAltstack()) {
|
||||
+ printf("%s() running on altstack!\n", __FUNCTION__);
|
||||
+ }
|
||||
+
|
||||
+ sleep(42);
|
||||
+}
|
||||
+
|
||||
+static void spinningSighandler(int signo, siginfo_t *info, void *context) {
|
||||
+ (void)signo;
|
||||
+ (void)info;
|
||||
+ (void)context;
|
||||
+
|
||||
+ if (onAltstack()) {
|
||||
+ printf("%s() running on altstack!\n", __FUNCTION__);
|
||||
+ }
|
||||
+
|
||||
+ while (1);
|
||||
+}
|
||||
+
|
||||
+static void *makeSyscallFromAltSighandler(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ int result;
|
||||
+
|
||||
+ installAlthandler(SIGSYSCALL_ALT, syscallingAltSighandler);
|
||||
+
|
||||
+ result = pthread_kill(pthread_self(), SIGSYSCALL_ALT);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void *makeSyscallFromSighandler(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ int result;
|
||||
+
|
||||
+ installNormalHandler(SIGSYSCALL, syscallingSighandler);
|
||||
+
|
||||
+ result = pthread_kill(pthread_self(), SIGSYSCALL);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void *spinFromAltSighandler(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ int result;
|
||||
+
|
||||
+ installAlthandler(SIGSPIN_ALT, spinningAltSighandler);
|
||||
+
|
||||
+ result = pthread_kill(pthread_self(), SIGSPIN_ALT);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void *spinFromSighandler(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ int result;
|
||||
+
|
||||
+ installNormalHandler(SIGSPIN, spinningSighandler);
|
||||
+
|
||||
+ result = pthread_kill(pthread_self(), SIGSPIN);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void *spin(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ while (1);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+int main(int argc, char *argv[]) {
|
||||
+ int result;
|
||||
+ pthread_t thread;
|
||||
+ volatile int bad;
|
||||
+
|
||||
+ result = pthread_create(&thread, NULL, makeSyscall, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, makeSyscallFromSighandler, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, makeSyscallFromAltSighandler, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, spin, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, spinFromSighandler, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, spinFromAltSighandler, NULL);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ // Give threads some time to get going
|
||||
+ sleep(3);
|
||||
+
|
||||
+ // Crash
|
||||
+ bad = *(int*)7;
|
||||
+
|
||||
+ /* Workaround: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29628
|
||||
+ Simulate use to ensure `DW_AT_location' for them:
|
||||
+ readelf -a --debug threadcrash|grep -A5 -w argc
|
||||
+ --> DW_AT_location : 2 byte block: 71 0 (DW_OP_breg1: 0)
|
||||
+ This case verified on: gcc-4.1.1-30.i386
|
||||
+ Keep it late to ensure persistency in the registers. */
|
||||
+ bad = (int) argc;
|
||||
+ bad = (unsigned long) argv;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threadcrash.exp
|
||||
@@ -0,0 +1,37 @@
|
||||
+# threadcrash.exp - The point of this program is to crash in a multi-threaded app.
|
||||
+
|
||||
+
|
||||
+set testfile threadcrash
|
||||
+set srcfile ${testfile}.c
|
||||
+set shellfile ${srcdir}/${subdir}/${testfile}.sh
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+set GDB_abs ${GDB}
|
||||
+if [regexp "^\[^/\]" ${GDB_abs}] {
|
||||
+ set GDB_abs $env(PWD)/${GDB_abs}
|
||||
+}
|
||||
+
|
||||
+if [istarget "*-*-linux"] then {
|
||||
+ set target_cflags "-D_MIT_POSIX_THREADS"
|
||||
+} else {
|
||||
+ set target_cflags ""
|
||||
+}
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# ${shellfile} argument must not contain any directories.
|
||||
+set fd [open "|bash ${shellfile} ${binfile} $GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]" r]
|
||||
+while { [gets $fd line] >= 0 } {
|
||||
+ if [regexp " PASS: (.*)$" $line trash message] {
|
||||
+ pass $message
|
||||
+ } elseif [regexp " FAIL: (.*)$" $line trash message] {
|
||||
+ fail $message
|
||||
+ }
|
||||
+}
|
||||
+catch {
|
||||
+ close $fd
|
||||
+}
|
||||
+
|
||||
+return 0
|
||||
diff --git a/gdb/testsuite/gdb.threads/threadcrash.sh b/gdb/testsuite/gdb.threads/threadcrash.sh
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threadcrash.sh
|
||||
@@ -0,0 +1,324 @@
|
||||
+#! /bin/bash
|
||||
+
|
||||
+# NOTE: threadcrash.c *must* be built with debugging symbols
|
||||
+#
|
||||
+# The point of this shell script is to crash treadcrash.c, load the
|
||||
+# resulting core file into gdb and verify that gdb can extract enough
|
||||
+# information from the core file.
|
||||
+#
|
||||
+# The return code from this script is the number of failed tests.
|
||||
+
|
||||
+LOG=gdbresult.log
|
||||
+
|
||||
+if [ $# = 0 ] ; then
|
||||
+ echo >&2 Syntax: $0 \<name of threadcrash binary\> [\<gdb binary\> \<args...\>]
|
||||
+ exit 1
|
||||
+fi
|
||||
+RUNME="$1"
|
||||
+shift
|
||||
+GDB="${*:-gdb}"
|
||||
+
|
||||
+
|
||||
+pf_prefix=""
|
||||
+function pf_prefix() {
|
||||
+ pf_prefix="$*"
|
||||
+}
|
||||
+
|
||||
+set_test=""
|
||||
+function set_test() {
|
||||
+ if [ -n "$set_test" ] ; then
|
||||
+ echo >&2 "DEJAGNU-BASH ERROR: set_test already set"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ set_test="$*"
|
||||
+ if [ -n "$pf_prefix" ] ; then
|
||||
+ set_test="$pf_prefix: $set_test"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+# INTERNAL
|
||||
+function record_test {
|
||||
+ if [ -z "$set_test" ] ; then
|
||||
+ echo >&2 "DEJAGNU-BASH ERROR: set_test not set"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ # Provide the leading whitespace delimiter:
|
||||
+ echo " $1: $set_test"
|
||||
+ set_test=""
|
||||
+}
|
||||
+
|
||||
+function pass() {
|
||||
+ record_test PASS
|
||||
+}
|
||||
+function fail() {
|
||||
+ record_test FAIL
|
||||
+}
|
||||
+
|
||||
+
|
||||
+# Verify that the gdb output doesn't contain $1.
|
||||
+function mustNotHave() {
|
||||
+ local BADWORD=$1
|
||||
+ set_test gdb output contains "$BADWORD"
|
||||
+ if grep -q "$BADWORD" $LOG ; then
|
||||
+ fail
|
||||
+ return 1
|
||||
+ fi
|
||||
+ pass
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output contains exactly $1 $2s.
|
||||
+function mustHaveCorrectAmount() {
|
||||
+ local WANTEDNUMBER=$1
|
||||
+ local GOODWORD=$2
|
||||
+ local ACTUALNUMBER=$(grep "$GOODWORD" $LOG | wc -l)
|
||||
+ set_test gdb output contained $ACTUALNUMBER \""$GOODWORD"\", not $WANTEDNUMBER as expected
|
||||
+ if [ $ACTUALNUMBER != $WANTEDNUMBER ] ; then
|
||||
+ fail
|
||||
+ return 1
|
||||
+ fi
|
||||
+ pass
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output contains seven threads
|
||||
+function mustHaveSevenThreads() {
|
||||
+ NTHREADS=$(egrep "^Thread [1-7] \(" $LOG | wc -l)
|
||||
+ set_test gdb output contains $NTHREADS threads, not 7 as expected
|
||||
+ if [ $NTHREADS != 7 ] ; then
|
||||
+ fail
|
||||
+ return 1
|
||||
+ fi
|
||||
+ pass
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output has all parameters on consecutive lines
|
||||
+function mustHaveSequence() {
|
||||
+ SEQUENCE="$*"
|
||||
+ NPARTS=$#
|
||||
+ grep "$1" -A$((NPARTS - 1)) $LOG > matches.log
|
||||
+
|
||||
+ while [ $# -gt 1 ] ; do
|
||||
+ shift
|
||||
+ ((NPARTS--))
|
||||
+ grep "$1" -A$((NPARTS - 1)) matches.log > temp.log
|
||||
+ mv temp.log matches.log
|
||||
+ done
|
||||
+ LASTPART=$1
|
||||
+
|
||||
+ set_test gdb output does not contain the sequence: $SEQUENCE
|
||||
+ if ! grep -q "$LASTPART" matches.log ; then
|
||||
+ fail
|
||||
+ return 1
|
||||
+ fi
|
||||
+ pass
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that $LOG contains all information we want
|
||||
+function verifyLog() {
|
||||
+ local FAILURES=0
|
||||
+
|
||||
+ mustNotHave '??' || ((FAILURES++))
|
||||
+ mustHaveCorrectAmount 11 threadcrash.c: || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSevenThreads || ((FAILURES++))
|
||||
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
|
||||
+
|
||||
+ return $FAILURES
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a core file in $LOG
|
||||
+function getLogFromCore() {
|
||||
+ # Make sure we get a core file
|
||||
+ set_test Make sure we get a core file
|
||||
+ if ! ulimit -c unlimited ; then
|
||||
+ fail
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Run the crasher
|
||||
+ ./$(basename "$RUNME")
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ # Verify that we actually crashed
|
||||
+ set_test $RUNME should have been killed by a signal, got non-signal exit code $EXITCODE
|
||||
+ if [ $EXITCODE -lt 128 ] ; then
|
||||
+ fail
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Verify that we got a core file
|
||||
+ set_test $RUNME did not create a core file
|
||||
+ if [ ! -r core* ] ; then
|
||||
+ fail
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Run gdb
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+set width 0
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" core* > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ set_test gdb exited with error code
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >&2 gdb exited with error code $EXITCODE
|
||||
+ fail
|
||||
+ fi
|
||||
+ pass
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a gcore file in $LOG
|
||||
+function getLogFromGcore() {
|
||||
+ # Create the core file
|
||||
+ rm -f core*
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+handle SIGQUIT pass noprint nostop
|
||||
+handle SIGUSR1 pass noprint nostop
|
||||
+handle SIGUSR2 pass noprint nostop
|
||||
+handle SIGALRM pass noprint nostop
|
||||
+run
|
||||
+gcore
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" > /dev/null
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ set_test gdb exited with error code when creating gcore file
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >&2 gdb exited with error code $EXITCODE when creating gcore file
|
||||
+ fail
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Verify that we got a core file from gcore
|
||||
+ set_test gdb gcore did not create a core file
|
||||
+ if [ ! -r core* ] ; then
|
||||
+ fail
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Run gdb on the gcore file
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+set width 0
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" core* > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ set_test gdb exited with error code when examining gcore file
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >&2 gdb exited with error code $EXITCODE when examining gcore file
|
||||
+ fail
|
||||
+ fi
|
||||
+ pass
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a core file in $LOG
|
||||
+function getLogFromLiveProcess() {
|
||||
+ # Run gdb
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+handle SIGQUIT pass noprint nostop
|
||||
+handle SIGUSR1 pass noprint nostop
|
||||
+handle SIGUSR2 pass noprint nostop
|
||||
+handle SIGALRM pass noprint nostop
|
||||
+set width 0
|
||||
+run
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ set_test gdb exited with error code
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >&2 gdb exited with error code $EXITCODE
|
||||
+ fail
|
||||
+ fi
|
||||
+ pass
|
||||
+}
|
||||
+
|
||||
+####### Main program follows #####################
|
||||
+
|
||||
+# Make sure we don't clobber anybody else's (core) file(s)
|
||||
+WORKDIR=/tmp/$PPID
|
||||
+mkdir -p $WORKDIR
|
||||
+cp "$RUNME" $WORKDIR
|
||||
+cd $WORKDIR
|
||||
+
|
||||
+# Count problems
|
||||
+FAILURES=0
|
||||
+
|
||||
+echo === Testing gdb vs core file...
|
||||
+pf_prefix core file
|
||||
+getLogFromCore
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+pf_prefix
|
||||
+echo === Core file tests done.
|
||||
+
|
||||
+echo
|
||||
+
|
||||
+echo === Testing gdb vs gcore file...
|
||||
+pf_prefix gcore file
|
||||
+getLogFromGcore
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+pf_prefix
|
||||
+echo === Gcore file tests done.
|
||||
+
|
||||
+echo
|
||||
+
|
||||
+echo === Testing gdb vs live process...
|
||||
+pf_prefix live process
|
||||
+getLogFromLiveProcess
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+pf_prefix
|
||||
+echo === Live process tests done.
|
||||
+
|
||||
+# Executive summary
|
||||
+echo
|
||||
+if [ $FAILURES == 0 ] ; then
|
||||
+ echo All tests passed!
|
||||
+else
|
||||
+ echo $FAILURES tests failed!
|
||||
+ echo
|
||||
+ echo Make sure the threadcrash binary contains debugging information \(build with \"gcc -g\"\).
|
||||
+fi
|
||||
+
|
||||
+# Clean up
|
||||
+cd /
|
||||
+rm -rf $WORKDIR
|
||||
+
|
||||
+exit $FAILURES
|
||||
diff --git a/gdb/testsuite/gdb.threads/threadcrash.sh-orig b/gdb/testsuite/gdb.threads/threadcrash.sh-orig
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threadcrash.sh-orig
|
||||
@@ -0,0 +1,248 @@
|
||||
+#! /bin/bash
|
||||
+
|
||||
+# NOTE: threadcrash.c *must* be built with debugging symbols
|
||||
+#
|
||||
+# The point of this shell script is to crash treadcrash.c, load the
|
||||
+# resulting core file into gdb and verify that gdb can extract enough
|
||||
+# information from the core file.
|
||||
+#
|
||||
+# The return code from this script is the number of failed tests.
|
||||
+
|
||||
+LOG=gdbresult.log
|
||||
+
|
||||
+if [ $# != 1 ] ; then
|
||||
+ echo > /dev/stderr Syntax: $0 \<name of threadcrash binary\>
|
||||
+ exit 1
|
||||
+fi
|
||||
+RUNME="$1"
|
||||
+
|
||||
+# Verify that the gdb output doesn't contain $1.
|
||||
+function mustNotHave() {
|
||||
+ local BADWORD=$1
|
||||
+ if grep -q "$BADWORD" $LOG ; then
|
||||
+ echo >> /dev/stderr WARNING: gdb output contains "$BADWORD"
|
||||
+ return 1
|
||||
+ fi
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output contains exactly $1 $2s.
|
||||
+function mustHaveCorrectAmount() {
|
||||
+ local WANTEDNUMBER=$1
|
||||
+ local GOODWORD=$2
|
||||
+ local ACTUALNUMBER=$(grep "$GOODWORD" $LOG | wc -l)
|
||||
+ if [ $ACTUALNUMBER != $WANTEDNUMBER ] ; then
|
||||
+ echo >> /dev/stderr WARNING: gdb output contained $ACTUALNUMBER \""$GOODWORD"\", not $WANTEDNUMBER as expected
|
||||
+ return 1
|
||||
+ fi
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output contains seven threads
|
||||
+function mustHaveSevenThreads() {
|
||||
+ NTHREADS=$(egrep "^Thread [1-7] \(" $LOG | wc -l)
|
||||
+ if [ $NTHREADS != 7 ] ; then
|
||||
+ echo >> /dev/stderr WARNING: gdb output contains $NTHREADS threads, not 7 as expected
|
||||
+ return 1
|
||||
+ fi
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output has all parameters on consecutive lines
|
||||
+function mustHaveSequence() {
|
||||
+ SEQUENCE="$*"
|
||||
+ NPARTS=$#
|
||||
+ grep "$1" -A$((NPARTS - 1)) $LOG > matches.log
|
||||
+
|
||||
+ while [ $# -gt 1 ] ; do
|
||||
+ shift
|
||||
+ ((NPARTS--))
|
||||
+ grep "$1" -A$((NPARTS - 1)) matches.log > temp.log
|
||||
+ mv temp.log matches.log
|
||||
+ done
|
||||
+ LASTPART=$1
|
||||
+
|
||||
+ if ! grep -q "$LASTPART" matches.log ; then
|
||||
+ echo >> /dev/stderr WARNING: gdb output does not contain the sequence: $SEQUENCE
|
||||
+ return 1
|
||||
+ fi
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that $LOG contains all information we want
|
||||
+function verifyLog() {
|
||||
+ local FAILURES=0
|
||||
+
|
||||
+ mustNotHave '??' || ((FAILURES++))
|
||||
+ mustHaveCorrectAmount 12 threadcrash.c: || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSevenThreads || ((FAILURES++))
|
||||
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
|
||||
+
|
||||
+ return $FAILURES
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a core file in $LOG
|
||||
+function getLogFromCore() {
|
||||
+ # Make sure we get a core file
|
||||
+ ulimit -c unlimited || exit 1
|
||||
+
|
||||
+ # Run the crasher
|
||||
+ ./$(basename "$RUNME")
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ # Verify that we actually crashed
|
||||
+ if [ $EXITCODE -lt 128 ] ; then
|
||||
+ echo >> /dev/stderr ERROR: $RUNME should have been killed by a signal, got non-signal exit code $EXITCODE
|
||||
+ exit 1
|
||||
+ fi
|
||||
+
|
||||
+ # Verify that we got a core file
|
||||
+ if [ ! -r core* ] ; then
|
||||
+ echo >> /dev/stderr ERROR: $RUNME did not create a core file
|
||||
+ exit 1
|
||||
+ fi
|
||||
+
|
||||
+ # Run gdb
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+set width 0
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" core* > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a gcore file in $LOG
|
||||
+function getLogFromGcore() {
|
||||
+ # Create the core file
|
||||
+ rm -f core*
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+handle SIGQUIT pass noprint nostop
|
||||
+handle SIGUSR1 pass noprint nostop
|
||||
+handle SIGUSR2 pass noprint nostop
|
||||
+handle SIGALRM pass noprint nostop
|
||||
+run
|
||||
+gcore
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" > /dev/null
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE when creating gcore file
|
||||
+ fi
|
||||
+
|
||||
+ # Verify that we got a core file from gcore
|
||||
+ if [ ! -r core* ] ; then
|
||||
+ echo >> /dev/stderr ERROR: gdb gcore did not create a core file
|
||||
+ exit 1
|
||||
+ fi
|
||||
+
|
||||
+ # Run gdb on the gcore file
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+set width 0
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" core* > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE when examining gcore file
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a core file in $LOG
|
||||
+function getLogFromLiveProcess() {
|
||||
+ # Run gdb
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+handle SIGQUIT pass noprint nostop
|
||||
+handle SIGUSR1 pass noprint nostop
|
||||
+handle SIGUSR2 pass noprint nostop
|
||||
+handle SIGALRM pass noprint nostop
|
||||
+set width 0
|
||||
+run
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+####### Main program follows #####################
|
||||
+
|
||||
+# Make sure we don't clobber anybody else's (core) file(s)
|
||||
+WORKDIR=/tmp/$PPID
|
||||
+mkdir -p $WORKDIR
|
||||
+cp "$RUNME" $WORKDIR
|
||||
+cd $WORKDIR
|
||||
+
|
||||
+# Count problems
|
||||
+FAILURES=0
|
||||
+
|
||||
+echo === Testing gdb vs core file...
|
||||
+getLogFromCore
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+echo === Core file tests done.
|
||||
+
|
||||
+echo
|
||||
+
|
||||
+echo === Testing gdb vs gcore file...
|
||||
+getLogFromGcore
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+echo === Gcore file tests done.
|
||||
+
|
||||
+echo
|
||||
+
|
||||
+echo === Testing gdb vs live process...
|
||||
+getLogFromLiveProcess
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+echo === Live process tests done.
|
||||
+
|
||||
+# Executive summary
|
||||
+echo
|
||||
+if [ $FAILURES == 0 ] ; then
|
||||
+ echo All tests passed!
|
||||
+else
|
||||
+ echo $FAILURES tests failed!
|
||||
+ echo
|
||||
+ echo Make sure the threadcrash binary contains debugging information \(build with \"gcc -g\"\).
|
||||
+fi
|
||||
+
|
||||
+# Clean up
|
||||
+cd /
|
||||
+rm -rf $WORKDIR
|
||||
+
|
||||
+exit $FAILURES
|
|
@ -0,0 +1,134 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
|
||||
|
||||
;; Find symbols properly at their original (included) file (BZ 109921).
|
||||
;;=fedoratest
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921
|
||||
|
||||
It is duplicite to its upstream variant:
|
||||
http://sourceware.org/ml/gdb-cvs/2007-01/msg00157.html
|
||||
http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
|
||||
2007-01-21 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* gdb.base/included.c, gdb.base/included.exp,
|
||||
gdb.base/included.h: New files.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
2007-01-09 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c,
|
||||
gdb.dwarf2/dw2-included.h: New files.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.c b/gdb/testsuite/gdb.dwarf2/dw2-included.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.c
|
||||
@@ -0,0 +1,26 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
+ USA. */
|
||||
+
|
||||
+#include "dw2-included.h"
|
||||
+
|
||||
+int
|
||||
+main()
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.exp b/gdb/testsuite/gdb.dwarf2/dw2-included.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.exp
|
||||
@@ -0,0 +1,47 @@
|
||||
+# Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Minimal DWARF-2 unit test
|
||||
+
|
||||
+# This test can only be run on targets which support DWARF-2.
|
||||
+# For now pick a sampling of likely targets.
|
||||
+if {![istarget *-*-linux*]
|
||||
+ && ![istarget *-*-gnu*]
|
||||
+ && ![istarget *-*-elf*]
|
||||
+ && ![istarget *-*-openbsd*]
|
||||
+ && ![istarget arm-*-eabi*]
|
||||
+ && ![istarget powerpc-*-eabi*]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "dw2-included"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+gdb_test "set listsize 1" ""
|
||||
+gdb_test "list integer" "int integer;\r"
|
||||
+gdb_test "ptype integer" "type = int\r"
|
||||
+# Path varies depending on the build location.
|
||||
+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\n${decimal}:.*int integer;\r"
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.h b/gdb/testsuite/gdb.dwarf2/dw2-included.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.h
|
||||
@@ -0,0 +1,20 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
+ USA. */
|
||||
+
|
||||
+int integer;
|
|
@ -0,0 +1,264 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
|
||||
;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
|
||||
;;=push+jan: It should be replaced by Infinity project.
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
|
||||
|
||||
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.8pre.
|
||||
|
||||
currently for trivial nonthreaded helloworld with no debug info up to -ggdb2 you
|
||||
will get:
|
||||
(gdb) p errno
|
||||
[some error]
|
||||
|
||||
* with -ggdb2 and less "errno" in fact does not exist anywhere as it was
|
||||
compiled to "(*__errno_location ())" and the macro definition is not present.
|
||||
Unfortunately gdb will find the TLS symbol and it will try to access it but
|
||||
as the program has been compiled without -lpthread the TLS base register
|
||||
(%gs on i386) is not setup and it will result in:
|
||||
Cannot access memory at address 0x8
|
||||
|
||||
Attached suggestion patch how to deal with the most common "errno" symbol
|
||||
for the most common under-ggdb3 compiled programs.
|
||||
|
||||
Original patch hooked into target_translate_tls_address. But its inferior
|
||||
call invalidates `struct frame *' in the callers - RH BZ 690908.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1166549
|
||||
|
||||
2007-11-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer
|
||||
DW_AT_MIPS_linkage_name over DW_AT_name now only for non-C.
|
||||
|
||||
glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
|
||||
<81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location
|
||||
<81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
|
||||
|
||||
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
|
||||
--- a/gdb/printcmd.c
|
||||
+++ b/gdb/printcmd.c
|
||||
@@ -1210,6 +1210,10 @@ print_command_1 (const char *args, int voidprint)
|
||||
|
||||
if (exp != nullptr && *exp)
|
||||
{
|
||||
+ /* '*((int *(*) (void)) __errno_location) ()' is incompatible with
|
||||
+ function descriptors. */
|
||||
+ if (target_has_execution && strcmp (exp, "errno") == 0)
|
||||
+ exp = "*(*(int *(*)(void)) __errno_location) ()";
|
||||
expression_up expr = parse_expression (exp);
|
||||
val = evaluate_expression (expr.get ());
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
|
||||
@@ -0,0 +1,28 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005, 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+#include <errno.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ errno = 42;
|
||||
+
|
||||
+ return 0; /* breakpoint */
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
|
||||
@@ -0,0 +1,60 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+set testfile dw2-errno
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+proc prep {} {
|
||||
+ global srcdir subdir binfile
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ gdb_load ${binfile}
|
||||
+
|
||||
+ runto_main
|
||||
+
|
||||
+ gdb_breakpoint [gdb_get_line_number "breakpoint"]
|
||||
+ gdb_continue_to_breakpoint "breakpoint"
|
||||
+}
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+prep
|
||||
+gdb_test "print errno" ".* = 42" "errno with macros=N threads=N"
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+prep
|
||||
+gdb_test "print errno" ".* = 42" "errno with macros=Y threads=N"
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+prep
|
||||
+gdb_test "print errno" ".* = 42" "errno with macros=N threads=Y"
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+prep
|
||||
+gdb_test "print errno" ".* = 42" "errno with macros=Y threads=Y"
|
||||
+
|
||||
+# TODO: Test the error on resolving ERRNO with only libc loaded.
|
||||
+# Just how to find the current libc filename?
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
|
||||
@@ -0,0 +1,28 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005, 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+#include <errno.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ errno = 42;
|
||||
+
|
||||
+ return 0; /* breakpoint */
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
|
||||
@@ -0,0 +1,71 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+set testfile dw2-errno2
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+proc prep { message {do_xfail 0} } { with_test_prefix $message {
|
||||
+ global srcdir subdir binfile variant
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ gdb_load ${binfile}${variant}
|
||||
+
|
||||
+ runto_main
|
||||
+
|
||||
+ gdb_breakpoint [gdb_get_line_number "breakpoint"]
|
||||
+ gdb_continue_to_breakpoint "breakpoint"
|
||||
+
|
||||
+ gdb_test "gcore ${binfile}${variant}.core" "\r\nSaved corefile .*" "gcore $variant"
|
||||
+
|
||||
+ gdb_test "print errno" ".* = 42"
|
||||
+
|
||||
+ gdb_test "kill" ".*" "kill" {Kill the program being debugged\? \(y or n\) } "y"
|
||||
+ gdb_test "core-file ${binfile}${variant}.core" "\r\nCore was generated by .*" "core-file"
|
||||
+ if $do_xfail {
|
||||
+ setup_xfail "*-*-*"
|
||||
+ }
|
||||
+ gdb_test "print (int) errno" ".* = 42" "print errno for core"
|
||||
+}}
|
||||
+
|
||||
+set variant g2thrN
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+prep "macros=N threads=N" 1
|
||||
+
|
||||
+set variant g3thrN
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+prep "macros=Y threads=N" 1
|
||||
+
|
||||
+set variant g2thrY
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+prep "macros=N threads=Y"
|
||||
+
|
||||
+set variant g3thrY
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+prep "macros=Y threads=Y" 1
|
||||
+
|
||||
+# TODO: Test the error on resolving ERRNO with only libc loaded.
|
||||
+# Just how to find the current libc filename?
|
|
@ -0,0 +1,102 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
|
||||
;; Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
|
||||
;;=fedoratest
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.c b/gdb/testsuite/gdb.base/step-over-trampoline.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.c
|
||||
@@ -0,0 +1,28 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+int main (void)
|
||||
+{
|
||||
+ puts ("hello world");
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb.base/step-over-trampoline.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp
|
||||
@@ -0,0 +1,54 @@
|
||||
+# Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set testfile step-over-trampoline
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+# For C programs, "start" should stop in main().
|
||||
+
|
||||
+gdb_test "start" \
|
||||
+ "main \\(\\) at .*$srcfile.*" \
|
||||
+ "start"
|
||||
+
|
||||
+# main () at hello2.c:5
|
||||
+# 5 puts("hello world\n");
|
||||
+# (gdb) next
|
||||
+# 0x100007e0 in call___do_global_ctors_aux ()
|
||||
+
|
||||
+gdb_test_multiple "next" "invalid `next' output" {
|
||||
+ -re "\nhello world.*return 0;.*" {
|
||||
+ pass "stepped over"
|
||||
+ }
|
||||
+ -re " in call___do_global_ctors_aux \\(\\).*" {
|
||||
+ fail "stepped into trampoline"
|
||||
+ }
|
||||
+}
|
|
@ -0,0 +1,27 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
|
||||
|
||||
;; Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
|
||||
;;=fedora
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
|
||||
|
||||
diff --git a/gdb/symtab.c b/gdb/symtab.c
|
||||
--- a/gdb/symtab.c
|
||||
+++ b/gdb/symtab.c
|
||||
@@ -3169,6 +3169,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
|
||||
msymbol->linkage_name ()); */
|
||||
;
|
||||
/* fall through */
|
||||
+ /* `msymbol' trampoline may be located before its .text symbol
|
||||
+ but this text symbol may be the address we were looking for.
|
||||
+ Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop.
|
||||
+ Red Hat Bug 218379. */
|
||||
+ else if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc)
|
||||
+ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", msymbol.minsym->linkage_name (), paddress (target_gdbarch (), pc));
|
||||
+ /* fall through */
|
||||
else
|
||||
{
|
||||
/* Detect an obvious case of infinite recursion. If this
|
|
@ -0,0 +1,88 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
|
||||
;; Test leftover zombie process (BZ 243845).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp
|
||||
@@ -0,0 +1,75 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+# are we on a target board
|
||||
+if [is_remote target] then {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Start the program running and then wait for a bit, to be sure
|
||||
+# that it can be attached to.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_load sleep
|
||||
+
|
||||
+set gdb_pid [exp_pid -i [board_info host fileid]]
|
||||
+set test "identified the child GDB"
|
||||
+if {$gdb_pid != "" && $gdb_pid > 0} {
|
||||
+ pass $test
|
||||
+ verbose -log "Child GDB PID $gdb_pid"
|
||||
+} else {
|
||||
+ fail $test
|
||||
+}
|
||||
+
|
||||
+set testpid [eval exec sleep 10 &]
|
||||
+exec sleep 2
|
||||
+
|
||||
+set test "attach"
|
||||
+gdb_test_multiple "attach $testpid" "$test" {
|
||||
+ -re "Attaching to program.*`?.*'?, process $testpid..*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+ -re "Attaching to program.*`?.*\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
|
||||
+ # Response expected on Cygwin
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Some time to let GDB spawn its testing child.
|
||||
+exec sleep 2
|
||||
+
|
||||
+set found none
|
||||
+foreach procpid [glob -directory /proc -type d {[0-9]*}] {
|
||||
+ if {[catch {open $procpid/status} statusfi]} {
|
||||
+ continue
|
||||
+ }
|
||||
+ set status [read $statusfi]
|
||||
+ close $statusfi
|
||||
+ if {1
|
||||
+ && [regexp -line {^Name:\tgdb$} $status]
|
||||
+ && [regexp -line {^PPid:\t1$} $status]
|
||||
+ && [regexp -line "^TracerPid:\t$gdb_pid$" $status]} {
|
||||
+ set found $procpid
|
||||
+ verbose -log "Found linux_test_for_tracefork zombie PID $procpid"
|
||||
+ }
|
||||
+}
|
||||
+set test "linux_test_for_tracefork leaves no zombie"
|
||||
+if {$found eq {none}} {
|
||||
+ pass $test
|
||||
+} else {
|
||||
+ fail $test
|
||||
+}
|
|
@ -0,0 +1,149 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-gcore-buffer-limit-test.patch
|
||||
|
||||
;; Test gcore memory and time requirements for large inferiors.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.c b/gdb/testsuite/gdb.base/gcore-excessive-memory.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.c
|
||||
@@ -0,0 +1,37 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+#define MEGS 64
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ void *mem;
|
||||
+
|
||||
+ mem = malloc (MEGS * 1024ULL * 1024ULL);
|
||||
+
|
||||
+ for (;;)
|
||||
+ sleep (1);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
|
||||
@@ -0,0 +1,94 @@
|
||||
+# Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+set testfile gcore-excessive-memory
|
||||
+set srcfile ${testfile}.c
|
||||
+set shfile [standard_output_file ${testfile}-gdb.sh]
|
||||
+set corefile [standard_output_file ${testfile}.core]
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set f [open "|getconf PAGESIZE" "r"]
|
||||
+gets $f pagesize
|
||||
+close $f
|
||||
+
|
||||
+set pid_of_bin [eval exec $binfile &]
|
||||
+sleep 2
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
|
||||
+
|
||||
+gdb_test "attach $pid_of_bin" "Attaching to .*" "attach"
|
||||
+gdb_test "up 99" "in main .*" "verify we can get to main"
|
||||
+
|
||||
+proc memory_v_pages_get {} {
|
||||
+ global pid_of_gdb pagesize
|
||||
+ set fd [open "/proc/$pid_of_gdb/statm"]
|
||||
+ gets $fd line
|
||||
+ close $fd
|
||||
+ # number of pages of virtual memory
|
||||
+ scan $line "%d" drs
|
||||
+ return $drs
|
||||
+}
|
||||
+
|
||||
+set pages_found [memory_v_pages_get]
|
||||
+
|
||||
+# It must be definitely less than `MEGS' of `gcore-excessive-memory.c'.
|
||||
+set mb_gcore_reserve 4
|
||||
+verbose -log "pages_found = $pages_found, mb_gcore_reserve = $mb_gcore_reserve"
|
||||
+set kb_found [expr $pages_found * $pagesize / 1024]
|
||||
+set kb_permit [expr $kb_found + 1 * 1024 + $mb_gcore_reserve * 1024]
|
||||
+verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
|
||||
+
|
||||
+# Create the ulimit wrapper.
|
||||
+set f [open $shfile "w"]
|
||||
+puts $f "#! /bin/sh"
|
||||
+puts $f "ulimit -v $kb_permit"
|
||||
+puts $f "exec $GDB \"\$@\""
|
||||
+close $f
|
||||
+remote_exec host "chmod +x $shfile"
|
||||
+
|
||||
+gdb_exit
|
||||
+set GDBold $GDB
|
||||
+set GDB "$shfile"
|
||||
+gdb_start
|
||||
+set GDB $GDBold
|
||||
+
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
|
||||
+
|
||||
+gdb_test "attach $pid_of_bin" "Attaching to .*" "attach"
|
||||
+gdb_test "up 99" "in main .*" "verify we can get to main"
|
||||
+
|
||||
+verbose -log "kb_found before gcore = [expr [memory_v_pages_get] * $pagesize / 1024]"
|
||||
+
|
||||
+gdb_test "gcore $corefile" "Saved corefile \[^\n\r\]*" "Save the core file"
|
||||
+
|
||||
+verbose -log "kb_found after gcore = [expr [memory_v_pages_get] * $pagesize / 1024]"
|
||||
+
|
||||
+# Cleanup.
|
||||
+exec kill -9 $pid_of_bin
|
|
@ -0,0 +1,130 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-ia64-libunwind-leak-test.patch
|
||||
|
||||
;; Test ia64 memory leaks of the code using libunwind.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/unwind-leak.c b/gdb/testsuite/gdb.base/unwind-leak.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/unwind-leak.c
|
||||
@@ -0,0 +1,29 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ for (;;)
|
||||
+ alarm (0);
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/unwind-leak.exp b/gdb/testsuite/gdb.base/unwind-leak.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/unwind-leak.exp
|
||||
@@ -0,0 +1,83 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+set testfile unwind-leak
|
||||
+set srcfile ${testfile}.c
|
||||
+set shfile [standard_output_file ${testfile}-gdb.sh]
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+set pid [exp_pid -i [board_info host fileid]]
|
||||
+
|
||||
+# For C programs, "start" should stop in main().
|
||||
+
|
||||
+gdb_test "start" \
|
||||
+ "main \\(\\) at .*$srcfile.*" \
|
||||
+ "start"
|
||||
+
|
||||
+set loc [gdb_get_line_number "alarm"]
|
||||
+gdb_breakpoint $loc
|
||||
+
|
||||
+proc memory_get {} {
|
||||
+ global pid
|
||||
+ set fd [open "/proc/$pid/statm"]
|
||||
+ gets $fd line
|
||||
+ close $fd
|
||||
+ # number of pages of data/stack
|
||||
+ scan $line "%*d%*d%*d%*d%*d%d" drs
|
||||
+ return $drs
|
||||
+}
|
||||
+
|
||||
+set cycles 100
|
||||
+# For 100 cycles it was 1308: from = 363 KB, to = 1671 KB
|
||||
+set permit_kb 100
|
||||
+verbose -log "cycles = $cycles, permit_kb = $permit_kb"
|
||||
+
|
||||
+set fail 0
|
||||
+set test "breakpoint stop/continue cycles"
|
||||
+for {set i $cycles} {$i > 0} {set i [expr {$i - 1}]} {
|
||||
+ gdb_test_multiple "continue" $test {
|
||||
+ -re "Breakpoint 2, main .*alarm .*.*${gdb_prompt} $" {
|
||||
+ }
|
||||
+ -re "Segmentation fault" {
|
||||
+ fail $test
|
||||
+ set i 0
|
||||
+ set fail 1
|
||||
+ }
|
||||
+ }
|
||||
+ if ![info exists from] {
|
||||
+ set from [memory_get]
|
||||
+ }
|
||||
+}
|
||||
+set to [memory_get]
|
||||
+if {!$fail} {
|
||||
+ verbose -log "from = $from KB, to = $to KB"
|
||||
+ if {$from > 0 && $to > 10 && $to < $from + $permit_kb} {
|
||||
+ pass $test
|
||||
+ } else {
|
||||
+ fail $test
|
||||
+ }
|
||||
+}
|
|
@ -0,0 +1,62 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-last-address-space-byte-test.patch
|
||||
|
||||
;; Testcase for deadlocking on last address space byte; for corrupted backtraces.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/largecore-last-address-lock.exp b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp
|
||||
@@ -0,0 +1,49 @@
|
||||
+# Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+
|
||||
+# i386 (32-bit) only: gdb with Red Hat largecore patch did lock up:
|
||||
+# https://enterprise.redhat.com/issue-tracker/?module=issues&action=view&tid=103263
|
||||
+# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=210614
|
||||
+
|
||||
+# i386: Bug exists when the `target_xfer_memory' condition
|
||||
+# `(memaddr + len < region->hi)' operates on 64-bit operands on
|
||||
+# largecore-patched with 32-bit addresses and so it can get `false' with
|
||||
+# arbitrary `len'.
|
||||
+
|
||||
+# x86_64: The bug is not present as the operands and calculations have the same
|
||||
+# bit size. Would would still need to pass there the highest address
|
||||
+# (`memaddr == 0xffffffffffffffff') but we would need to pass `len == 0'
|
||||
+# to make the condition `(memaddr + len < region->hi)' false.
|
||||
+# `len == 0' would get caught eariler.
|
||||
+
|
||||
+# Error in the success case is immediate.
|
||||
+set timeoutold ${timeout}
|
||||
+set timeout 10
|
||||
+
|
||||
+gdb_test "x/xb 0xffffffff" \
|
||||
+ "Cannot access memory at address 0xffffffff" \
|
||||
+ "Read the last address space byte"
|
||||
+
|
||||
+set timeout ${timeoutold}
|
|
@ -0,0 +1,95 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-missed-trap-on-step-test.patch
|
||||
|
||||
;; Test hiding unexpected breakpoints on intentional step commands.
|
||||
;;=fedoratest
|
||||
|
||||
Fix has been committed to:
|
||||
gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.c b/gdb/testsuite/gdb.base/watchpoint-during-step.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.c
|
||||
@@ -0,0 +1,30 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+static int var;
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ var = 1;
|
||||
+ var = 2;
|
||||
+ var = 3;
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.exp b/gdb/testsuite/gdb.base/watchpoint-during-step.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.exp
|
||||
@@ -0,0 +1,44 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+set testfile watchpoint-during-step
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+runto_main
|
||||
+
|
||||
+gdb_breakpoint [gdb_get_line_number "var = 2"]
|
||||
+gdb_continue_to_breakpoint "Find the first var set"
|
||||
+
|
||||
+gdb_test "step" ".*var = 3;" "Step to the next var set"
|
||||
+
|
||||
+gdb_test "watch var" "atchpoint .*: var" "Set the watchpoint"
|
||||
+
|
||||
+# Here is the target point. Be careful to not have breakpoint set on the line
|
||||
+# we step from as in this case it is a valid upstream KFAIL gdb/38
|
||||
+
|
||||
+gdb_test "step" ".*Old value = 2.*New value = 3.*" "Catch the watchpoint"
|
|
@ -0,0 +1,119 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-readline-long-line-crash-test.patch
|
||||
|
||||
;; Fix readline segfault on excessively long hand-typed lines.
|
||||
;;=fedoratest
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/readline-overflow.exp b/gdb/testsuite/gdb.base/readline-overflow.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/readline-overflow.exp
|
||||
@@ -0,0 +1,104 @@
|
||||
+# Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
+
|
||||
+# This file is part of the gdb testsuite.
|
||||
+
|
||||
+#
|
||||
+# Tests for readline buffer overflow.
|
||||
+#
|
||||
+
|
||||
+if $tracelevel {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+global env
|
||||
+
|
||||
+save_vars { env(INPUTRC) env(GDBHISTFILE) env(HISTSIZE) TERM timeout } {
|
||||
+ # The arrow key test relies on the standard VT100 bindings, so
|
||||
+ # make sure that an appropriate terminal is selected. The same
|
||||
+ # bug doesn't show up if we use ^P / ^N instead.
|
||||
+ setenv TERM vt100
|
||||
+
|
||||
+ # Don't let a .inputrc file or an existing setting of INPUTRC mess up
|
||||
+ # the test results. Even if /dev/null doesn't exist on the particular
|
||||
+ # platform, the readline library will use the default setting just by
|
||||
+ # failing to open the file. OTOH, opening /dev/null successfully will
|
||||
+ # also result in the default settings being used since nothing will be
|
||||
+ # read from this file.
|
||||
+ set env(INPUTRC) "/dev/null"
|
||||
+
|
||||
+ set timeout 600
|
||||
+
|
||||
+ set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
|
||||
+ set env(HISTSIZE) "10"
|
||||
+
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+
|
||||
+ set width 11
|
||||
+ gdb_test "set width $width" \
|
||||
+ "" \
|
||||
+ "Setting width to $width."
|
||||
+ #gdb_test "set height 1" \
|
||||
+ # "" \
|
||||
+ # "Setting height to 1."
|
||||
+ send_gdb "run X"
|
||||
+ set i 0
|
||||
+ # It crashes using `set width 7' on `set total 3560'.
|
||||
+ # Sometimes it corrupts screen on `set width 7'.
|
||||
+ # Bugreport used `set total 130001':
|
||||
+ # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
|
||||
+ # Check also `timeout' above.
|
||||
+ set total 4200
|
||||
+ gdb_expect {
|
||||
+ -re X {
|
||||
+ incr i
|
||||
+ if {$i <= $total} {
|
||||
+ send_gdb "X"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ }
|
||||
+ -re "\[ \b\r\n\]" {
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ eof {
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters, reason: EOF"
|
||||
+ gdb_clear_suppressed
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters (timeout $timeout), reason: TIMEOUT"
|
||||
+ gdb_clear_suppressed
|
||||
+ }
|
||||
+ default {
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters, reason: 0=\[$expect_out(0,string)\] buffer=\[$expect_out(buffer)\]"
|
||||
+ gdb_clear_suppressed
|
||||
+ }
|
||||
+ }
|
||||
+ send_gdb "\r"
|
||||
+ gdb_test "" \
|
||||
+ "No executable file specified..*" \
|
||||
+ "All the characters transferred"
|
||||
+}
|
|
@ -0,0 +1,122 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-section-num-fixup-test.patch
|
||||
|
||||
;; Test a crash on libraries missing the .text section.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/datalib-lib.c
|
||||
@@ -0,0 +1,22 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int var;
|
||||
diff --git a/gdb/testsuite/gdb.base/datalib-main.c b/gdb/testsuite/gdb.base/datalib-main.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/datalib-main.c
|
||||
@@ -0,0 +1,26 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/datalib.exp
|
||||
@@ -0,0 +1,51 @@
|
||||
+# Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+set testfile datalib
|
||||
+set srcfilemain ${testfile}-main.c
|
||||
+set srcfilelib ${testfile}-lib.c
|
||||
+set libfile [standard_output_file ${testfile}-lib.so]
|
||||
+set binfile [standard_output_file ${testfile}-main]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfilelib}" "${libfile}" executable [list debug {additional_flags=-shared -nostdlib}]] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfilemain}" "${binfile} ${libfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+# We must use a separate library as the main executable is compiled to the
|
||||
+# address 0 by default and it would get fixed up already at the end of
|
||||
+# INIT_OBJFILE_SECT_INDICES. We also cannot PRELINK it as PRELINK is missing
|
||||
+# on ia64. The library must be NOSTDLIB as otherwise some stub code would
|
||||
+# create the `.text' section there. Also DEBUG option is useful as some of
|
||||
+# the crashes occur in dwarf2read.c.
|
||||
+
|
||||
+# FAIL case:
|
||||
+# ../../gdb/ia64-tdep.c:2838: internal-error: sect_index_text not initialized
|
||||
+# A problem internal to GDB has been detected,
|
||||
+
|
||||
+gdb_test "start" \
|
||||
+ "main \\(\\) at .*${srcfilemain}.*" \
|
||||
+ "start"
|
|
@ -0,0 +1,180 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-sharedlibrary-path.patch
|
||||
|
||||
;; Fix TLS symbols resolving for shared libraries with a relative pathname.
|
||||
;; The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
|
||||
;;=fedoratest: One should recheck if it is really fixed upstream.
|
||||
|
||||
If you provided some relative path to the shared library, such as with
|
||||
export LD_LIBRARY_PATH=.
|
||||
then gdb would fail to match the shared library name during the TLS lookup.
|
||||
|
||||
Dropped the workaround/fix for gdb-6.8.50.20081128 - is it still needed?
|
||||
|
||||
The testsuite needs `gdb-6.3-bz146810-solib_absolute_prefix_is_empty.patch'.
|
||||
The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
|
||||
|
||||
2006-09-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute
|
||||
requested pathnames to the internal loaded relative pathnames.
|
||||
|
||||
2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.7.
|
||||
|
||||
2008-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to gdb-6.7.50.20080227.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-main.c b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
|
||||
@@ -0,0 +1,22 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+__thread int var = 42;
|
||||
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug.exp b/gdb/testsuite/gdb.threads/tls-sepdebug.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug.exp
|
||||
@@ -0,0 +1,87 @@
|
||||
+# Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set testfile tls-sepdebug
|
||||
+set srcmainfile ${testfile}-main.c
|
||||
+set srcsharedfile ${testfile}-shared.c
|
||||
+
|
||||
+set binmainfile [standard_output_file ${testfile}-main]
|
||||
+set binsharedbase ${testfile}-shared.so
|
||||
+set binsharedfile [standard_output_file ${binsharedbase}]
|
||||
+set binshareddebugfile [standard_output_file ${binsharedbase}.debug]
|
||||
+
|
||||
+# Use explicit -soname as otherwise the full path to the library would get
|
||||
+# encoded into ${binmainfile} making LD_LIBRARY_PATH tests useless.
|
||||
+
|
||||
+# FIXME: gcc dependency (-Wl,-soname).
|
||||
+
|
||||
+if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcsharedfile}" "${binsharedfile}" [list debug additional_flags=-Wl,-soname=${binsharedbase}]] != "" } {
|
||||
+ untested "Couldn't compile test library"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# eu-strip(1) works fine but it is a part of `elfutils', not `binutils'.
|
||||
+if 0 then {
|
||||
+ remote_exec build "eu-strip -f ${binshareddebugfile} ${binsharedfile}"
|
||||
+} else {
|
||||
+ remote_exec build "objcopy --only-keep-debug ${binsharedfile} ${binshareddebugfile}"
|
||||
+ remote_exec build "objcopy --strip-debug ${binsharedfile}"
|
||||
+ remote_exec build "objcopy --add-gnu-debuglink=${binshareddebugfile} ${binsharedfile}"
|
||||
+}
|
||||
+
|
||||
+# Do not use `shlib=' as it will automatically add also -rpath for gcc.
|
||||
+
|
||||
+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcmainfile} ${binsharedfile}" "${binmainfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+# Test also the proper resolving of relative library names to absolute ones.
|
||||
+# \$PWD is easy - it is the absolute way
|
||||
+# ${subdir} would fail on "print var"
|
||||
+
|
||||
+set absdir [file dirname [standard_output_file ${binsharedbase}]]
|
||||
+foreach ld_library_path [list $absdir [relative_filename [pwd] $absdir]] name { absolute relative } {
|
||||
+
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ ###gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+ gdb_test "set env LD_LIBRARY_PATH=$ld_library_path" \
|
||||
+ "" \
|
||||
+ "set env LD_LIBRARY_PATH is $name"
|
||||
+
|
||||
+ gdb_load ${binmainfile}
|
||||
+
|
||||
+ # For C programs, "start" should stop in main().
|
||||
+
|
||||
+ gdb_test "start" \
|
||||
+ "main \\(\\) at .*${srcmainfile}.*" \
|
||||
+ "start"
|
||||
+
|
||||
+ # Check for: Cannot find shared library `/usr/lib/debug/lib/libc-2.4.90.so.debug' in dynamic linker's load module list
|
||||
+ # as happens with TLS variables and `separate_debug_objfile_backlink'.
|
||||
+
|
||||
+ gdb_test "print var" \
|
||||
+ "\\\$1 = \[0-9\].*" \
|
||||
+ "print TLS variable from a shared library with $name-directory separate debug info file"
|
||||
+}
|
|
@ -0,0 +1,196 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-buildid-locate-core-as-arg.patch
|
||||
|
||||
;;=push+jan
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2010-01/msg00558.html
|
||||
|
||||
[ Fixed up since the mail. ]
|
||||
|
||||
On Thu, 21 Jan 2010 18:17:15 +0100, Doug Evans wrote:
|
||||
> Not an exhaustive list, but if we go down the path of converting "gdb
|
||||
> corefile" to "gdb -c corefile", then we also need to think about "file
|
||||
> corefile" being converted to "core corefile" [or "target core
|
||||
> corefile", "core" is apparently deprecated in favor of "target core"]
|
||||
> and "target exec corefile" -> "target core corefile". Presumably
|
||||
> "file corefile" (and "target exec corefile") would discard the
|
||||
> currently selected executable. But maybe not. Will that be confusing
|
||||
> for users? I don't know.
|
||||
|
||||
While thinking about it overriding some GDB _commands_ was not my intention.
|
||||
|
||||
There is a general assumption if I have a shell COMMAND and some FILE I can do
|
||||
$ COMMAND FILE
|
||||
and COMMAND will appropriately load the FILE.
|
||||
|
||||
FSF GDB currently needs to specify also the executable file for core files
|
||||
which already inhibits this intuitive expectation. OTOH with the build-id
|
||||
locating patch which could allow such intuitive start notneeding the
|
||||
executable file. Still it currently did not work due to the required "-c":
|
||||
$ COMMAND -c COREFILE
|
||||
|
||||
Entering "file", "core-file" or "attach" commands is already explicit enough
|
||||
so that it IMO should do what the command name says without any
|
||||
autodetections. The second command line argument
|
||||
(captured_main->pid_or_core_arg) is also autodetected (for PID or CORE) but
|
||||
neither "attach" accepts a core file nor "core-file" accepts a PID.
|
||||
|
||||
The patch makes sense only with the build-id patchset so this is not submit
|
||||
for FSF GDB inclusion yet. I am fine with your patch (+/- Hui Zhu's pending
|
||||
bfd_check_format_matches) as the patch below is its natural extension.
|
||||
|
||||
Sorry for the delay,
|
||||
Jan
|
||||
|
||||
2010-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* exceptions.h (enum errors <IS_CORE_ERROR>): New.
|
||||
* exec.c: Include exceptions.h.
|
||||
(exec_file_attach <bfd_core>): Call throw_error (IS_CORE_ERROR, ...).
|
||||
* main.c (exec_or_core_file_attach): New.
|
||||
(captured_main <optind < argc>): Set also corearg.
|
||||
(captured_main <strcmp (execarg, symarg) == 0>): New variable func.
|
||||
Call exec_or_core_file_attach if COREARG matches EXECARG. Call
|
||||
symbol_file_add_main only if CORE_BFD remained NULL.
|
||||
|
||||
Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
|
||||
2010-01-20 Doug Evans <dje@google.com>
|
||||
|
||||
* exec.c (exec_file_attach): Print a more useful error message if the
|
||||
user did "gdb core".
|
||||
|
||||
diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
--- a/gdb/exec.c
|
||||
+++ b/gdb/exec.c
|
||||
@@ -18,6 +18,8 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "defs.h"
|
||||
+#include "arch-utils.h"
|
||||
+#include "exceptions.h"
|
||||
#include "frame.h"
|
||||
#include "inferior.h"
|
||||
#include "target.h"
|
||||
@@ -495,12 +497,27 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
|
||||
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
|
||||
{
|
||||
+ int is_core;
|
||||
+
|
||||
+ /* If the user accidentally did "gdb core", print a useful
|
||||
+ error message. Check it only after bfd_object has been checked as
|
||||
+ a valid executable may get recognized for example also as
|
||||
+ "trad-core". */
|
||||
+ is_core = bfd_check_format (exec_bfd, bfd_core);
|
||||
+
|
||||
/* Make sure to close exec_bfd, or else "run" might try to use
|
||||
it. */
|
||||
exec_close ();
|
||||
- error (_("\"%ps\": not in executable format: %s"),
|
||||
- styled_string (file_name_style.style (), scratch_pathname),
|
||||
- gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
+
|
||||
+ if (is_core != 0)
|
||||
+ throw_error (IS_CORE_ERROR,
|
||||
+ _("\"%s\" is a core file.\n"
|
||||
+ "Please specify an executable to debug."),
|
||||
+ scratch_pathname);
|
||||
+ else
|
||||
+ error (_("\"%ps\": not in executable format: %s"),
|
||||
+ styled_string (file_name_style.style (), scratch_pathname),
|
||||
+ gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
}
|
||||
|
||||
if (build_section_table (exec_bfd, §ions, §ions_end))
|
||||
diff --git a/gdb/main.c b/gdb/main.c
|
||||
--- a/gdb/main.c
|
||||
+++ b/gdb/main.c
|
||||
@@ -524,6 +524,34 @@ struct cmdarg
|
||||
char *string;
|
||||
};
|
||||
|
||||
+/* Call exec_file_attach. If it detected FILENAME is a core file call
|
||||
+ core_file_command. Print the original exec_file_attach error only if
|
||||
+ core_file_command failed to find a matching executable. */
|
||||
+
|
||||
+static void
|
||||
+exec_or_core_file_attach (const char *filename, int from_tty)
|
||||
+{
|
||||
+ gdb_assert (exec_bfd == NULL);
|
||||
+
|
||||
+ try
|
||||
+ {
|
||||
+ exec_file_attach (filename, from_tty);
|
||||
+ }
|
||||
+ catch (gdb_exception_error &e)
|
||||
+ {
|
||||
+ if (e.error == IS_CORE_ERROR)
|
||||
+ {
|
||||
+ core_file_command ((char *) filename, from_tty);
|
||||
+
|
||||
+ /* Iff the core file found its executable suppress the error message
|
||||
+ from exec_file_attach. */
|
||||
+ if (exec_bfd != NULL)
|
||||
+ return;
|
||||
+ }
|
||||
+ throw_exception (std::move (e));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void
|
||||
captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
@@ -959,6 +987,8 @@ captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
symarg = argv[optind];
|
||||
execarg = argv[optind];
|
||||
+ if (optind + 1 == argc && corearg == NULL)
|
||||
+ corearg = argv[optind];
|
||||
optind++;
|
||||
}
|
||||
|
||||
@@ -1114,12 +1144,25 @@ captured_main_1 (struct captured_main_args *context)
|
||||
&& symarg != NULL
|
||||
&& strcmp (execarg, symarg) == 0)
|
||||
{
|
||||
+ catch_command_errors_const_ftype *func;
|
||||
+
|
||||
+ /* Call exec_or_core_file_attach only if the file was specified as
|
||||
+ a command line argument (and not an a command line option). */
|
||||
+ if (corearg != NULL && strcmp (corearg, execarg) == 0)
|
||||
+ {
|
||||
+ func = exec_or_core_file_attach;
|
||||
+ corearg = NULL;
|
||||
+ }
|
||||
+ else
|
||||
+ func = exec_file_attach;
|
||||
+
|
||||
/* The exec file and the symbol-file are the same. If we can't
|
||||
open it, better only print one error message.
|
||||
- catch_command_errors returns non-zero on success! */
|
||||
- ret = catch_command_errors (exec_file_attach, execarg,
|
||||
- !batch_flag);
|
||||
- if (ret != 0)
|
||||
+ catch_command_errors returns non-zero on success!
|
||||
+ Do not load EXECARG as a symbol file if it has been already processed
|
||||
+ as a core file. */
|
||||
+ ret = catch_command_errors (func, execarg, !batch_flag);
|
||||
+ if (ret != 0 && core_bfd == NULL)
|
||||
ret = catch_command_errors (symbol_file_add_main_adapter,
|
||||
symarg, !batch_flag);
|
||||
}
|
||||
diff --git a/gdbsupport/common-exceptions.h b/gdbsupport/common-exceptions.h
|
||||
--- a/gdbsupport/common-exceptions.h
|
||||
+++ b/gdbsupport/common-exceptions.h
|
||||
@@ -106,6 +106,9 @@ enum errors {
|
||||
"_ERROR" is appended to the name. */
|
||||
MAX_COMPLETIONS_REACHED_ERROR,
|
||||
|
||||
+ /* Attempt to load a core file as executable. */
|
||||
+ IS_CORE_ERROR,
|
||||
+
|
||||
/* Add more errors here. */
|
||||
NR_ERRORS
|
||||
};
|
|
@ -0,0 +1,129 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject:
|
||||
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
|
||||
|
||||
;; Fix 'gdb gives highly misleading error when debuginfo pkg is present,
|
||||
;; but not corresponding binary pkg' (RH BZ 981154).
|
||||
;;=push+jan
|
||||
|
||||
Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
|
||||
|
||||
This is the fix for RH BZ #981154
|
||||
|
||||
It is mainly a testcase addition, but a minor fix in the gdb/build-id.c
|
||||
file was also needed.
|
||||
|
||||
gdb/build-id.c was added by:
|
||||
|
||||
commit dc294be54c96414035eed7d53dafdea0a6f31a72
|
||||
Author: Tom Tromey <tromey@redhat.com>
|
||||
Date: Tue Oct 8 19:56:15 2013 +0000
|
||||
|
||||
and had a little thinko there. The variable 'filename' needs to be set to
|
||||
NULL after it is free'd, otherwise the code below thinks that it is still
|
||||
valid and doesn't print the necessary warning ("Try: yum install ...").
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
|
||||
@@ -0,0 +1,97 @@
|
||||
+# Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+standard_testfile "normal.c"
|
||||
+
|
||||
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get the build-id of the file
|
||||
+set build_id_debug_file [build_id_debug_filename_get $binfile]
|
||||
+regsub -all ".debug$" $build_id_debug_file "" build_id_without_debug
|
||||
+
|
||||
+# Run to main
|
||||
+if { ![runto_main] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# We first need to generate a corefile
|
||||
+set escapedfilename [string_to_regexp [standard_output_file gcore.test]]
|
||||
+set core_supported 0
|
||||
+gdb_test_multiple "gcore [standard_output_file gcore.test]" \
|
||||
+ "save a corefile" \
|
||||
+{
|
||||
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
|
||||
+ pass "save a corefile"
|
||||
+ global core_supported
|
||||
+ set core_supported 1
|
||||
+ }
|
||||
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
|
||||
+ unsupported "save a corefile"
|
||||
+ global core_supported
|
||||
+ set core_supported 0
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if {!$core_supported} {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Move the binfile to a temporary name
|
||||
+remote_exec build "mv $binfile ${binfile}.old"
|
||||
+
|
||||
+# Reinitialize GDB and see if we get a yum/dnf warning
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+with_test_prefix "first run:" {
|
||||
+ gdb_test "set build-id-verbose 1" "" \
|
||||
+ "set build-id-verbose"
|
||||
+
|
||||
+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
|
||||
+ "set debug-file-directory"
|
||||
+
|
||||
+ gdb_test "core-file [standard_output_file gcore.test]" \
|
||||
+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install [standard_output_file $build_id_without_debug]\r\n.*" \
|
||||
+ "test first yum/dnf warning"
|
||||
+}
|
||||
+
|
||||
+# Now we define and create our .build-id
|
||||
+file mkdir [file dirname [standard_output_file ${build_id_without_debug}]]
|
||||
+# Cannot use "file link" (from TCL) because it requires the target file to
|
||||
+# exist.
|
||||
+remote_exec build "ln -s $binfile [standard_output_file ${build_id_without_debug}]"
|
||||
+
|
||||
+# Reinitialize GDB to get the second yum/dnf warning
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+with_test_prefix "second run:" {
|
||||
+ gdb_test "set build-id-verbose 1" "" \
|
||||
+ "set build-id-verbose"
|
||||
+
|
||||
+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
|
||||
+ "set debug-file-directory"
|
||||
+
|
||||
+ gdb_test "core-file [standard_output_file gcore.test]" \
|
||||
+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \
|
||||
+ "test second yum/dnf warning"
|
||||
+}
|
||||
+
|
||||
+# Leaving the link there will cause breakage in the next run.
|
||||
+remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"
|
|
@ -0,0 +1,42 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
|
||||
;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
|
||||
;;=push+jan
|
||||
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@@ -708,6 +708,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
+/* Workarodun https://bugzilla.redhat.com/show_bug.cgi?id=643031
|
||||
+ librpm must not exit() an application on SIGINT
|
||||
+
|
||||
+ Enable or disable a signal handler. SIGNUM: signal to enable (or disable
|
||||
+ if negative). HANDLER: sa_sigaction handler (or NULL to use
|
||||
+ rpmsqHandler()). Returns: no. of refs, -1 on error. */
|
||||
+extern int rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler);
|
||||
+int
|
||||
+rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
|
||||
and avoid their duplicities during a single inferior run. */
|
||||
|
||||
diff --git a/gdb/proc-service.list b/gdb/proc-service.list
|
||||
--- a/gdb/proc-service.list
|
||||
+++ b/gdb/proc-service.list
|
||||
@@ -37,4 +37,7 @@
|
||||
ps_pstop;
|
||||
ps_ptread;
|
||||
ps_ptwrite;
|
||||
+
|
||||
+ /* gdb-6.6-buildid-locate-rpm.patch */
|
||||
+ rpmsqEnable;
|
||||
};
|
|
@ -0,0 +1,128 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-buildid-locate-rpm-scl.patch
|
||||
|
||||
;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
|
||||
;;=push+jan
|
||||
|
||||
warning: Skipping deprecated .gdb_index section
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=953585
|
||||
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@@ -742,7 +742,11 @@ static int missing_rpm_list_entries;
|
||||
/* Returns the count of newly added rpms. */
|
||||
|
||||
static int
|
||||
+#ifndef GDB_INDEX_VERIFY_VENDOR
|
||||
missing_rpm_enlist (const char *filename)
|
||||
+#else
|
||||
+missing_rpm_enlist_1 (const char *filename, int verify_vendor)
|
||||
+#endif
|
||||
{
|
||||
static int rpm_init_done = 0;
|
||||
rpmts ts;
|
||||
@@ -849,7 +853,11 @@ missing_rpm_enlist (const char *filename)
|
||||
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
|
||||
if (mi != NULL)
|
||||
{
|
||||
+#ifndef GDB_INDEX_VERIFY_VENDOR
|
||||
for (;;)
|
||||
+#else
|
||||
+ if (!verify_vendor) for (;;)
|
||||
+#endif
|
||||
{
|
||||
Header h;
|
||||
char *debuginfo, **slot, *s, *s2;
|
||||
@@ -967,6 +975,37 @@ missing_rpm_enlist (const char *filename)
|
||||
xfree (debuginfo);
|
||||
count++;
|
||||
}
|
||||
+#ifdef GDB_INDEX_VERIFY_VENDOR
|
||||
+ else /* verify_vendor */
|
||||
+ {
|
||||
+ int vendor_pass = 0, vendor_fail = 0;
|
||||
+
|
||||
+ for (;;)
|
||||
+ {
|
||||
+ Header h;
|
||||
+ errmsg_t err;
|
||||
+ char *vendor;
|
||||
+
|
||||
+ h = rpmdbNextIterator_p (mi);
|
||||
+ if (h == NULL)
|
||||
+ break;
|
||||
+
|
||||
+ vendor = headerFormat_p (h, "%{vendor}", &err);
|
||||
+ if (!vendor)
|
||||
+ {
|
||||
+ warning (_("Error querying the rpm file `%s': %s"), filename,
|
||||
+ err);
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (strcmp (vendor, "Red Hat, Inc.") == 0)
|
||||
+ vendor_pass = 1;
|
||||
+ else
|
||||
+ vendor_fail = 1;
|
||||
+ xfree (vendor);
|
||||
+ }
|
||||
+ count = vendor_pass != 0 && vendor_fail == 0;
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
rpmdbFreeIterator_p (mi);
|
||||
}
|
||||
@@ -976,6 +1015,20 @@ missing_rpm_enlist (const char *filename)
|
||||
return count;
|
||||
}
|
||||
|
||||
+#ifdef GDB_INDEX_VERIFY_VENDOR
|
||||
+missing_rpm_enlist (const char *filename)
|
||||
+{
|
||||
+ return missing_rpm_enlist_1 (filename, 0);
|
||||
+}
|
||||
+
|
||||
+extern int rpm_verify_vendor (const char *filename);
|
||||
+int
|
||||
+rpm_verify_vendor (const char *filename)
|
||||
+{
|
||||
+ return missing_rpm_enlist_1 (filename, 1);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static bool
|
||||
missing_rpm_list_compar (const char *ap, const char *bp)
|
||||
{
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -3025,6 +3025,16 @@ read_gdb_index_from_buffer (const char *filename,
|
||||
"set use-deprecated-index-sections on". */
|
||||
if (version < 6 && !deprecated_ok)
|
||||
{
|
||||
+#ifdef GDB_INDEX_VERIFY_VENDOR
|
||||
+ extern int rpm_verify_vendor (const char *filename);
|
||||
+
|
||||
+ /* Red Hat Developer Toolset exception. */
|
||||
+ if (rpm_verify_vendor (filename))
|
||||
+ {}
|
||||
+ else
|
||||
+ {
|
||||
+
|
||||
+#endif
|
||||
static int warning_printed = 0;
|
||||
if (!warning_printed)
|
||||
{
|
||||
@@ -3036,6 +3046,10 @@ to use the section anyway."),
|
||||
warning_printed = 1;
|
||||
}
|
||||
return 0;
|
||||
+#ifdef GDB_INDEX_VERIFY_VENDOR
|
||||
+
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
/* Version 7 indices generated by gold refer to the CU for a symbol instead
|
||||
of the TU (for symbols coming from TUs),
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,237 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
|
||||
;; Fix loading of core files without build-ids but with build-ids in executables.
|
||||
;; Load strictly build-id-checked core files only if no executable is specified
|
||||
;; (Jan Kratochvil, RH BZ 1339862).
|
||||
;;=push+jan
|
||||
|
||||
gdb returns an incorrect back trace when applying a debuginfo
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1339862
|
||||
|
||||
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
|
||||
--- a/gdb/solib-svr4.c
|
||||
+++ b/gdb/solib-svr4.c
|
||||
@@ -1340,14 +1340,27 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
}
|
||||
|
||||
{
|
||||
- struct bfd_build_id *build_id;
|
||||
+ struct bfd_build_id *build_id = NULL;
|
||||
|
||||
strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1);
|
||||
newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
|
||||
/* May get overwritten below. */
|
||||
strcpy (newobj->so_name, newobj->so_original_name);
|
||||
|
||||
- build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld);
|
||||
+ /* In the case the main executable was found according to its build-id
|
||||
+ (from a core file) prevent loading a different build of a library
|
||||
+ with accidentally the same SO_NAME.
|
||||
+
|
||||
+ It suppresses bogus backtraces (and prints "??" there instead) if
|
||||
+ the on-disk files no longer match the running program version.
|
||||
+
|
||||
+ If the main executable was not loaded according to its build-id do
|
||||
+ not do any build-id checking of the libraries. There may be missing
|
||||
+ build-ids dumped in the core file and we would map all the libraries
|
||||
+ to the only existing file loaded that time - the executable. */
|
||||
+ if (symfile_objfile != NULL
|
||||
+ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
|
||||
+ build_id = build_id_addr_get (li->l_ld);
|
||||
if (build_id != NULL)
|
||||
{
|
||||
char *name, *build_id_filename;
|
||||
@@ -1362,23 +1375,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
xfree (name);
|
||||
}
|
||||
else
|
||||
- {
|
||||
- debug_print_missing (newobj->so_name, build_id_filename);
|
||||
-
|
||||
- /* In the case the main executable was found according to
|
||||
- its build-id (from a core file) prevent loading
|
||||
- a different build of a library with accidentally the
|
||||
- same SO_NAME.
|
||||
-
|
||||
- It suppresses bogus backtraces (and prints "??" there
|
||||
- instead) if the on-disk files no longer match the
|
||||
- running program version. */
|
||||
-
|
||||
- if (symfile_objfile != NULL
|
||||
- && (symfile_objfile->flags
|
||||
- & OBJF_BUILD_ID_CORE_LOADED) != 0)
|
||||
- newobj->so_name[0] = 0;
|
||||
- }
|
||||
+ debug_print_missing (newobj->so_name, build_id_filename);
|
||||
|
||||
xfree (build_id_filename);
|
||||
xfree (build_id);
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
|
||||
@@ -0,0 +1,21 @@
|
||||
+/* Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+void
|
||||
+lib (void)
|
||||
+{
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+extern void lib (void);
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ lib ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
|
||||
@@ -0,0 +1,105 @@
|
||||
+# Copyright 2016 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+if {[skip_shlib_tests]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "gcore-buildid-exec-but-not-solib"
|
||||
+set srcmainfile ${testfile}-main.c
|
||||
+set srclibfile ${testfile}-lib.c
|
||||
+set libfile [standard_output_file ${testfile}-lib.so]
|
||||
+set objfile [standard_output_file ${testfile}-main.o]
|
||||
+set executable ${testfile}-main
|
||||
+set binfile [standard_output_file ${executable}]
|
||||
+set gcorefile [standard_output_file ${executable}.gcore]
|
||||
+set outdir [file dirname $binfile]
|
||||
+
|
||||
+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != ""
|
||||
+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
|
||||
+ unsupported "-Wl,--build-id compilation failed"
|
||||
+ return -1
|
||||
+}
|
||||
+set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
|
||||
+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
|
||||
+ unsupported "-Wl,--build-id compilation failed"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+clean_restart $executable
|
||||
+gdb_load_shlib $libfile
|
||||
+
|
||||
+# Does this gdb support gcore?
|
||||
+set test "help gcore"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
|
||||
+ # gcore command not supported -- nothing to test here.
|
||||
+ unsupported "gdb does not support gcore on this target"
|
||||
+ return -1;
|
||||
+ }
|
||||
+ -re "Save a core file .*\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if { ![runto lib] } then {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set escapedfilename [string_to_regexp ${gcorefile}]
|
||||
+
|
||||
+set test "save a corefile"
|
||||
+gdb_test_multiple "gcore ${gcorefile}" $test {
|
||||
+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "Can't create a corefile\r\n$gdb_prompt $" {
|
||||
+ unsupported $test
|
||||
+ return -1
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Now restart gdb and load the corefile.
|
||||
+
|
||||
+clean_restart $executable
|
||||
+gdb_load_shlib $libfile
|
||||
+
|
||||
+set buildid [build_id_debug_filename_get $libfile]
|
||||
+
|
||||
+regsub {\.debug$} $buildid {} buildid
|
||||
+
|
||||
+set debugdir [standard_output_file ${testfile}-debugdir]
|
||||
+file delete -force -- $debugdir
|
||||
+
|
||||
+file mkdir $debugdir/[file dirname $libfile]
|
||||
+file copy $libfile $debugdir/${libfile}
|
||||
+
|
||||
+file mkdir $debugdir/[file dirname $buildid]
|
||||
+file copy $libfile $debugdir/${buildid}
|
||||
+
|
||||
+remote_exec build "ln -s /lib ${debugdir}/"
|
||||
+remote_exec build "ln -s /lib64 ${debugdir}/"
|
||||
+# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2
|
||||
+
|
||||
+gdb_test "set solib-absolute-prefix $debugdir"
|
||||
+
|
||||
+gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory"
|
||||
+
|
||||
+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
|
||||
+
|
||||
+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
|
||||
+
|
||||
+gdb_test "bt"
|
||||
+gdb_test "info shared"
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,188 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
|
||||
;; Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
|
||||
;;=fedoratest
|
||||
|
||||
2007-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb_gcore.sh: Redirect GDB from `</dev/null'.
|
||||
|
||||
2007-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gcorebg.c b/gdb/testsuite/gdb.base/gcorebg.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcorebg.c
|
||||
@@ -0,0 +1,49 @@
|
||||
+#include <stdio.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <signal.h>
|
||||
+#include <string.h>
|
||||
+#include <assert.h>
|
||||
+
|
||||
+int main (int argc, char **argv)
|
||||
+{
|
||||
+ pid_t pid = 0;
|
||||
+ pid_t ppid;
|
||||
+ char buf[1024*2 + 500];
|
||||
+ int gotint;
|
||||
+
|
||||
+ if (argc != 4)
|
||||
+ {
|
||||
+ fprintf (stderr, "Syntax: %s {standard|detached} <gcore command> <core output file>\n",
|
||||
+ argv[0]);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ pid = fork ();
|
||||
+
|
||||
+ switch (pid)
|
||||
+ {
|
||||
+ case 0:
|
||||
+ if (strcmp (argv[1], "detached") == 0)
|
||||
+ setpgrp ();
|
||||
+ ppid = getppid ();
|
||||
+ gotint = snprintf (buf, sizeof (buf), "sh %s -o %s %d", argv[2], argv[3], (int) ppid);
|
||||
+ assert (gotint < sizeof (buf));
|
||||
+ system (buf);
|
||||
+ fprintf (stderr, "Killing parent PID %d\n", ppid);
|
||||
+ kill (ppid, SIGTERM);
|
||||
+ break;
|
||||
+
|
||||
+ case -1:
|
||||
+ perror ("fork err\n");
|
||||
+ exit (1);
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ fprintf (stderr,"Sleeping as PID %d\n", getpid ());
|
||||
+ sleep (60);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcorebg.exp b/gdb/testsuite/gdb.base/gcorebg.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcorebg.exp
|
||||
@@ -0,0 +1,113 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
|
||||
+# This is a test for `gdb_gcore.sh' functionality.
|
||||
+# It also tests a regression with `gdb_gcore.sh' being run without its
|
||||
+# accessible terminal.
|
||||
+
|
||||
+if ![info exists GCORE] {
|
||||
+ set GCORE "[standard_output_file ../../../../gcore]"
|
||||
+}
|
||||
+verbose "using GCORE = $GCORE" 2
|
||||
+
|
||||
+set testfile "gcorebg"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set corefile [standard_output_file ${testfile}.test]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested gcorebg.exp
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Cleanup.
|
||||
+
|
||||
+proc core_clean {} {
|
||||
+ global corefile
|
||||
+
|
||||
+ foreach file [glob -nocomplain [join [list $corefile *] ""]] {
|
||||
+ verbose "Delete file $file" 1
|
||||
+ remote_file target delete $file
|
||||
+ }
|
||||
+}
|
||||
+core_clean
|
||||
+remote_file target delete "./gdb"
|
||||
+
|
||||
+# Generate the core file.
|
||||
+
|
||||
+# Provide `./gdb' for `gdb_gcore.sh' running it as a bare `gdb' command.
|
||||
+# Setup also `$PATH' appropriately.
|
||||
+# If GDB was not found let `gdb_gcore.sh' to find the system GDB by `$PATH'.
|
||||
+if {$GDB != "gdb"} {
|
||||
+ file link ./gdb $GDB
|
||||
+}
|
||||
+global env
|
||||
+set oldpath $env(PATH)
|
||||
+set env(PATH) [join [list . $env(PATH)] ":"]
|
||||
+verbose "PATH = $env(PATH)" 2
|
||||
+
|
||||
+# Test file body.
|
||||
+# $detached == "standard" || $detached == "detached"
|
||||
+
|
||||
+proc test_body { detached } {
|
||||
+ global binfile
|
||||
+ global GCORE
|
||||
+ global corefile
|
||||
+
|
||||
+ set res [remote_spawn target "$binfile $detached $GCORE $corefile"]
|
||||
+ if { $res < 0 || $res == "" } {
|
||||
+ fail "Spawning $detached gcore"
|
||||
+ return 1
|
||||
+ }
|
||||
+ pass "Spawning $detached gcore"
|
||||
+ remote_expect target 20 {
|
||||
+ timeout {
|
||||
+ fail "Spawned $detached gcore finished (timeout)"
|
||||
+ remote_exec target "kill -9 -[exp_pid -i $res]"
|
||||
+ return 1
|
||||
+ }
|
||||
+ "Saved corefile .*\r\nKilling parent PID " {
|
||||
+ pass "Spawned $detached gcore finished"
|
||||
+ remote_wait target 20
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if {1 == [llength [glob -nocomplain [join [list $corefile *] ""]]]} {
|
||||
+ pass "Core file generated by $detached gcore"
|
||||
+ } else {
|
||||
+ fail "Core file generated by $detached gcore"
|
||||
+ }
|
||||
+ core_clean
|
||||
+}
|
||||
+
|
||||
+# First a general `gdb_gcore.sh' spawn with its controlling terminal available.
|
||||
+
|
||||
+test_body standard
|
||||
+
|
||||
+# And now `gdb_gcore.sh' spawn without its controlling terminal available.
|
||||
+# It is spawned through `gcorebg.c' using setpgrp ().
|
||||
+
|
||||
+test_body detached
|
||||
+
|
||||
+
|
||||
+# Cleanup.
|
||||
+
|
||||
+set env(PATH) $oldpath
|
||||
+remote_file target delete "./gdb"
|
|
@ -0,0 +1,94 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-bz230000-power6-disassembly-test.patch
|
||||
|
||||
;; Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
|
||||
;;=fedoratest
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000
|
||||
|
||||
The original testcase
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000#c1
|
||||
requires too recent GCC.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.exp b/gdb/testsuite/gdb.arch/powerpc-power6.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/powerpc-power6.exp
|
||||
@@ -0,0 +1,54 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Test PowerPC Power6 instructions disassembly.
|
||||
+
|
||||
+if {![istarget "powerpc*-*-*"]} then {
|
||||
+ verbose "Skipping PowerPC Power6 instructions disassembly."
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "powerpc-power6"
|
||||
+set srcfile ${testfile}.s
|
||||
+set objfile [standard_output_file ${testfile}.o]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
|
||||
+ untested "PowerPC prologue tests"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${objfile}
|
||||
+
|
||||
+# Disassemble the function.
|
||||
+
|
||||
+gdb_test "disass func" ":\tblr\r\n.*" "Basic disassembly"
|
||||
+
|
||||
+gdb_test "disass func" ":\tdcbzl *r8,r9\r\n.*" "Power5 disassembly dcbzl"
|
||||
+gdb_test "disass func" ":\tfrsqrtes *f10,f11\r\n.*" "Power5 disassembly frsqrtes"
|
||||
+gdb_test "disass func" ":\tdadd *f1,f2,f1\r\n.*" "Power6 disassembly dadd"
|
||||
+gdb_test "disass func" ":\tdaddq *f0,f2,f0\r\n.*" "Power6 disassembly daddq"
|
||||
+gdb_test "disass func" ":\tdsub *f1,f2,f1\r\n.*" "Power6 disassembly dsub"
|
||||
+gdb_test "disass func" ":\tdsubq *f0,f2,f0\r\n.*" "Power6 disassembly dsubq"
|
||||
+gdb_test "disass func" ":\tdmul *f1,f2,f1\r\n.*" "Power6 disassembly dmul"
|
||||
+gdb_test "disass func" ":\tdmulq *f0,f2,f0\r\n.*" "Power6 disassembly dmulq"
|
||||
+gdb_test "disass func" ":\tddiv *f1,f2,f1\r\n.*" "Power6 disassembly ddiv"
|
||||
+gdb_test "disass func" ":\tddivq *f0,f2,f0\r\n.*" "Power6 disassembly ddivq"
|
||||
+gdb_test "disass func" ":\tdcmpu *cr1,f2,f1\r\n.*" "Power6 disassembly dcmpu"
|
||||
+gdb_test "disass func" ":\tdcmpuq *cr1,f2,f0\r\n.*" "Power6 disassembly dcmpuq"
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.s b/gdb/testsuite/gdb.arch/powerpc-power6.s
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/powerpc-power6.s
|
||||
@@ -0,0 +1,16 @@
|
||||
+ .text
|
||||
+ .globl func
|
||||
+func:
|
||||
+ blr
|
||||
+ .long 0x7c284fec /* dcbzl r8,r9 */
|
||||
+ .long 0xed405834 /* frsqrtes f10,f11 */
|
||||
+ .long 0xec220804 /* dadd f1,f2,f1 */
|
||||
+ .long 0xfc020004 /* daddq f0,f2,f0 */
|
||||
+ .long 0xec220c04 /* dsub f1,f2,f1 */
|
||||
+ .long 0xfc020404 /* dsubq f0,f2,f0 */
|
||||
+ .long 0xec220844 /* dmul f1,f2,f1 */
|
||||
+ .long 0xfc020044 /* dmulq f0,f2,f0 */
|
||||
+ .long 0xec220c44 /* ddiv f1,f2,f1 */
|
||||
+ .long 0xfc020444 /* ddivq f0,f2,f0 */
|
||||
+ .long 0xec820d04 /* dcmpu cr1,f2,f1 */
|
||||
+ .long 0xfc820504 /* dcmpuq cr1,f2,f0 */
|
|
@ -0,0 +1,278 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
|
||||
;; Support for stepping over PPC atomic instruction sequences (BZ 237572).
|
||||
;;=fedoratest
|
||||
|
||||
2007-06-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.threads/atomic-seq-threaded.c,
|
||||
gdb.threads/atomic-seq-threaded.exp: New files.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/atomic-seq-threaded.c b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
|
||||
@@ -0,0 +1,171 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
+ MA 02110-1301, USA. */
|
||||
+
|
||||
+/* Test stepping over RISC atomic sequences.
|
||||
+ This variant testcases the code for stepping another thread while skipping
|
||||
+ over the atomic sequence in the former thread
|
||||
+ (STEPPING_PAST_SINGLESTEP_BREAKPOINT).
|
||||
+ Code comes from gcc/testsuite/gcc.dg/sync-2.c */
|
||||
+
|
||||
+/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
|
||||
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
|
||||
+
|
||||
+/* Test functionality of the intrinsics for 'short' and 'char'. */
|
||||
+
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <pthread.h>
|
||||
+#include <assert.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#define LOOPS 2
|
||||
+
|
||||
+static int unused;
|
||||
+
|
||||
+static char AI[18];
|
||||
+static char init_qi[18] = { 3,5,7,9,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0 };
|
||||
+static char test_qi[18] = { 3,5,7,9,1,4,22,-12,7,8,9,7,1,-12,7,8,9,7 };
|
||||
+
|
||||
+static void
|
||||
+do_qi (void)
|
||||
+{
|
||||
+ if (__sync_fetch_and_add(AI+4, 1) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_add(AI+5, 4) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_add(AI+6, 22) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_sub(AI+7, 12) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_and(AI+8, 7) != (char)-1)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_or(AI+9, 8) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_xor(AI+10, 9) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_nand(AI+11, 7) != 0)
|
||||
+ abort ();
|
||||
+
|
||||
+ if (__sync_add_and_fetch(AI+12, 1) != 1)
|
||||
+ abort ();
|
||||
+ if (__sync_sub_and_fetch(AI+13, 12) != (char)-12)
|
||||
+ abort ();
|
||||
+ if (__sync_and_and_fetch(AI+14, 7) != 7)
|
||||
+ abort ();
|
||||
+ if (__sync_or_and_fetch(AI+15, 8) != 8)
|
||||
+ abort ();
|
||||
+ if (__sync_xor_and_fetch(AI+16, 9) != 9)
|
||||
+ abort ();
|
||||
+ if (__sync_nand_and_fetch(AI+17, 7) != 7)
|
||||
+ abort ();
|
||||
+}
|
||||
+
|
||||
+static short AL[18];
|
||||
+static short init_hi[18] = { 3,5,7,9,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0 };
|
||||
+static short test_hi[18] = { 3,5,7,9,1,4,22,-12,7,8,9,7,1,-12,7,8,9,7 };
|
||||
+
|
||||
+static void
|
||||
+do_hi (void)
|
||||
+{
|
||||
+ if (__sync_fetch_and_add(AL+4, 1) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_add(AL+5, 4) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_add(AL+6, 22) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_sub(AL+7, 12) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_and(AL+8, 7) != -1)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_or(AL+9, 8) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_xor(AL+10, 9) != 0)
|
||||
+ abort ();
|
||||
+ if (__sync_fetch_and_nand(AL+11, 7) != 0)
|
||||
+ abort ();
|
||||
+
|
||||
+ if (__sync_add_and_fetch(AL+12, 1) != 1)
|
||||
+ abort ();
|
||||
+ if (__sync_sub_and_fetch(AL+13, 12) != -12)
|
||||
+ abort ();
|
||||
+ if (__sync_and_and_fetch(AL+14, 7) != 7)
|
||||
+ abort ();
|
||||
+ if (__sync_or_and_fetch(AL+15, 8) != 8)
|
||||
+ abort ();
|
||||
+ if (__sync_xor_and_fetch(AL+16, 9) != 9)
|
||||
+ abort ();
|
||||
+ if (__sync_nand_and_fetch(AL+17, 7) != 7)
|
||||
+ abort ();
|
||||
+}
|
||||
+
|
||||
+static void *
|
||||
+start1 (void *arg)
|
||||
+{
|
||||
+ unsigned loop;
|
||||
+ sleep(1);
|
||||
+
|
||||
+ for (loop = 0; loop < LOOPS; loop++)
|
||||
+ {
|
||||
+ memcpy(AI, init_qi, sizeof(init_qi));
|
||||
+
|
||||
+ do_qi ();
|
||||
+
|
||||
+ if (memcmp (AI, test_qi, sizeof(test_qi)))
|
||||
+ abort ();
|
||||
+ }
|
||||
+
|
||||
+ return arg; /* _delete1_ */
|
||||
+}
|
||||
+
|
||||
+static void *
|
||||
+start2 (void *arg)
|
||||
+{
|
||||
+ unsigned loop;
|
||||
+
|
||||
+ for (loop = 0; loop < LOOPS; loop++)
|
||||
+ {
|
||||
+ memcpy(AL, init_hi, sizeof(init_hi));
|
||||
+
|
||||
+ do_hi ();
|
||||
+
|
||||
+ if (memcmp (AL, test_hi, sizeof(test_hi)))
|
||||
+ abort ();
|
||||
+ }
|
||||
+
|
||||
+ return arg; /* _delete2_ */
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (int argc, char **argv)
|
||||
+{
|
||||
+ pthread_t thread;
|
||||
+ int i;
|
||||
+
|
||||
+ i = pthread_create (&thread, NULL, start1, NULL); /* _create_ */
|
||||
+ assert (i == 0); /* _create_after_ */
|
||||
+
|
||||
+ sleep (1);
|
||||
+
|
||||
+ start2 (NULL);
|
||||
+
|
||||
+ i = pthread_join (thread, NULL); /* _delete_ */
|
||||
+ assert (i == 0);
|
||||
+
|
||||
+ return 0; /* _exit_ */
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp b/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
|
||||
@@ -0,0 +1,84 @@
|
||||
+# atomic-seq-threaded.exp -- Test case for stepping over RISC atomic code seqs.
|
||||
+# This variant testcases the code for stepping another thread while skipping
|
||||
+# over the atomic sequence in the former thread
|
||||
+# (STEPPING_PAST_SINGLESTEP_BREAKPOINT).
|
||||
+# Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+set testfile atomic-seq-threaded
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+foreach opts {{} {compiler=gcc4} {FAIL}} {
|
||||
+ if {$opts eq "FAIL"} {
|
||||
+ return -1
|
||||
+ }
|
||||
+ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $opts]] eq "" } {
|
||||
+ break
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+gdb_load ${binfile}
|
||||
+if ![runto_main] then {
|
||||
+ fail "Can't run to main"
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# pthread_create () will not pass even on x86_64 with software watchpoint.
|
||||
+# Pass after pthread_create () without any watchpoint active.
|
||||
+set line [gdb_get_line_number "_create_after_"]
|
||||
+gdb_test "tbreak $line" \
|
||||
+ "reakpoint (\[0-9\]+) at .*$srcfile, line $line\..*" \
|
||||
+ "set breakpoint after pthread_create ()"
|
||||
+gdb_test "c" \
|
||||
+ ".*/\\* _create_after_ \\*/.*" \
|
||||
+ "run till after pthread_create ()"
|
||||
+
|
||||
+# Without a watchpoint being software no single-stepping would be used.
|
||||
+set test "Start (software) watchpoint"
|
||||
+gdb_test_multiple "watch unused" $test {
|
||||
+ -re "Watchpoint \[0-9\]+: unused.*$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "Hardware watchpoint \[0-9\]+: unused.*$gdb_prompt $" {
|
||||
+ # We do not test the goal but still the whole testcase should pass.
|
||||
+ unsupported $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# More thorough testing of the scheduling logic.
|
||||
+gdb_test "set scheduler-locking step" ""
|
||||
+
|
||||
+# Critical code path is stepped through at this point.
|
||||
+set line [gdb_get_line_number "_exit_"]
|
||||
+gdb_test "tbreak $line" \
|
||||
+ "reakpoint \[0-9\]+ at .*$srcfile, line $line\..*" \
|
||||
+ "set breakpoint at _exit_"
|
||||
+gdb_test "c" \
|
||||
+ ".*/\\* _exit_ \\*/.*" \
|
||||
+ "run till _exit_"
|
||||
+
|
||||
+# Just a nonproblematic program exit.
|
||||
+gdb_test "c" \
|
||||
+ ".*Program exited normally\\..*" \
|
||||
+ "run till program exit"
|
|
@ -0,0 +1,32 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-testsuite-timeouts.patch
|
||||
|
||||
;; Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
|
||||
--- a/gdb/testsuite/gdb.base/annota1.exp
|
||||
+++ b/gdb/testsuite/gdb.base/annota1.exp
|
||||
@@ -39,6 +39,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
|
||||
|
||||
clean_restart ${binfile}
|
||||
|
||||
+gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions"
|
||||
+
|
||||
# The commands we test here produce many lines of output; disable "press
|
||||
# <return> to continue" prompts.
|
||||
gdb_test_no_output "set height 0"
|
||||
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
|
||||
--- a/gdb/testsuite/gdb.base/annota3.exp
|
||||
+++ b/gdb/testsuite/gdb.base/annota3.exp
|
||||
@@ -38,6 +38,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
|
||||
|
||||
clean_restart ${binfile}
|
||||
|
||||
+gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions"
|
||||
+
|
||||
# The commands we test here produce many lines of output; disable "press
|
||||
# <return> to continue" prompts.
|
||||
gdb_test_no_output "set height 0"
|
|
@ -0,0 +1,130 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.7-charsign-test.patch
|
||||
|
||||
;; Fix displaying of numeric char arrays as strings (BZ 224128).
|
||||
;;=fedoratest: But it is failing anyway, one should check the behavior more.
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
|
||||
|
||||
2007-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.base/charsign.exp, gdb.base/charsign.c: New files.
|
||||
[ stripped ]
|
||||
|
||||
2007-10-19 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.7 - only the testcase left, patch has been reverted,
|
||||
char-vectors restricted.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/charsign.c b/gdb/testsuite/gdb.base/charsign.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/charsign.c
|
||||
@@ -0,0 +1,37 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+char n[]="A";
|
||||
+signed char s[]="A";
|
||||
+unsigned char u[]="A";
|
||||
+
|
||||
+typedef char char_n;
|
||||
+typedef signed char char_s;
|
||||
+typedef unsigned char char_u;
|
||||
+
|
||||
+char_n n_typed[]="A";
|
||||
+char_s s_typed[]="A";
|
||||
+char_u u_typed[]="A";
|
||||
diff --git a/gdb/testsuite/gdb.base/charsign.exp b/gdb/testsuite/gdb.base/charsign.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/charsign.exp
|
||||
@@ -0,0 +1,63 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+set testfile charsign
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+proc do_test { cflags } {
|
||||
+ global srcdir
|
||||
+ global binfile
|
||||
+ global subdir
|
||||
+ global srcfile
|
||||
+ global gdb_prompt
|
||||
+
|
||||
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+ }
|
||||
+
|
||||
+ # Get things started.
|
||||
+
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ gdb_load ${binfile}
|
||||
+
|
||||
+ # For C programs, "start" should stop in main().
|
||||
+
|
||||
+ gdb_test "p n" \
|
||||
+ "= \"A\""
|
||||
+ gdb_test "p s" \
|
||||
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
||||
+ gdb_test "p u" \
|
||||
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
||||
+ gdb_test "p n_typed" \
|
||||
+ "= \"A\""
|
||||
+ gdb_test "p s_typed" \
|
||||
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
||||
+ gdb_test "p u_typed" \
|
||||
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
||||
+}
|
||||
+
|
||||
+# The string identification works despite the compiler flags below due to
|
||||
+# gdbtypes.c:
|
||||
+# if (name && strcmp (name, "char") == 0)
|
||||
+# TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
|
||||
+
|
||||
+do_test {}
|
||||
+do_test {-fsigned-char}
|
||||
+do_test {-funsigned-char}
|
|
@ -0,0 +1,108 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
|
||||
;; Test PPC hiding of call-volatile parameter register.
|
||||
;;=fedoratest
|
||||
|
||||
2007-11-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.arch/ppc-clobbered-registers-O2.exp: `powerpc64' changed to
|
||||
`powerpc*'.
|
||||
|
||||
Testcase for:
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
|
||||
|
||||
2007-10-21 Luis Machado <luisgpm@br.ibm.com>
|
||||
|
||||
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): New function.
|
||||
* (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as
|
||||
default dwarf2_frame_set_init_reg function.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c
|
||||
@@ -0,0 +1,21 @@
|
||||
+
|
||||
+unsigned * __attribute__((noinline))
|
||||
+start_sequence (unsigned * x, unsigned * y)
|
||||
+{
|
||||
+ return (unsigned *)0xdeadbeef;
|
||||
+};
|
||||
+
|
||||
+unsigned __attribute__((noinline))
|
||||
+gen_movsd (unsigned * operand0, unsigned * operand1)
|
||||
+{
|
||||
+ return *start_sequence(operand0, operand1);
|
||||
+}
|
||||
+
|
||||
+int main(void)
|
||||
+{
|
||||
+ unsigned x, y;
|
||||
+
|
||||
+ x = 13;
|
||||
+ y = 14;
|
||||
+ return (int)gen_movsd (&x, &y);
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp
|
||||
@@ -0,0 +1,54 @@
|
||||
+# Copyright 2006 Free Software Foundation, Inc.
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+#
|
||||
+# This file is part of the gdb testsuite.
|
||||
+
|
||||
+# Test displaying call clobbered registers in optimized binaries for ppc.
|
||||
+# GDB should not show incorrect values.
|
||||
+
|
||||
+if ![istarget "powerpc*-*"] then {
|
||||
+ verbose "Skipping powerpc* call clobbered registers testing."
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "ppc-clobbered-registers-O2"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set compile_flags "debug additional_flags=-O2"
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${compile_flags}] != "" } {
|
||||
+ unsupported "Testcase compile failed."
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+if ![runto_main] then {
|
||||
+ perror "Couldn't run to breakpoint"
|
||||
+ continue
|
||||
+}
|
||||
+
|
||||
+gdb_test "b start_sequence" ".*Breakpoint 2 at.*line 6.*" \
|
||||
+ "Insert breakpoint at problematic function"
|
||||
+
|
||||
+gdb_test continue ".*Breakpoint 2.*in start_sequence.*" \
|
||||
+ "Run until problematic function"
|
||||
+
|
||||
+gdb_test backtrace ".*operand0=<value optimized out>.*operand1=<value optimized out>.*" \
|
||||
+ "Check value of call clobbered registers"
|
|
@ -0,0 +1,104 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.7-testsuite-stable-results.patch
|
||||
|
||||
;; Testsuite fixes for more stable/comparable results.
|
||||
;;=fedoratest
|
||||
|
||||
gdb/testsuite/gdb.base/fileio.c:
|
||||
gdb/testsuite/gdb.base/fileio.exp:
|
||||
2007-12-08 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.base/fileio.c (ROOTSUBDIR): New macro.
|
||||
(main): CHDIR into ROOTSUBDIR. CHOWN ROOTSUBDIR and CHDIR into
|
||||
ROOTSUBDIR if we are being run as root.
|
||||
* gdb.base/fileio.exp: Change the startup and finish cleanup.
|
||||
Change the test file reference to be into the `fileio.dir' directory.
|
||||
|
||||
sources/gdb/testsuite/gdb.base/dump.exp:
|
||||
Found on RHEL-5.s390x.
|
||||
|
||||
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp:
|
||||
random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore
|
||||
|
||||
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp:
|
||||
frames-invalid can happen asynchronously.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c
|
||||
--- a/gdb/testsuite/gdb.base/fileio.c
|
||||
+++ b/gdb/testsuite/gdb.base/fileio.c
|
||||
@@ -559,6 +559,28 @@ strerrno (int err)
|
||||
int
|
||||
main ()
|
||||
{
|
||||
+ /* These tests
|
||||
+ Open for write but no write permission returns EACCES
|
||||
+ Unlinking a file in a directory w/o write access returns EACCES
|
||||
+ fail if we are being run as root - drop the privileges here. */
|
||||
+
|
||||
+ if (geteuid () == 0)
|
||||
+ {
|
||||
+ uid_t uid = 99;
|
||||
+
|
||||
+ if (chown (OUTDIR, uid, uid) != 0)
|
||||
+ {
|
||||
+ printf ("chown %d.%d %s: %s\n", (int) uid, (int) uid,
|
||||
+ OUTDIR, strerror (errno));
|
||||
+ exit (1);
|
||||
+ }
|
||||
+ if (setuid (uid) || geteuid () == 0)
|
||||
+ {
|
||||
+ printf ("setuid %d: %s\n", (int) uid, strerror (errno));
|
||||
+ exit (1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Don't change the order of the calls. They partly depend on each other */
|
||||
test_open ();
|
||||
test_write ();
|
||||
diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp
|
||||
--- a/gdb/testsuite/gdb.base/fileio.exp
|
||||
+++ b/gdb/testsuite/gdb.base/fileio.exp
|
||||
@@ -24,9 +24,9 @@ if [target_info exists gdb,nofileio] {
|
||||
standard_testfile
|
||||
|
||||
if {[is_remote host]} {
|
||||
- set outdir .
|
||||
+ set outdir "fileio.dir"
|
||||
} else {
|
||||
- set outdir [standard_output_file {}]
|
||||
+ set outdir [standard_output_file "fileio.dir"]
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
|
||||
@@ -47,7 +47,8 @@ set dir2 [standard_output_file dir2.fileio.test]
|
||||
if {[file exists $dir2] && ![file writable $dir2]} {
|
||||
system "chmod +w $dir2"
|
||||
}
|
||||
-system "rm -rf [standard_output_file *.fileio.test]"
|
||||
+system "rm -rf [standard_output_file fileio.dir]"
|
||||
+system "mkdir -m777 [standard_output_file fileio.dir]"
|
||||
|
||||
set oldtimeout $timeout
|
||||
set timeout [expr "$timeout + 60"]
|
||||
@@ -89,7 +90,7 @@ gdb_test continue \
|
||||
|
||||
gdb_test "continue" ".*" ""
|
||||
|
||||
-catch "system \"chmod -f -w [standard_output_file nowrt.fileio.test]\""
|
||||
+catch "system \"chmod -f -w [standard_output_file fileio.dir/nowrt.fileio.test]\""
|
||||
|
||||
gdb_test continue \
|
||||
"Continuing\\..*open 5:.*EACCES$stop_msg" \
|
||||
@@ -276,9 +277,7 @@ gdb_test continue \
|
||||
gdb_exit
|
||||
|
||||
# Make dir2 writable again so rm -rf of a build tree Just Works.
|
||||
-if {[file exists $dir2] && ![file writable $dir2]} {
|
||||
- system "chmod +w $dir2"
|
||||
-}
|
||||
+system "chmod -R +w $outdir"
|
||||
|
||||
set timeout $oldtimeout
|
||||
return 0
|
|
@ -0,0 +1,181 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
|
||||
;; Test various forms of threads tracking across exec() (BZ 442765).
|
||||
;;=fedoratest
|
||||
|
||||
Test various forms of threads tracking across exec(2).
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c
|
||||
--- a/gdb/testsuite/gdb.threads/threaded-exec.c
|
||||
+++ b/gdb/testsuite/gdb.threads/threaded-exec.c
|
||||
@@ -18,21 +18,95 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <stddef.h>
|
||||
-#include <pthread.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
+#include <stdio.h>
|
||||
|
||||
+#ifdef THREADS
|
||||
+
|
||||
+# include <pthread.h>
|
||||
|
||||
static void *
|
||||
threader (void *arg)
|
||||
{
|
||||
- return NULL;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
+#endif
|
||||
+
|
||||
int
|
||||
-main (void)
|
||||
+main (int argc, char **argv)
|
||||
{
|
||||
+ char *exec_nothreads, *exec_threads, *cmd;
|
||||
+ int phase;
|
||||
+ char phase_s[8];
|
||||
+
|
||||
+ setbuf (stdout, NULL);
|
||||
+
|
||||
+ if (argc != 4)
|
||||
+ {
|
||||
+ fprintf (stderr, "%s <non-threaded> <threaded> <phase>\n", argv[0]);
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+#ifdef THREADS
|
||||
+ puts ("THREADS: Y");
|
||||
+#else
|
||||
+ puts ("THREADS: N");
|
||||
+#endif
|
||||
+ exec_nothreads = argv[1];
|
||||
+ printf ("exec_nothreads: %s\n", exec_nothreads);
|
||||
+ exec_threads = argv[2];
|
||||
+ printf ("exec_threads: %s\n", exec_threads);
|
||||
+ phase = atoi (argv[3]);
|
||||
+ printf ("phase: %d\n", phase);
|
||||
+
|
||||
+ /* Phases: threading
|
||||
+ 0: N -> N
|
||||
+ 1: N -> Y
|
||||
+ 2: Y -> Y
|
||||
+ 3: Y -> N
|
||||
+ 4: N -> exit */
|
||||
+
|
||||
+ cmd = NULL;
|
||||
+
|
||||
+#ifndef THREADS
|
||||
+ switch (phase)
|
||||
+ {
|
||||
+ case 0:
|
||||
+ cmd = exec_nothreads;
|
||||
+ break;
|
||||
+ case 1:
|
||||
+ cmd = exec_threads;
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ fprintf (stderr, "%s: We should have threads for phase %d!\n", argv[0],
|
||||
+ phase);
|
||||
+ return 1;
|
||||
+ case 3:
|
||||
+ fprintf (stderr, "%s: We should have threads for phase %d!\n", argv[0],
|
||||
+ phase);
|
||||
+ return 1;
|
||||
+ case 4:
|
||||
+ return 0;
|
||||
+ default:
|
||||
+ assert (0);
|
||||
+ }
|
||||
+#else /* THREADS */
|
||||
+ switch (phase)
|
||||
+ {
|
||||
+ case 0:
|
||||
+ fprintf (stderr, "%s: We should not have threads for phase %d!\n",
|
||||
+ argv[0], phase);
|
||||
+ return 1;
|
||||
+ case 1:
|
||||
+ fprintf (stderr, "%s: We should not have threads for phase %d!\n",
|
||||
+ argv[0], phase);
|
||||
+ return 1;
|
||||
+ case 2:
|
||||
+ cmd = exec_threads;
|
||||
+ {
|
||||
pthread_t t1;
|
||||
int i;
|
||||
|
||||
@@ -40,7 +114,34 @@ main (void)
|
||||
assert (i == 0);
|
||||
i = pthread_join (t1, NULL);
|
||||
assert (i == 0);
|
||||
+ }
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ cmd = exec_nothreads;
|
||||
+ {
|
||||
+ pthread_t t1;
|
||||
+ int i;
|
||||
+
|
||||
+ i = pthread_create (&t1, NULL, threader, (void *) NULL);
|
||||
+ assert (i == 0);
|
||||
+ i = pthread_join (t1, NULL);
|
||||
+ assert (i == 0);
|
||||
+ }
|
||||
+ break;
|
||||
+ case 4:
|
||||
+ fprintf (stderr, "%s: We should not have threads for phase %d!\n",
|
||||
+ argv[0], phase);
|
||||
+ return 1;
|
||||
+ default:
|
||||
+ assert (0);
|
||||
+ }
|
||||
+#endif /* THREADS */
|
||||
+
|
||||
+ assert (cmd != NULL);
|
||||
+
|
||||
+ phase++;
|
||||
+ snprintf (phase_s, sizeof phase_s, "%d", phase);
|
||||
|
||||
- execl ("/bin/true", "/bin/true", NULL);
|
||||
- abort ();
|
||||
+ execl (cmd, cmd, exec_nothreads, exec_threads, phase_s, NULL);
|
||||
+ assert (0);
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
--- a/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
@@ -20,9 +20,14 @@
|
||||
|
||||
set testfile threaded-exec
|
||||
set srcfile ${testfile}.c
|
||||
-set binfile [standard_output_file ${testfile}]
|
||||
+set binfile_nothreads [standard_output_file ${testfile}N]
|
||||
+set binfile_threads [standard_output_file ${testfile}Y]
|
||||
|
||||
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable []] != "" } {
|
||||
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile_nothreads}" executable {additional_flags=-UTHREADS}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile_threads}" executable {additional_flags=-DTHREADS}] != "" } {
|
||||
return -1
|
||||
}
|
||||
|
||||
@@ -30,9 +35,9 @@ gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
|
||||
-gdb_load ${binfile}
|
||||
+gdb_load ${binfile_nothreads}
|
||||
|
||||
-gdb_run_cmd
|
||||
+gdb_run_cmd ${binfile_nothreads} ${binfile_threads} 0
|
||||
|
||||
gdb_test_multiple {} "Program exited" {
|
||||
-re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {
|
|
@ -0,0 +1,481 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
|
||||
;; Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
|
||||
;;=fedoratest
|
||||
|
||||
Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
|
||||
@@ -0,0 +1,328 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/*
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+void
|
||||
+func (void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ abort ();
|
||||
+}
|
||||
+*/
|
||||
+ .file "dw2-loclist-prelinked.c"
|
||||
+ .section .debug_abbrev,"",@progbits
|
||||
+.Ldebug_abbrev0:
|
||||
+ .section .debug_info,"",@progbits
|
||||
+.Ldebug_info0:
|
||||
+ .section .debug_line,"",@progbits
|
||||
+.Ldebug_line0:
|
||||
+ .text
|
||||
+.Ltext0:
|
||||
+.globl func
|
||||
+ .type func, @function
|
||||
+func:
|
||||
+.LFB2:
|
||||
+ .file 1 "dw2-loclist-prelinked.c"
|
||||
+ .loc 1 5 0
|
||||
+ pushl %ebp
|
||||
+.LCFI0:
|
||||
+ movl %esp, %ebp
|
||||
+.LCFI1:
|
||||
+ subl $24, %esp
|
||||
+.LCFI2:
|
||||
+ .loc 1 8 0
|
||||
+ call abort
|
||||
+.LFE2:
|
||||
+ .size func, .-func
|
||||
+ .section .debug_frame,"",@progbits
|
||||
+.Lframe0:
|
||||
+ .long .LECIE0-.LSCIE0
|
||||
+.LSCIE0:
|
||||
+ .long 0xffffffff
|
||||
+ .byte 0x1
|
||||
+ .string ""
|
||||
+ .uleb128 0x1
|
||||
+ .sleb128 -4
|
||||
+ .byte 0x8
|
||||
+ .byte 0xc
|
||||
+ .uleb128 0x4
|
||||
+ .uleb128 0x4
|
||||
+ .byte 0x88
|
||||
+ .uleb128 0x1
|
||||
+ .align 4
|
||||
+.LECIE0:
|
||||
+.LSFDE0:
|
||||
+ .long .LEFDE0-.LASFDE0
|
||||
+.LASFDE0:
|
||||
+ .long .Lframe0
|
||||
+ .long .LFB2
|
||||
+ .long .LFE2-.LFB2
|
||||
+ .byte 0x4
|
||||
+ .long .LCFI0-.LFB2
|
||||
+ .byte 0xe
|
||||
+ .uleb128 0x8
|
||||
+ .byte 0x85
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .long .LCFI1-.LCFI0
|
||||
+ .byte 0xd
|
||||
+ .uleb128 0x5
|
||||
+ .align 4
|
||||
+.LEFDE0:
|
||||
+ .text
|
||||
+.Letext0:
|
||||
+ .section .debug_loc,"",@progbits
|
||||
+.Ldebug_loc0:
|
||||
+.LLST0:
|
||||
+ .long .LFB2-.Ltext0
|
||||
+ .long .LCFI0-.Ltext0
|
||||
+ .value 0x2
|
||||
+ .byte 0x74
|
||||
+ .sleb128 4
|
||||
+ .long .LCFI0-.Ltext0
|
||||
+ .long .LCFI1-.Ltext0
|
||||
+ .value 0x2
|
||||
+ .byte 0x74
|
||||
+ .sleb128 8
|
||||
+ .long .LCFI1-.Ltext0
|
||||
+ .long .LFE2-.Ltext0
|
||||
+ .value 0x2
|
||||
+ .byte 0x75
|
||||
+ .sleb128 8
|
||||
+ .long 0x0
|
||||
+ .long 0x0
|
||||
+ .section .debug_info
|
||||
+ .long 0x94
|
||||
+ .value 0x2
|
||||
+ .long .Ldebug_abbrev0
|
||||
+ .byte 0x4
|
||||
+ .uleb128 0x1
|
||||
+ .long .LASF10
|
||||
+ .byte 0x1
|
||||
+ .long .LASF11
|
||||
+ .long .LASF12
|
||||
+ .long .Ltext0
|
||||
+ .long .Letext0
|
||||
+ .long .Ldebug_line0
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .byte 0x7
|
||||
+ .long .LASF0
|
||||
+ .uleb128 0x3
|
||||
+ .byte 0x4
|
||||
+ .byte 0x5
|
||||
+ .string "int"
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .byte 0x5
|
||||
+ .long .LASF1
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x1
|
||||
+ .byte 0x8
|
||||
+ .long .LASF2
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x2
|
||||
+ .byte 0x7
|
||||
+ .long .LASF3
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .byte 0x7
|
||||
+ .long .LASF4
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x1
|
||||
+ .byte 0x6
|
||||
+ .long .LASF5
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x2
|
||||
+ .byte 0x5
|
||||
+ .long .LASF6
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x8
|
||||
+ .byte 0x5
|
||||
+ .long .LASF7
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x8
|
||||
+ .byte 0x7
|
||||
+ .long .LASF8
|
||||
+ .uleb128 0x4
|
||||
+ .byte 0x4
|
||||
+ .byte 0x7
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x1
|
||||
+ .byte 0x6
|
||||
+ .long .LASF9
|
||||
+ .uleb128 0x5
|
||||
+ .byte 0x1
|
||||
+ .long .LASF13
|
||||
+ .byte 0x1
|
||||
+ .byte 0x5
|
||||
+ .byte 0x1
|
||||
+ .long .LFB2
|
||||
+ .long .LFE2
|
||||
+ .long .LLST0
|
||||
+ .uleb128 0x6
|
||||
+ .string "i"
|
||||
+ .byte 0x1
|
||||
+ .byte 0x6
|
||||
+ .long 0x2c
|
||||
+ .byte 0x2
|
||||
+ .byte 0x91
|
||||
+ .sleb128 -12
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .section .debug_abbrev
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x11
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x25
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x1b
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x11
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x12
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x10
|
||||
+ .uleb128 0x6
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0x24
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3e
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0xe
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x24
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3e
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x4
|
||||
+ .uleb128 0x24
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3e
|
||||
+ .uleb128 0xb
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x5
|
||||
+ .uleb128 0x2e
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x3f
|
||||
+ .uleb128 0xc
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x3a
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3b
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x27
|
||||
+ .uleb128 0xc
|
||||
+ .uleb128 0x11
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x12
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x40
|
||||
+ .uleb128 0x6
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x6
|
||||
+ .uleb128 0x34
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x3a
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3b
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0xa
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .section .debug_pubnames,"",@progbits
|
||||
+ .long 0x17
|
||||
+ .value 0x2
|
||||
+ .long .Ldebug_info0
|
||||
+ .long 0x98
|
||||
+ .long 0x75
|
||||
+ .string "func"
|
||||
+ .long 0x0
|
||||
+ .section .debug_aranges,"",@progbits
|
||||
+ .long 0x1c
|
||||
+ .value 0x2
|
||||
+ .long .Ldebug_info0
|
||||
+ .byte 0x4
|
||||
+ .byte 0x0
|
||||
+ .value 0x0
|
||||
+ .value 0x0
|
||||
+ .long .Ltext0
|
||||
+ .long .Letext0-.Ltext0
|
||||
+ .long 0x0
|
||||
+ .long 0x0
|
||||
+ .section .debug_str,"MS",@progbits,1
|
||||
+.LASF7:
|
||||
+ .string "long long int"
|
||||
+.LASF0:
|
||||
+ .string "unsigned int"
|
||||
+.LASF11:
|
||||
+ .string "dw2-loclist-prelinked.c"
|
||||
+.LASF12:
|
||||
+ .string "gdb-6.8/gdb/testsuite/gdb.dwarf2"
|
||||
+.LASF4:
|
||||
+ .string "long unsigned int"
|
||||
+.LASF8:
|
||||
+ .string "long long unsigned int"
|
||||
+.LASF2:
|
||||
+ .string "unsigned char"
|
||||
+.LASF9:
|
||||
+ .string "char"
|
||||
+.LASF1:
|
||||
+ .string "long int"
|
||||
+.LASF3:
|
||||
+ .string "short unsigned int"
|
||||
+.LASF5:
|
||||
+ .string "signed char"
|
||||
+.LASF10:
|
||||
+ .string "GNU C 4.3.2 20081007 (Red Hat 4.3.2-6)"
|
||||
+.LASF13:
|
||||
+ .string "func"
|
||||
+.LASF6:
|
||||
+ .string "short int"
|
||||
+ .ident "GCC: (GNU) 4.3.2 20081007 (Red Hat 4.3.2-6)"
|
||||
+ .section .note.GNU-stack,"",@progbits
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
|
||||
@@ -0,0 +1,26 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* dw2-loclist-prelinked-func.S */
|
||||
+extern void func (void);
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ func ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
|
||||
@@ -0,0 +1,102 @@
|
||||
+# Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Minimal DWARF-2 unit test
|
||||
+
|
||||
+# This test can only be run on i386/x86_64 targets which support DWARF-2.
|
||||
+# For now pick a sampling of likely targets.
|
||||
+if {(![istarget *-*-linux*]
|
||||
+ && ![istarget *-*-gnu*]
|
||||
+ && ![istarget *-*-elf*]
|
||||
+ && ![istarget *-*-openbsd*])
|
||||
+ || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "dw2-loclist-prelinked"
|
||||
+set srcfuncfile ${testfile}-func.S
|
||||
+set binsharedfuncfile [standard_output_file ${testfile}.so]
|
||||
+set srcmainfile ${testfile}-main.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+remote_exec build "rm -f ${binfile}"
|
||||
+
|
||||
+# get the value of gcc_compiled
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# This test can only be run on gcc as we use additional_flags=FIXME
|
||||
+if {$gcc_compiled == 0} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfuncfile}" "${binsharedfuncfile}" {debug additional_flags=-m32}] != "" } {
|
||||
+ untested "Couldn't compile test library"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# The new separate debug info file will be stored in the .debug subdirectory.
|
||||
+
|
||||
+if [gdb_gnu_strip_debug ${binsharedfuncfile}] {
|
||||
+ # check that you have a recent version of strip and objcopy installed
|
||||
+ unsupported "cannot produce separate debug info files"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if {[catch "system \"/usr/sbin/prelink -qNR --no-exec-shield ${binsharedfuncfile}\""] != 0} {
|
||||
+ # Maybe we don't have prelink.
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" \
|
||||
+ "${binfile}" executable [list debug additional_flags=-m32 shlib=${binsharedfuncfile}]] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+gdb_run_cmd
|
||||
+
|
||||
+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
|
||||
+
|
||||
+# Incorrect:
|
||||
+# #0 0x00110430 in __kernel_vsyscall ()
|
||||
+# No symbol table info available.
|
||||
+# #1 0x003d44c0 in raise () from /lib/libc.so.6
|
||||
+# No symbol table info available.
|
||||
+# #2 0x003d5e88 in abort () from /lib/libc.so.6
|
||||
+# No symbol table info available.
|
||||
+# #3 0x44f10437 in func () at dw2-loclist-prelinked.c:8
|
||||
+# i = Could not find the frame base for "func".
|
||||
+
|
||||
+# Correct:
|
||||
+# #0 0x00110430 in __kernel_vsyscall ()
|
||||
+# No symbol table info available.
|
||||
+# #1 0x003d44c0 in raise () from /lib/libc.so.6
|
||||
+# No symbol table info available.
|
||||
+# #2 0x003d5e88 in abort () from /lib/libc.so.6
|
||||
+# No symbol table info available.
|
||||
+# #3 0x4ae36437 in func () at dw2-loclist-prelinked.c:8
|
||||
+# i = 3827288
|
||||
+# #4 0x0804851a in main () at ../../../gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c:24
|
||||
+# No locals.
|
||||
+
|
||||
+# `abort' can get expressed as `*__GI_abort'.
|
||||
+gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()"
|
|
@ -0,0 +1,78 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.8-quit-never-aborts.patch
|
||||
|
||||
;; Make the GDB quit processing non-abortable to cleanup everything properly.
|
||||
;;=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch .
|
||||
|
||||
We may abort the process of detaching threads with multiple SIGINTs - which are
|
||||
being sent during a testcase terminating its child GDB.
|
||||
|
||||
Some of the threads may not be properly PTRACE_DETACHed which hurts if they
|
||||
should have been detached with SIGSTOP (as they are accidentally left running
|
||||
on the debugger termination).
|
||||
|
||||
diff --git a/gdb/defs.h b/gdb/defs.h
|
||||
--- a/gdb/defs.h
|
||||
+++ b/gdb/defs.h
|
||||
@@ -177,6 +177,10 @@ extern void default_quit_handler (void);
|
||||
/* Flag that function quit should call quit_force. */
|
||||
extern volatile int sync_quit_force_run;
|
||||
|
||||
+#ifdef NEED_DETACH_SIGSTOP
|
||||
+extern int quit_flag_cleanup;
|
||||
+#endif
|
||||
+
|
||||
extern void quit (void);
|
||||
|
||||
/* Helper for the QUIT macro. */
|
||||
diff --git a/gdb/extension.c b/gdb/extension.c
|
||||
--- a/gdb/extension.c
|
||||
+++ b/gdb/extension.c
|
||||
@@ -769,6 +769,11 @@ check_quit_flag (void)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
+#ifdef NEED_DETACH_SIGSTOP
|
||||
+ if (quit_flag_cleanup)
|
||||
+ return 0;
|
||||
+#endif
|
||||
+
|
||||
for (const struct extension_language_defn *extlang : extension_languages)
|
||||
{
|
||||
if (extlang->ops != nullptr
|
||||
diff --git a/gdb/top.c b/gdb/top.c
|
||||
--- a/gdb/top.c
|
||||
+++ b/gdb/top.c
|
||||
@@ -1770,7 +1770,13 @@ quit_force (int *exit_arg, int from_tty)
|
||||
else if (return_child_result)
|
||||
exit_code = return_child_result_value;
|
||||
|
||||
+#ifndef NEED_DETACH_SIGSTOP
|
||||
/* We want to handle any quit errors and exit regardless. */
|
||||
+#else
|
||||
+ /* We want to handle any quit errors and exit regardless but we should never
|
||||
+ get user-interrupted to properly detach the inferior. */
|
||||
+ quit_flag_cleanup = 1;
|
||||
+#endif
|
||||
|
||||
/* Get out of tfind mode, and kill or detach all inferiors. */
|
||||
try
|
||||
diff --git a/gdb/utils.c b/gdb/utils.c
|
||||
--- a/gdb/utils.c
|
||||
+++ b/gdb/utils.c
|
||||
@@ -103,6 +103,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time;
|
||||
|
||||
static bool debug_timestamp = false;
|
||||
|
||||
+#ifdef NEED_DETACH_SIGSTOP
|
||||
+/* Nonzero means we are already processing the quitting cleanups and we should
|
||||
+ no longer get aborted. */
|
||||
+
|
||||
+int quit_flag_cleanup;
|
||||
+#endif
|
||||
+
|
||||
/* True means that strings with character values >0x7F should be printed
|
||||
as octal escapes. False means just print the value (e.g. it's an
|
||||
international character, and the terminal or window can cope.) */
|
|
@ -0,0 +1,88 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-archer-next-over-throw-cxx-exec.patch
|
||||
|
||||
;; Fix follow-exec for C++ programs (bugreported by Martin Stransky).
|
||||
;;=fedoratest
|
||||
|
||||
Archer-upstreamed:
|
||||
http://sourceware.org/ml/archer/2010-q2/msg00031.html
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.cp/cxxexec.cc b/gdb/testsuite/gdb.cp/cxxexec.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/cxxexec.cc
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* This test script is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+int
|
||||
+main()
|
||||
+{
|
||||
+ execlp ("true", "true", NULL);
|
||||
+ return 1;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/cxxexec.exp
|
||||
@@ -0,0 +1,42 @@
|
||||
+# Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+if { [skip_cplus_tests] } { continue }
|
||||
+
|
||||
+set testfile cxxexec
|
||||
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+runto_main
|
||||
+
|
||||
+# We could stop after `continue' again at `main'.
|
||||
+delete_breakpoints
|
||||
+
|
||||
+set test "p _Unwind_DebugHook"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re " = .* 0x\[0-9a-f\].*\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "\r\nNo symbol .*\r\n$gdb_prompt $" {
|
||||
+ xfail $test
|
||||
+ untested ${testfile}.exp
|
||||
+ return -1
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Run to end. The buggy GDB failed instead with:
|
||||
+# Cannot access memory at address ADDR.
|
||||
+gdb_continue_to_end "" "continue" 1
|
|
@ -0,0 +1,89 @@
|
|||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-archer-pie-addons-keep-disabled.patch
|
||||
|
||||
;;=push+jan: Breakpoints disabling matching should not be based on address.
|
||||
|
||||
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
--- a/gdb/breakpoint.c
|
||||
+++ b/gdb/breakpoint.c
|
||||
@@ -15431,6 +15431,50 @@ static struct cmd_list_element *enablebreaklist = NULL;
|
||||
|
||||
cmd_list_element *commands_cmd_element = nullptr;
|
||||
|
||||
+void
|
||||
+breakpoints_relocate (struct objfile *objfile, section_offsets &delta)
|
||||
+{
|
||||
+ struct bp_location *bl, **blp_tmp;
|
||||
+ int changed = 0;
|
||||
+
|
||||
+ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
|
||||
+
|
||||
+ ALL_BP_LOCATIONS (bl, blp_tmp)
|
||||
+ {
|
||||
+ struct obj_section *osect;
|
||||
+
|
||||
+ /* BL->SECTION can be correctly NULL for breakpoints with multiple
|
||||
+ locations expanded through symtab. */
|
||||
+
|
||||
+ ALL_OBJFILE_OSECTIONS (objfile, osect)
|
||||
+ {
|
||||
+ CORE_ADDR relocated_address;
|
||||
+ CORE_ADDR delta_offset;
|
||||
+
|
||||
+ delta_offset = delta[osect->the_bfd_section->index];
|
||||
+ if (delta_offset == 0)
|
||||
+ continue;
|
||||
+ relocated_address = bl->address + delta_offset;
|
||||
+
|
||||
+ if (obj_section_addr (osect) <= relocated_address
|
||||
+ && relocated_address < obj_section_endaddr (osect))
|
||||
+ {
|
||||
+ if (bl->inserted)
|
||||
+ remove_breakpoint (bl);
|
||||
+
|
||||
+ bl->address += delta_offset;
|
||||
+ bl->requested_address += delta_offset;
|
||||
+
|
||||
+ changed = 1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (changed)
|
||||
+ std::sort (bp_locations, bp_locations + bp_locations_count,
|
||||
+ bp_location_is_less_than);
|
||||
+}
|
||||
+
|
||||
void _initialize_breakpoint ();
|
||||
void
|
||||
_initialize_breakpoint ()
|
||||
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
|
||||
--- a/gdb/breakpoint.h
|
||||
+++ b/gdb/breakpoint.h
|
||||
@@ -1691,6 +1691,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg);
|
||||
UIOUT iff debugging multiple threads. */
|
||||
extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout);
|
||||
|
||||
+extern void breakpoints_relocate (struct objfile *objfile,
|
||||
+ section_offsets &delta);
|
||||
+
|
||||
/* Print the specified breakpoint. */
|
||||
extern void print_breakpoint (breakpoint *bp);
|
||||
|
||||
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
|
||||
--- a/gdb/objfiles.c
|
||||
+++ b/gdb/objfiles.c
|
||||
@@ -742,6 +742,11 @@ objfile_relocate1 (struct objfile *objfile,
|
||||
obj_section_addr (s));
|
||||
}
|
||||
|
||||
+ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
|
||||
+ their addresses match. */
|
||||
+ if (objfile->separate_debug_objfile_backlink == NULL)
|
||||
+ breakpoints_relocate (objfile, delta);
|
||||
+
|
||||
/* Data changed. */
|
||||
return 1;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue