Compare commits
449 Commits
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 |
|
@ -1,2 +1,4 @@
|
|||
/gdb-libstdc++-v3-python-r155978.tar.bz2
|
||||
/gdb-7.5.1.tar.bz2
|
||||
/binutils-gdb
|
||||
/gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz
|
||||
/v2.0.2.tar.gz
|
||||
/gdb-10.1.tar.xz
|
||||
|
|
|
@ -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
|
|
@ -1,5 +1,15 @@
|
|||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.base/attach-see-vdso.c 6 Jul 2007 14:14:44 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -26,8 +36,10 @@
|
|||
+ pause ();
|
||||
+ return 1;
|
||||
+}
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.base/attach-see-vdso.exp 6 Jul 2007 14:14:44 -0000
|
||||
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
|
||||
+
|
||||
|
@ -54,8 +66,8 @@
|
|||
+
|
||||
+set testfile "attach-see-vdso"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
|
||||
+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).
|
||||
+#
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
|
||||
--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S 2007-08-02 13:23:10.000000000 -0400
|
||||
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.
|
||||
+
|
||||
|
@ -80,9 +89,10 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm3
|
|||
+}
|
||||
+
|
||||
+*/
|
||||
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S
|
||||
--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S 2007-08-02 14:28:56.000000000 -0400
|
||||
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.
|
||||
+
|
||||
|
@ -182,9 +192,10 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm6
|
|||
+}
|
||||
+
|
||||
+*/
|
||||
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c
|
||||
--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c 2007-08-02 13:25:10.000000000 -0400
|
||||
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.
|
||||
+
|
||||
|
@ -215,9 +226,10 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c gd
|
|||
+ func1 ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
|
||||
--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp 2007-08-02 14:21:29.000000000 -0400
|
||||
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.
|
||||
+
|
||||
|
@ -256,8 +268,8 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
|
|||
+ fail "powerpc arch test"
|
||||
+ return
|
||||
+}
|
||||
+set objfile2 ${objdir}/${subdir}/${testfile}-asm.o
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+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
|
||||
|
@ -291,12 +303,10 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
|
|||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
|
||||
Fixup the testcase for ppc64 biarch GDB.
|
||||
|
||||
--- ./gdb/testsuite/gdb.arch/powerpc-prologue.exp 2008-01-13 13:32:19.000000000 +0100
|
||||
+++ ./gdb/testsuite/gdb.arch/powerpc-prologue.exp 2008-01-02 00:04:10.000000000 +0100
|
||||
@@ -17,8 +17,9 @@
|
||||
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
|
||||
|
|
|
@ -1,10 +1,19 @@
|
|||
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.
|
||||
|
||||
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.threads/threaded-exec.c 17 Jan 2007 23:10:22 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -52,8 +61,10 @@
|
|||
+ execl ("/bin/true", "/bin/true", NULL);
|
||||
+ abort ();
|
||||
+}
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.threads/threaded-exec.exp 17 Jan 2007 23:10:22 -0000
|
||||
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.
|
||||
|
@ -77,7 +88,7 @@
|
|||
+
|
||||
+set testfile threaded-exec
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable []] != "" } {
|
||||
+ return -1
|
||||
|
|
|
@ -1,192 +0,0 @@
|
|||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231832
|
||||
|
||||
|
||||
Index: gdb-7.4.50.20111218/gdb/symmisc.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20111218.orig/gdb/symmisc.c 2011-04-04 17:19:59.000000000 +0200
|
||||
+++ gdb-7.4.50.20111218/gdb/symmisc.c 2011-12-19 00:28:18.189232014 +0100
|
||||
@@ -147,8 +147,8 @@ print_objfile_statistics (void)
|
||||
if (OBJSTAT (objfile, sz_strtab) > 0)
|
||||
printf_filtered (_(" Space used by a.out string tables: %d\n"),
|
||||
OBJSTAT (objfile, sz_strtab));
|
||||
- printf_filtered (_(" Total memory used for objfile obstack: %d\n"),
|
||||
- obstack_memory_used (&objfile->objfile_obstack));
|
||||
+ printf_filtered (_(" Total memory used for objfile obstack: %ld\n"),
|
||||
+ (long) obstack_memory_used (&objfile->objfile_obstack));
|
||||
printf_filtered (_(" Total memory used for psymbol cache: %d\n"),
|
||||
bcache_memory_used (psymbol_bcache_get_bcache
|
||||
(objfile->psymbol_cache)));
|
||||
Index: gdb-7.4.50.20111218/include/obstack.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20111218.orig/include/obstack.h 2011-10-22 03:35:29.000000000 +0200
|
||||
+++ gdb-7.4.50.20111218/include/obstack.h 2011-12-19 00:28:18.189232014 +0100
|
||||
@@ -188,31 +188,31 @@ struct obstack /* control current objec
|
||||
|
||||
/* Declare the external functions we use; they are in obstack.c. */
|
||||
|
||||
-extern void _obstack_newchunk (struct obstack *, int);
|
||||
+extern void _obstack_newchunk (struct obstack *, PTR_INT_TYPE);
|
||||
extern void _obstack_free (struct obstack *, void *);
|
||||
-extern int _obstack_begin (struct obstack *, int, int,
|
||||
+extern int _obstack_begin (struct obstack *, PTR_INT_TYPE, int,
|
||||
void *(*) (long), void (*) (void *));
|
||||
-extern int _obstack_begin_1 (struct obstack *, int, int,
|
||||
+extern int _obstack_begin_1 (struct obstack *, PTR_INT_TYPE, int,
|
||||
void *(*) (void *, long),
|
||||
void (*) (void *, void *), void *);
|
||||
-extern int _obstack_memory_used (struct obstack *);
|
||||
+extern PTR_INT_TYPE _obstack_memory_used (struct obstack *);
|
||||
|
||||
/* Do the function-declarations after the structs
|
||||
but before defining the macros. */
|
||||
|
||||
void obstack_init (struct obstack *obstack);
|
||||
|
||||
-void * obstack_alloc (struct obstack *obstack, int size);
|
||||
+void * obstack_alloc (struct obstack *obstack, PTR_INT_TYPE size);
|
||||
|
||||
-void * obstack_copy (struct obstack *obstack, void *address, int size);
|
||||
-void * obstack_copy0 (struct obstack *obstack, void *address, int size);
|
||||
+void * obstack_copy (struct obstack *obstack, void *address, PTR_INT_TYPE size);
|
||||
+void * obstack_copy0 (struct obstack *obstack, void *address, PTR_INT_TYPE size);
|
||||
|
||||
void obstack_free (struct obstack *obstack, void *block);
|
||||
|
||||
-void obstack_blank (struct obstack *obstack, int size);
|
||||
+void obstack_blank (struct obstack *obstack, PTR_INT_TYPE size);
|
||||
|
||||
-void obstack_grow (struct obstack *obstack, void *data, int size);
|
||||
-void obstack_grow0 (struct obstack *obstack, void *data, int size);
|
||||
+void obstack_grow (struct obstack *obstack, void *data, PTR_INT_TYPE size);
|
||||
+void obstack_grow0 (struct obstack *obstack, void *data, PTR_INT_TYPE size);
|
||||
|
||||
void obstack_1grow (struct obstack *obstack, int data_char);
|
||||
void obstack_ptr_grow (struct obstack *obstack, void *data);
|
||||
@@ -220,20 +220,20 @@ void obstack_int_grow (struct obstack *o
|
||||
|
||||
void * obstack_finish (struct obstack *obstack);
|
||||
|
||||
-int obstack_object_size (struct obstack *obstack);
|
||||
+PTR_INT_TYPE obstack_object_size (struct obstack *obstack);
|
||||
|
||||
-int obstack_room (struct obstack *obstack);
|
||||
-void obstack_make_room (struct obstack *obstack, int size);
|
||||
+PTR_INT_TYPE obstack_room (struct obstack *obstack);
|
||||
+void obstack_make_room (struct obstack *obstack, PTR_INT_TYPE size);
|
||||
void obstack_1grow_fast (struct obstack *obstack, int data_char);
|
||||
void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
|
||||
void obstack_int_grow_fast (struct obstack *obstack, int data);
|
||||
-void obstack_blank_fast (struct obstack *obstack, int size);
|
||||
+void obstack_blank_fast (struct obstack *obstack, PTR_INT_TYPE size);
|
||||
|
||||
void * obstack_base (struct obstack *obstack);
|
||||
void * obstack_next_free (struct obstack *obstack);
|
||||
int obstack_alignment_mask (struct obstack *obstack);
|
||||
-int obstack_chunk_size (struct obstack *obstack);
|
||||
-int obstack_memory_used (struct obstack *obstack);
|
||||
+size_t obstack_chunk_size (struct obstack *obstack);
|
||||
+size_t obstack_memory_used (struct obstack *obstack);
|
||||
|
||||
/* Error handler called when `obstack_chunk_alloc' failed to allocate
|
||||
more memory. This can be set to a user defined function. The
|
||||
@@ -318,7 +318,7 @@ extern int obstack_exit_failure;
|
||||
# define obstack_make_room(OBSTACK,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
- int __len = (length); \
|
||||
+ PTR_INT_TYPE __len = (length); \
|
||||
if (__o->chunk_limit - __o->next_free < __len) \
|
||||
_obstack_newchunk (__o, __len); \
|
||||
(void) 0; })
|
||||
@@ -331,7 +331,7 @@ __extension__ \
|
||||
# define obstack_grow(OBSTACK,where,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
- int __len = (length); \
|
||||
+ PTR_INT_TYPE __len = (length); \
|
||||
if (__o->next_free + __len > __o->chunk_limit) \
|
||||
_obstack_newchunk (__o, __len); \
|
||||
_obstack_memcpy (__o->next_free, (where), __len); \
|
||||
@@ -341,7 +341,7 @@ __extension__ \
|
||||
# define obstack_grow0(OBSTACK,where,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
- int __len = (length); \
|
||||
+ PTR_INT_TYPE __len = (length); \
|
||||
if (__o->next_free + __len + 1 > __o->chunk_limit) \
|
||||
_obstack_newchunk (__o, __len + 1); \
|
||||
_obstack_memcpy (__o->next_free, (where), __len); \
|
||||
@@ -392,7 +392,7 @@ __extension__ \
|
||||
# define obstack_blank(OBSTACK,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
- int __len = (length); \
|
||||
+ PTR_INT_TYPE __len = (length); \
|
||||
if (__o->chunk_limit - __o->next_free < __len) \
|
||||
_obstack_newchunk (__o, __len); \
|
||||
obstack_blank_fast (__o, __len); \
|
||||
Index: gdb-7.4.50.20111218/libiberty/obstack.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20111218.orig/libiberty/obstack.c 2005-05-10 17:33:33.000000000 +0200
|
||||
+++ gdb-7.4.50.20111218/libiberty/obstack.c 2011-12-19 00:28:18.191232006 +0100
|
||||
@@ -44,9 +44,11 @@
|
||||
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
|
||||
#include <gnu-versions.h>
|
||||
#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
|
||||
+#if 0 /* 64-bit obstack is not compatible with any glibc implementation. */
|
||||
#define ELIDE_CODE
|
||||
#endif
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
|
||||
#ifndef ELIDE_CODE
|
||||
@@ -139,7 +141,7 @@ struct obstack *_obstack;
|
||||
free up some memory, then call this again. */
|
||||
|
||||
int
|
||||
-_obstack_begin (struct obstack *h, int size, int alignment,
|
||||
+_obstack_begin (struct obstack *h, PTR_INT_TYPE size, int alignment,
|
||||
POINTER (*chunkfun) (long), void (*freefun) (void *))
|
||||
{
|
||||
register struct _obstack_chunk *chunk; /* points to new chunk */
|
||||
@@ -183,7 +185,7 @@ _obstack_begin (struct obstack *h, int s
|
||||
}
|
||||
|
||||
int
|
||||
-_obstack_begin_1 (struct obstack *h, int size, int alignment,
|
||||
+_obstack_begin_1 (struct obstack *h, PTR_INT_TYPE size, int alignment,
|
||||
POINTER (*chunkfun) (POINTER, long),
|
||||
void (*freefun) (POINTER, POINTER), POINTER arg)
|
||||
{
|
||||
@@ -235,7 +237,7 @@ _obstack_begin_1 (struct obstack *h, int
|
||||
to the beginning of the new one. */
|
||||
|
||||
void
|
||||
-_obstack_newchunk (struct obstack *h, int length)
|
||||
+_obstack_newchunk (struct obstack *h, PTR_INT_TYPE length)
|
||||
{
|
||||
register struct _obstack_chunk *old_chunk = h->chunk;
|
||||
register struct _obstack_chunk *new_chunk;
|
||||
@@ -388,11 +390,11 @@ obstack_free (struct obstack *h, POINTER
|
||||
abort ();
|
||||
}
|
||||
|
||||
-int
|
||||
+PTR_INT_TYPE
|
||||
_obstack_memory_used (struct obstack *h)
|
||||
{
|
||||
register struct _obstack_chunk* lp;
|
||||
- register int nbytes = 0;
|
||||
+ register PTR_INT_TYPE nbytes = 0;
|
||||
|
||||
for (lp = h->chunk; lp != 0; lp = lp->prev)
|
||||
{
|
||||
@@ -421,6 +423,7 @@ print_and_abort (void)
|
||||
}
|
||||
|
||||
#if 0
|
||||
+/* These functions are now broken for 64-bit obstack! */
|
||||
/* These are now turned off because the applications do not use it
|
||||
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
|
||||
|
|
@ -1,6 +1,16 @@
|
|||
--- /dev/null 2008-03-23 13:41:46.072650180 +0100
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/focus-cmd-prev.exp 2008-03-23 23:46:45.000000000 +0100
|
||||
@@ -0,0 +1,25 @@
|
||||
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
|
||||
|
@ -24,5 +34,20 @@
|
|||
+gdb_exit
|
||||
+gdb_start
|
||||
+
|
||||
+gdb_test "focus cmd"
|
||||
+gdb_test "focus prev"
|
||||
+# 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,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.8.50.20090803/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090803.orig/gdb/linux-nat.c 2009-08-04 06:29:47.000000000 +0200
|
||||
+++ gdb-6.8.50.20090803/gdb/linux-nat.c 2009-08-04 06:29:55.000000000 +0200
|
||||
@@ -4495,10 +4495,15 @@ linux_xfer_partial (struct target_ops *o
|
||||
offset &= ((ULONGEST) 1 << addr_bit) - 1;
|
||||
}
|
||||
|
||||
+#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,14 +1,22 @@
|
|||
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.
|
||||
|
||||
Index: gdb-7.4.50.20120103/gdb/Makefile.in
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120103.orig/gdb/Makefile.in 2012-01-03 05:52:15.000000000 +0100
|
||||
+++ gdb-7.4.50.20120103/gdb/Makefile.in 2012-01-03 05:53:25.974210230 +0100
|
||||
@@ -1017,7 +1017,7 @@ gdb.z:gdb.1
|
||||
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
|
||||
|
||||
|
@ -17,7 +25,7 @@ Index: gdb-7.4.50.20120103/gdb/Makefile.in
|
|||
transformed_name=`t='$(program_transform_name)'; \
|
||||
echo gdb | sed -e "$$t"` ; \
|
||||
if test "x$$transformed_name" = x; then \
|
||||
@@ -1039,7 +1039,25 @@ install-only: $(CONFIG_INSTALL)
|
||||
@@ -1775,7 +1775,25 @@ install-guile:
|
||||
install-python:
|
||||
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
|
||||
|
||||
|
@ -44,8 +52,8 @@ Index: gdb-7.4.50.20120103/gdb/Makefile.in
|
|||
transformed_name=`t='$(program_transform_name)'; \
|
||||
echo gdb | sed -e $$t` ; \
|
||||
if test "x$$transformed_name" = x; then \
|
||||
@@ -1051,6 +1069,18 @@ uninstall: force $(CONFIG_UNINSTALL)
|
||||
$(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
|
||||
|
@ -63,10 +71,10 @@ Index: gdb-7.4.50.20120103/gdb/Makefile.in
|
|||
# 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
|
||||
Index: gdb-7.4.50.20120103/gdb/gstack.sh
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20120103/gdb/gstack.sh 2012-01-03 05:52:37.278385632 +0100
|
||||
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
|
||||
+
|
||||
|
@ -97,11 +105,11 @@ Index: gdb-7.4.50.20120103/gdb/gstack.sh
|
|||
+ fi
|
||||
+fi
|
||||
+
|
||||
+GDB=${GDB:-/usr/bin/gdb}
|
||||
+GDB=${GDB:-gdb}
|
||||
+
|
||||
+# Run GDB, strip out unwanted noise.
|
||||
+# --readnever is no longer used since .gdb_index is now in use.
|
||||
+$GDB --quiet -nx /proc/$1/exe $1 <<EOF 2>&1 |
|
||||
+$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 |
|
||||
+set width 0
|
||||
+set height 0
|
||||
+set pagination no
|
||||
|
@ -111,81 +119,10 @@ Index: gdb-7.4.50.20120103/gdb/gstack.sh
|
|||
+ -e 's/^\((gdb) \)*//' \
|
||||
+ -e '/^#/p' \
|
||||
+ -e '/^Thread/p'
|
||||
Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/gstack.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20120103/gdb/testsuite/gdb.base/gstack.exp 2012-01-03 05:52:37.279385629 +0100
|
||||
@@ -0,0 +1,66 @@
|
||||
+# 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 ${objdir}/${subdir}/$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
|
||||
+}
|
||||
+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
|
||||
+ }
|
||||
+}
|
||||
+gdb_exit
|
||||
+
|
||||
+# 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\\ 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 pid [exp_pid -i $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_exit
|
||||
+
|
||||
+remote_exec host "kill -9 $pid"
|
||||
Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/gstack.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20120103/gdb/testsuite/gdb.base/gstack.c 2012-01-03 05:52:37.279385629 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -230,3 +167,92 @@ Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/gstack.c
|
|||
+
|
||||
+ 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,20 +0,0 @@
|
|||
Index: gdb-7.2.50.20110107/gdb/gcore.c
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20110107.orig/gdb/gcore.c 2011-01-05 23:22:49.000000000 +0100
|
||||
+++ gdb-7.2.50.20110107/gdb/gcore.c 2011-01-07 09:04:28.000000000 +0100
|
||||
@@ -534,8 +534,14 @@ gcore_copy_callback (bfd *obfd, asection
|
||||
if (size > total_size)
|
||||
size = total_size;
|
||||
|
||||
+ /* 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) + offset,
|
||||
- memhunk, size) != 0)
|
||||
+ memhunk, size) != 0
|
||||
+ && (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name,
|
||||
+ "ia64")
|
||||
+ || bfd_section_vma (obfd, osec) != 0))
|
||||
{
|
||||
warning (_("Memory read failed for corefile "
|
||||
"section, %s bytes at %s."),
|
|
@ -1,126 +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.8.50.20090803/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090803.orig/gdb/linux-nat.c 2009-08-04 06:29:55.000000000 +0200
|
||||
+++ gdb-6.8.50.20090803/gdb/linux-nat.c 2009-08-04 06:30:53.000000000 +0200
|
||||
@@ -4495,15 +4495,38 @@ linux_xfer_partial (struct target_ops *o
|
||||
offset &= ((ULONGEST) 1 << addr_bit) - 1;
|
||||
}
|
||||
|
||||
-#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. */
|
||||
+#ifdef NATIVE_XFER_UNWIND_TABLE
|
||||
+ extern int ia64_linux_check_stack_region (struct lwp_info *lwp,
|
||||
+ void *range);
|
||||
+#endif
|
||||
+ 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.8.50.20090803/gdb/ia64-linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090803.orig/gdb/ia64-linux-nat.c 2009-02-23 01:03:49.000000000 +0100
|
||||
+++ gdb-6.8.50.20090803/gdb/ia64-linux-nat.c 2009-08-04 06:30:53.000000000 +0200
|
||||
@@ -809,6 +809,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,107 +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.
|
||||
|
||||
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.8pre. (Only the testcase has remained.)
|
||||
|
||||
--- 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,63 @@
|
||||
+# 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 ![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
|
||||
+set match_max_old [match_max]
|
||||
+match_max -d 1000000
|
||||
+gdb_start
|
||||
+match_max -d $match_max_old
|
||||
+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-7.0+ no longer prints the pseudo registers as they are computed.
|
||||
+# frame_info says: /* For moment, only display registers that were saved on the
|
||||
+# stack. */
|
||||
+gdb_test "set debug frame 1"
|
||||
+gdb_test "info frame" "Stack level 1, .*frame_unwind_register_value \\(frame=1,regnum=750\\(p63\\),\[^\r\n\]*\r\n\[^\r\n\]*-> computed bytes=.*" "info sigtramp frame"
|
|
@ -1,95 +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-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.exp 2011-07-22 19:16:13.000000000 +0200
|
||||
@@ -0,0 +1,49 @@
|
||||
+# 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 ![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-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.c 2011-07-22 19:16:13.000000000 +0200
|
||||
@@ -0,0 +1,8 @@
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ printf ("hello world\n");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
Index: gdb-7.3.50.20110722/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-7.3.50.20110722.orig/gdb/linux-nat.c 2011-07-22 19:15:05.000000000 +0200
|
||||
+++ gdb-7.3.50.20110722/gdb/linux-nat.c 2011-07-22 19:16:13.000000000 +0200
|
||||
@@ -3733,7 +3733,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))
|
||||
{
|
|
@ -1,158 +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.
|
||||
|
||||
2008-04-16 Yi Zhan <yi.zhan@intel.com>
|
||||
|
||||
* ia64-tdep.c (ia64_sigtramp_frame_prev_register): Fix an
|
||||
ISO C compliance compilation error.
|
||||
|
||||
2008-02-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to gdb-6.8.50.20081128, follow the upstream change:
|
||||
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ia64-tdep.c.diff?cvsroot=src&r1=1.176&r2=1.177
|
||||
|
||||
Index: gdb-6.8.50.20081128/gdb/ia64-tdep.c
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20081128.orig/gdb/ia64-tdep.c 2008-11-26 06:27:48.000000000 +0100
|
||||
+++ gdb-6.8.50.20081128/gdb/ia64-tdep.c 2008-12-02 19:04:32.000000000 +0100
|
||||
@@ -2107,6 +2107,94 @@ ia64_sigtramp_frame_prev_register (struc
|
||||
return frame_unwind_got_constant (this_frame, regnum, pc);
|
||||
}
|
||||
|
||||
+ /* Red Hat patch begin. */
|
||||
+ 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() */
|
||||
+ ULONGEST unatN_val;
|
||||
+ ULONGEST unat;
|
||||
+ read_memory (cache->saved_regs[IA64_UNAT_REGNUM], (char *) &unat,
|
||||
+ register_size (target_gdbarch, IA64_UNAT_REGNUM));
|
||||
+ unatN_val = (unat & (1LL << (regnum - IA64_NAT0_REGNUM))) != 0;
|
||||
+ return frame_unwind_got_constant (this_frame, regnum, unatN_val);
|
||||
+ }
|
||||
+ 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 (target_gdbarch, IA64_BSP_REGNUM));
|
||||
+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
|
||||
+ register_size (target_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;
|
||||
+ int nat_bit;
|
||||
+ nat_addr = gr_addr | 0x1f8;
|
||||
+ /* 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 (target_gdbarch, IA64_RNAT_REGNUM));
|
||||
+ }
|
||||
+ else
|
||||
+ nat_collection = read_memory_integer (nat_addr, 8, BFD_ENDIAN_LITTLE);
|
||||
+ if (nat_addr != 0)
|
||||
+ {
|
||||
+ nat_bit = (gr_addr >> 3) & 0x3f;
|
||||
+ natN_val = (nat_collection >> nat_bit) & 1;
|
||||
+ return frame_unwind_got_constant (this_frame, regnum, natN_val);
|
||||
+ }
|
||||
+ }
|
||||
+ warning (_("ia64_sigtramp_frame_prev_register: unhandled register %d"),
|
||||
+ regnum);
|
||||
+ }
|
||||
+ 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 (target_gdbarch, IA64_BSP_REGNUM));
|
||||
+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
|
||||
+ register_size (target_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));
|
||||
+
|
||||
+ return frame_unwind_got_constant (this_frame, regnum, bof);
|
||||
+ }
|
||||
+ /* Red Hat patch end. */
|
||||
+
|
||||
else if ((regnum >= IA64_GR32_REGNUM && regnum <= IA64_GR127_REGNUM)
|
||||
|| (regnum >= V32_REGNUM && regnum <= V127_REGNUM))
|
||||
{
|
||||
@@ -2121,7 +2209,42 @@ ia64_sigtramp_frame_prev_register (struc
|
||||
return frame_unwind_got_constant (this_frame, regnum, 0);
|
||||
}
|
||||
|
||||
- else /* All other registers not listed above. */
|
||||
+ /* Red Hat patch begin. */
|
||||
+ 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 (target_gdbarch, IA64_PR_REGNUM));
|
||||
+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
|
||||
+ register_size (target_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;
|
||||
+ return frame_unwind_got_constant (this_frame, regnum, prN_val);
|
||||
+ }
|
||||
+ warning (_("ia64_sigtramp_frame_prev_register: unhandled register %d"),
|
||||
+ regnum);
|
||||
+ }
|
||||
+ /* Red Hat patch end. */
|
||||
+
|
||||
+ /* All other registers not listed above. */
|
||||
{
|
||||
CORE_ADDR addr = cache->saved_regs[regnum];
|
||||
|
|
@ -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-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
|
||||
|
@ -9,10 +17,10 @@
|
|||
|
||||
* gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set.
|
||||
|
||||
Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.c 2011-03-20 20:15:57.000000000 +0100
|
||||
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
|
||||
|
@ -34,10 +42,10 @@ Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.c
|
|||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp 2011-03-20 20:20:03.000000000 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -77,9 +85,9 @@ Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp
|
|||
+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}"
|
||||
|
@ -254,7 +262,7 @@ Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp
|
|||
+}
|
||||
+
|
||||
+set GDBFLAGS_orig $GDBFLAGS
|
||||
+set GDBFLAGS "--pid=$testpid"
|
||||
+set GDBFLAGS "-iex \"set height 0\" --pid=$testpid"
|
||||
+gdb_start
|
||||
+set GDBFLAGS $GDBFLAGS_orig
|
||||
+
|
||||
|
@ -276,7 +284,7 @@ Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp
|
|||
+}
|
||||
+
|
||||
+set GDBFLAGS_orig $GDBFLAGS
|
||||
+set GDBFLAGS "--pid=$testpid"
|
||||
+set GDBFLAGS "-iex \"set height 0\" --pid=$testpid"
|
||||
+gdb_start
|
||||
+set GDBFLAGS $GDBFLAGS_orig
|
||||
+
|
||||
|
@ -284,10 +292,10 @@ Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp
|
|||
+do_call_attach_tests
|
||||
+
|
||||
+return 0
|
||||
Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32b.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32b.c 2011-03-20 20:15:57.000000000 +0100
|
||||
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,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,26 +13,10 @@
|
|||
* gdb.cp/b146835b.cc: Ditto.
|
||||
* gdb.cp/b146835.h: Ditto.
|
||||
|
||||
Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835b.cc
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835b.cc 2009-08-12 06:07:50.000000000 +0200
|
||||
@@ -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) {}
|
||||
Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc 2009-08-12 06:07:50.000000000 +0200
|
||||
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>
|
||||
|
@ -58,10 +50,10 @@ Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc
|
|||
+ f.foo();
|
||||
+}
|
||||
+
|
||||
Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp 2009-08-12 06:58:28.000000000 +0200
|
||||
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.
|
||||
+
|
||||
|
@ -87,7 +79,7 @@ Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp
|
|||
+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 +102,10 @@ Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp
|
|||
+
|
||||
+# Verify that we can access the inherited member d
|
||||
+gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
|
||||
Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h 2009-08-12 06:07:50.000000000 +0200
|
||||
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 @@ Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h
|
|||
+ 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,8 +1,149 @@
|
|||
Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp 2009-06-29 16:24:36.000000000 +0200
|
||||
@@ -0,0 +1,96 @@
|
||||
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
|
||||
|
@ -46,21 +187,26 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp
|
|||
+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 ${objdir}/${subdir}/gcore-shmid0.test]
|
||||
+set escapedfilename [string_to_regexp [standard_output_file gcore-shmid0.test]]
|
||||
+
|
||||
+set test "save a corefile"
|
||||
+gdb_test_multiple "gcore ${objdir}/${subdir}/gcore-shmid0.test" $test {
|
||||
+gdb_test_multiple "gcore [standard_output_file gcore-shmid0.test]" $test {
|
||||
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
|
@ -75,7 +221,7 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp
|
|||
+gdb_continue_to_end "finish"
|
||||
+
|
||||
+set test "core-file command"
|
||||
+gdb_test_multiple "core-file $objdir/$subdir/gcore-shmid0.test" $test {
|
||||
+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"
|
||||
|
@ -99,131 +245,3 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp
|
|||
+ fail $test
|
||||
+ }
|
||||
+}
|
||||
Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.c 2009-06-29 16:22:49.000000000 +0200
|
||||
@@ -0,0 +1,123 @@
|
||||
+/* 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>
|
||||
+
|
||||
+/* 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 void
|
||||
+initialized (void)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+unresolved (void)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+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;
|
||||
+}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
2004-11-24 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* printcmd.c (build_address_symbolic): Find a section for the
|
||||
address.
|
||||
|
||||
Index: gdb-6.8.50.20081128/gdb/printcmd.c
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20081128.orig/gdb/printcmd.c 2008-12-04 01:36:05.000000000 +0100
|
||||
+++ gdb-6.8.50.20081128/gdb/printcmd.c 2008-12-04 01:37:18.000000000 +0100
|
||||
@@ -616,6 +616,14 @@ build_address_symbolic (CORE_ADDR addr,
|
||||
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)
|
||||
+ section = find_pc_section (addr);
|
||||
|
||||
/* First try to find the address in the symbol table, then
|
||||
in the minsyms. Take the closest one. */
|
|
@ -1,111 +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-7.2.50.20110117/gdb/rs6000-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20110117.orig/gdb/rs6000-tdep.c 2011-01-11 20:23:02.000000000 +0100
|
||||
+++ gdb-7.2.50.20110117/gdb/rs6000-tdep.c 2011-01-17 15:48:19.000000000 +0100
|
||||
@@ -126,6 +126,7 @@ static const char *powerpc_vector_abi_st
|
||||
|
||||
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 */
|
||||
@@ -1496,7 +1497,6 @@ static CORE_ADDR
|
||||
skip_prologue (struct gdbarch *gdbarch, 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];
|
||||
@@ -1514,12 +1514,14 @@ skip_prologue (struct gdbarch *gdbarch,
|
||||
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 (gdbarch);
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
|
||||
memset (fdata, 0, sizeof (struct rs6000_framedata));
|
||||
+ fdata->func_start = pc;
|
||||
fdata->saved_gpr = -1;
|
||||
fdata->saved_fpr = -1;
|
||||
fdata->saved_vr = -1;
|
||||
@@ -1553,6 +1555,55 @@ skip_prologue (struct gdbarch *gdbarch,
|
||||
break;
|
||||
op = extract_unsigned_integer (buf, 4, byte_order);
|
||||
|
||||
+ /* 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
|
||||
@@ -1734,9 +1785,9 @@ skip_prologue (struct gdbarch *gdbarch,
|
||||
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)
|
|
@ -1,98 +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.
|
||||
|
||||
Index: gdb-7.4.50.20120703/gdb/doc/gdb.texinfo
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/doc/gdb.texinfo 2012-07-03 17:30:07.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/doc/gdb.texinfo 2012-07-03 17:31:40.695642449 +0200
|
||||
@@ -1023,6 +1023,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
|
||||
|
||||
@node Mode Options
|
||||
Index: gdb-7.4.50.20120703/gdb/main.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/main.c 2012-07-03 17:30:07.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/main.c 2012-07-03 17:31:40.696642448 +0200
|
||||
@@ -414,6 +414,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},
|
||||
@@ -1131,6 +1132,7 @@ Options:\n\n\
|
||||
fputs_unfiltered (_("\
|
||||
--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\
|
||||
Index: gdb-7.4.50.20120703/gdb/symfile.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/symfile.c 2012-07-03 17:30:07.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/symfile.c 2012-07-03 17:31:40.697642447 +0200
|
||||
@@ -81,6 +81,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. */
|
||||
|
||||
Index: gdb-7.4.50.20120703/gdb/dwarf2read.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/dwarf2read.c 2012-07-03 17:30:07.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/dwarf2read.c 2012-07-03 17:31:53.421627153 +0200
|
||||
@@ -65,6 +65,7 @@
|
||||
#include "gdb/gdb-index.h"
|
||||
#include <ctype.h>
|
||||
#include "gdb_bfd.h"
|
||||
+#include "top.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "gdb_string.h"
|
||||
@@ -1587,8 +1588,9 @@ dwarf2_has_info (struct objfile *objfile
|
||||
(void *) names);
|
||||
dwarf2_per_objfile->objfile = objfile;
|
||||
}
|
||||
- return (dwarf2_per_objfile->info.asection != NULL
|
||||
- && dwarf2_per_objfile->abbrev.asection != NULL);
|
||||
+ return (! readnever_symbol_files
|
||||
+ && (dwarf2_per_objfile->info.asection != NULL
|
||||
+ && dwarf2_per_objfile->abbrev.asection != NULL));
|
||||
}
|
||||
|
||||
/* When loading sections, we look either for uncompressed section or for
|
||||
Index: gdb-7.4.50.20120703/gdb/top.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/top.h 2012-01-23 18:12:30.000000000 +0100
|
||||
+++ gdb-7.4.50.20120703/gdb/top.h 2012-07-03 17:31:40.700642444 +0200
|
||||
@@ -60,6 +60,7 @@ extern void set_prompt (const char *s);
|
||||
|
||||
/* From random places. */
|
||||
extern int readnow_symbol_files;
|
||||
+extern int readnever_symbol_files;
|
||||
|
||||
/* Perform _initialize initialization. */
|
||||
extern void gdb_init (char *);
|
|
@ -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,103 +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.
|
||||
|
||||
2004-08-03 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.arch/ia64-libunwind.exp: Fix test string to match
|
||||
current code base.
|
||||
|
||||
[ acquire_unwind_info -> ia64_find_proc_info_x ]
|
||||
|
||||
2009-04-30 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Remove a race from send_gdb "COMMAND\n".
|
||||
Cleanup.
|
||||
Merge in: Patch4: gdb-6.3-rh-testlibunwind1fix-20041202.patch
|
||||
|
||||
--- /dev/null 2009-04-19 08:52:54.499000000 +0200
|
||||
+++ gdb-6.8/gdb/testsuite/gdb.arch/ia64-libunwind.c 2009-04-30 19:15:16.000000000 +0200
|
||||
@@ -0,0 +1,26 @@
|
||||
+/* Copyright 2003, 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 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>
|
||||
+
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+ printf ("hello world\n");
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
--- /dev/null 2009-04-19 08:52:54.499000000 +0200
|
||||
+++ gdb-6.8/gdb/testsuite/gdb.arch/ia64-libunwind.exp 2009-04-30 19:19:22.000000000 +0200
|
||||
@@ -0,0 +1,52 @@
|
||||
+# Copyright 2003, 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.
|
||||
+
|
||||
+# 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 ![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}
|
||||
+
|
||||
+gdb_test "set debug arch 1"
|
||||
+gdb_breakpoint "main"
|
||||
+gdb_run_cmd
|
||||
+
|
||||
+set test "libunwind message"
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "ia64_find_proc_info_x.*$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
|
@ -1,13 +1,20 @@
|
|||
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.
|
||||
|
||||
Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
===================================================================
|
||||
--- gdb-7.1.90.20100711.orig/gdb/testsuite/gdb.gdb/selftest.exp 2010-06-26 08:44:47.000000000 +0200
|
||||
+++ gdb-7.1.90.20100711/gdb/testsuite/gdb.gdb/selftest.exp 2010-07-12 09:59:42.000000000 +0200
|
||||
@@ -342,6 +342,9 @@ 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"
|
||||
}
|
||||
|
@ -16,4 +23,16 @@ Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.gdb/selftest.exp
|
|||
+ }
|
||||
}
|
||||
|
||||
do_steps_and_nexts
|
||||
# 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,7 +1,15 @@
|
|||
Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.cp/constructortest.cc
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20111219/gdb/testsuite/gdb.cp/constructortest.cc 2011-12-19 22:05:02.825431735 +0100
|
||||
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
|
||||
|
||||
;; Test support of multiple destructors just like multiple constructors
|
||||
;;=fedoratest
|
||||
|
||||
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.
|
||||
+
|
||||
|
@ -102,10 +110,10 @@ Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.cp/constructortest.cc
|
|||
+{
|
||||
+ y = 2; /* First line D */
|
||||
+}
|
||||
Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.cp/constructortest.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20111219/gdb/testsuite/gdb.cp/constructortest.exp 2011-12-19 23:07:24.148290893 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -129,7 +137,7 @@ Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.cp/constructortest.exp
|
|||
+
|
||||
+set testfile "constructortest"
|
||||
+set srcfile ${testfile}.cc
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+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"}] != "" } {
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
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.
|
||||
|
||||
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c 2008-12-07 23:57:41.000000000 +0100
|
||||
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>
|
||||
|
@ -19,10 +27,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c
|
|||
+ other();
|
||||
+}
|
||||
+
|
||||
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp 2008-12-07 10:13:01.000000000 +0100
|
||||
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.
|
||||
|
@ -44,17 +52,17 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp
|
|||
+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."
|
||||
+}
|
||||
+
|
||||
|
@ -81,10 +89,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp
|
|||
+
|
||||
+set timeout $oldtimeout
|
||||
+return 0
|
||||
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h 2008-12-07 10:13:01.000000000 +0100
|
||||
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,96 +14,29 @@
|
|||
* gdb.gdb/xfullpath.exp: Ditto.
|
||||
* gdb.gdb/observer.exp: Ditto.
|
||||
|
||||
Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/complaints.exp
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.gdb/complaints.exp 2009-01-03 06:58:04.000000000 +0100
|
||||
+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/complaints.exp 2009-02-26 22:10:48.000000000 +0100
|
||||
@@ -302,13 +302,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
|
||||
}
|
||||
@@ -319,4 +319,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";
|
||||
Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/observer.exp
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.gdb/observer.exp 2009-02-17 20:52:27.000000000 +0100
|
||||
+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/observer.exp 2009-02-26 22:11:40.000000000 +0100
|
||||
@@ -258,13 +258,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 $file];
|
||||
+#set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
+set result [test_observer $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"
|
||||
Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.gdb/selftest.exp 2009-02-26 22:09:59.000000000 +0100
|
||||
+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/selftest.exp 2009-02-26 22:10:48.000000000 +0100
|
||||
@@ -551,13 +551,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"
|
||||
Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/xfullpath.exp
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.gdb/xfullpath.exp 2009-01-03 06:58:04.000000000 +0100
|
||||
+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/xfullpath.exp 2009-02-26 22:10:48.000000000 +0100
|
||||
@@ -179,13 +179,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,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
|
||||
|
@ -42,10 +50,10 @@
|
|||
|
||||
FIXME: The testcase does not expects multiple watchpoints hits per one stop.
|
||||
|
||||
Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/watchthreads-threaded.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/watchthreads-threaded.c 2011-12-19 22:05:02.867431570 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -113,10 +121,10 @@ Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/watchthreads-threaded.c
|
|||
+ pthread_exit(NULL);
|
||||
+}
|
||||
+
|
||||
Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/watchthreads-threaded.exp 2011-12-19 22:28:33.294911982 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -146,7 +154,7 @@ Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
|
|||
+
|
||||
+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
|
||||
+}
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
Index: ./gdb/testsuite/gdb.threads/threadcrash.c
|
||||
===================================================================
|
||||
RCS file: gdb/testsuite/gdb.threads/threadcrash.c
|
||||
diff -N gdb/testsuite/gdb.threads/threadcrash.c
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.threads/threadcrash.c 31 Oct 2006 17:54:38 -0000
|
||||
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.
|
||||
|
@ -306,12 +312,10 @@ diff -N gdb/testsuite/gdb.threads/threadcrash.c
|
|||
+
|
||||
+ return 0;
|
||||
+}
|
||||
Index: ./gdb/testsuite/gdb.threads/threadcrash.exp
|
||||
===================================================================
|
||||
RCS file: gdb/testsuite/gdb.threads/threadcrash.exp
|
||||
diff -N gdb/testsuite/gdb.threads/threadcrash.exp
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.threads/threadcrash.exp 31 Oct 2006 17:54:38 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -319,7 +323,7 @@ diff -N gdb/testsuite/gdb.threads/threadcrash.exp
|
|||
+set testfile threadcrash
|
||||
+set srcfile ${testfile}.c
|
||||
+set shellfile ${srcdir}/${subdir}/${testfile}.sh
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+set GDB_abs ${GDB}
|
||||
+if [regexp "^\[^/\]" ${GDB_abs}] {
|
||||
|
@ -337,7 +341,7 @@ diff -N gdb/testsuite/gdb.threads/threadcrash.exp
|
|||
+}
|
||||
+
|
||||
+# ${shellfile} argument must not contain any directories.
|
||||
+set fd [open "|bash ${shellfile} ${binfile} $GDB -nw $GDBFLAGS" r]
|
||||
+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
|
||||
|
@ -350,12 +354,10 @@ diff -N gdb/testsuite/gdb.threads/threadcrash.exp
|
|||
+}
|
||||
+
|
||||
+return 0
|
||||
Index: ./gdb/testsuite/gdb.threads/threadcrash.sh
|
||||
===================================================================
|
||||
RCS file: gdb/testsuite/gdb.threads/threadcrash.sh
|
||||
diff -N gdb/testsuite/gdb.threads/threadcrash.sh
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.threads/threadcrash.sh 31 Oct 2006 17:54:38 -0000
|
||||
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
|
||||
+
|
||||
|
@ -480,7 +482,7 @@ diff -N gdb/testsuite/gdb.threads/threadcrash.sh
|
|||
+ local FAILURES=0
|
||||
+
|
||||
+ mustNotHave '??' || ((FAILURES++))
|
||||
+ mustHaveCorrectAmount 12 threadcrash.c: || ((FAILURES++))
|
||||
+ mustHaveCorrectAmount 11 threadcrash.c: || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSevenThreads || ((FAILURES++))
|
||||
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
|
||||
|
@ -681,12 +683,10 @@ diff -N gdb/testsuite/gdb.threads/threadcrash.sh
|
|||
+rm -rf $WORKDIR
|
||||
+
|
||||
+exit $FAILURES
|
||||
Index: ./gdb/testsuite/gdb.threads/threadcrash.sh-orig
|
||||
===================================================================
|
||||
RCS file: gdb/testsuite/gdb.threads/threadcrash.sh-orig
|
||||
diff -N gdb/testsuite/gdb.threads/threadcrash.sh-orig
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.threads/threadcrash.sh-orig 31 Oct 2006 17:54:38 -0000
|
||||
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
|
||||
+
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
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:
|
||||
|
@ -16,8 +24,10 @@ http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
|
|||
* gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c,
|
||||
gdb.dwarf2/dw2-included.h: New files.
|
||||
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.dwarf2/dw2-included.c 2 Jan 2007 00:20:27 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -45,8 +55,10 @@ http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
|
|||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.dwarf2/dw2-included.exp 2 Jan 2007 00:20:27 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -79,7 +91,7 @@ http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
|
|||
+
|
||||
+set testfile "dw2-included"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ return -1
|
||||
|
@ -94,9 +106,11 @@ http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
|
|||
+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\nint integer;\r"
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.dwarf2/dw2-included.h 2 Jan 2007 00:20:27 -0000
|
||||
+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.
|
||||
+
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
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>
|
||||
|
@ -22,6 +30,7 @@ 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>
|
||||
|
||||
|
@ -32,21 +41,24 @@ 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
|
||||
@@ -967,6 +967,8 @@ print_command_1 (char *exp, int inspect, int voidprint)
|
||||
@@ -1210,6 +1210,10 @@ print_command_1 (const char *args, int voidprint)
|
||||
|
||||
if (exp && *exp)
|
||||
if (exp != nullptr && *exp)
|
||||
{
|
||||
+ if (strcmp (exp, "errno") == 0)
|
||||
+ exp = "*((int *(*) (void)) __errno_location) ()";
|
||||
expr = parse_expression (exp);
|
||||
old_chain = make_cleanup (free_current_contents, &expr);
|
||||
cleanup = 1;
|
||||
Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2011-03-29 10:55:35.000000000 +0200
|
||||
+ /* '*((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.
|
||||
+
|
||||
|
@ -76,10 +88,10 @@ Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c
|
|||
+
|
||||
+ return 0; /* breakpoint */
|
||||
+}
|
||||
Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2011-03-29 10:55:35.000000000 +0200
|
||||
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.
|
||||
+
|
||||
|
@ -98,7 +110,7 @@ Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
|
|||
+
|
||||
+set testfile dw2-errno
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+proc prep {} {
|
||||
+ global srcdir subdir binfile
|
||||
|
@ -141,3 +153,112 @@ Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
|
|||
+
|
||||
+# 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?
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190810
|
||||
|
||||
|
||||
2006-09-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* remote.c (remote_wait): Suggestion on crash due to nonmatching target.
|
||||
(remote_async_wait): Likewise.
|
||||
|
||||
|
||||
Index: gdb-6.8.50.20090818/gdb/remote.c
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090818.orig/gdb/remote.c 2009-08-18 21:00:35.000000000 +0200
|
||||
+++ gdb-6.8.50.20090818/gdb/remote.c 2009-08-18 21:04:46.000000000 +0200
|
||||
@@ -4408,8 +4408,13 @@ Packet: '%s'\n"),
|
||||
VEC_safe_push (cached_reg_t, event->regcache, &cached_reg);
|
||||
}
|
||||
|
||||
+ /* It may also occur on amd64 which defaults to 32-bit i386
|
||||
+ target. gdbserver(1) is not aware of the `set architecture'
|
||||
+ name itself as it is not using libbfd. */
|
||||
if (*p != ';')
|
||||
- error (_("Remote register badly formatted: %s\nhere: %s"),
|
||||
+ error (_("Remote register badly formatted: %s\nhere: %s"
|
||||
+ "\nTry to load the executable by `file' first,"
|
||||
+ "\nyou may also check `set/show architecture'."),
|
||||
buf, p);
|
||||
++p;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
Index: gdb-7.4.50.20120602/gdb/symfile.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/symfile.c 2012-06-02 18:25:20.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/symfile.c 2012-06-02 18:26:36.145232057 +0200
|
||||
@@ -3630,6 +3630,12 @@ default_symfile_relocate (struct objfile
|
||||
DWO file. */
|
||||
bfd *abfd = sectp->owner;
|
||||
|
||||
+ /* Executable files have all the relocations already resolved.
|
||||
+ Handle files linked with --emit-relocs.
|
||||
+ http://sources.redhat.com/ml/gdb/2006-08/msg00137.html */
|
||||
+ if ((abfd->flags & EXEC_P) != 0)
|
||||
+ return NULL;
|
||||
+
|
||||
/* We're only interested in sections with relocation
|
||||
information. */
|
||||
if ((sectp->flags & SEC_RELOC) == 0)
|
|
@ -1,450 +0,0 @@
|
|||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
|
||||
|
||||
FIXME: This workaround should be dropped and
|
||||
glibc/sysdeps/unix/sysv/linux/x86_64/clone.S should get CFI for the child
|
||||
instead.
|
||||
|
||||
2006-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb/amd64-linux-tdep.c (linux_clone_code): New variable.
|
||||
(LINUX_CLONE_LEN): New definition.
|
||||
(amd64_linux_clone_running, amd64_linux_outermost_frame): New function.
|
||||
(amd64_linux_init_abi): Initialize `outermost_frame_p'.
|
||||
* gdb/i386-tdep.c (i386_gdbarch_init): Likewise.
|
||||
* gdb/i386-tdep.h (gdbarch_tdep): Add `outermost_frame_p' member.
|
||||
* gdb/amd64-tdep.c (amd64_frame_this_id): Call `outermost_frame_p'.
|
||||
|
||||
2006-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.threads/bt-clone-stop.exp, gdb.threads/bt-clone-stop.c:
|
||||
New file.
|
||||
|
||||
2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.7.
|
||||
|
||||
Index: gdb-7.4.50.20120703/gdb/amd64-linux-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/amd64-linux-tdep.c 2012-06-13 22:36:48.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/amd64-linux-tdep.c 2012-07-03 17:32:46.547563363 +0200
|
||||
@@ -271,6 +271,80 @@ amd64_linux_register_reggroup_p (struct
|
||||
|
||||
/* Set the program counter for process PTID to PC. */
|
||||
|
||||
+/* Detect the outermost frame; during unwind of
|
||||
+ #5 0x000000305cec68c3 in clone () from /lib64/tls/libc.so.6
|
||||
+ avoid the additional bogus frame
|
||||
+ #6 0x0000000000000000 in ??
|
||||
+ We compare if the `linux_clone_code' block is _before_ unwound PC. */
|
||||
+
|
||||
+static const unsigned char linux_clone_code[] =
|
||||
+{
|
||||
+/* libc/sysdeps/unix/sysv/linux/x86_64/clone.S */
|
||||
+/* #ifdef RESET_PID */
|
||||
+/* ... */
|
||||
+/* mov $SYS_ify(getpid), %eax */
|
||||
+/* 0xb8, 0x27, 0x00, 0x00, 0x00 */
|
||||
+/* OR */
|
||||
+/* mov $SYS_ify(getpid), %rax */
|
||||
+/* 0x48, 0xc7, 0xc0, 0x27, 0x00, 0x00, 0x00 */
|
||||
+/* so just: */
|
||||
+ 0x27, 0x00, 0x00, 0x00,
|
||||
+/* syscall */
|
||||
+ 0x0f, 0x05,
|
||||
+/* movl %eax, %fs:PID */
|
||||
+ 0x64, 0x89, 0x04, 0x25, 0x94, 0x00, 0x00, 0x00,
|
||||
+/* movl %eax, %fs:TID */
|
||||
+ 0x64, 0x89, 0x04, 0x25, 0x90, 0x00, 0x00, 0x00,
|
||||
+/* #endif */
|
||||
+/* |* Set up arguments for the function call. *| */
|
||||
+/* popq %rax |* Function to call. *| */
|
||||
+ 0x58,
|
||||
+/* popq %rdi |* Argument. *| */
|
||||
+ 0x5f,
|
||||
+/* call *%rax$ */
|
||||
+ 0xff, 0xd0
|
||||
+};
|
||||
+
|
||||
+#define LINUX_CLONE_LEN (sizeof linux_clone_code)
|
||||
+
|
||||
+static int
|
||||
+amd64_linux_clone_running (struct frame_info *this_frame)
|
||||
+{
|
||||
+ CORE_ADDR pc = get_frame_pc (this_frame);
|
||||
+ unsigned char buf[LINUX_CLONE_LEN];
|
||||
+
|
||||
+ if (!safe_frame_unwind_memory (this_frame, pc - LINUX_CLONE_LEN, buf,
|
||||
+ LINUX_CLONE_LEN))
|
||||
+ return 0;
|
||||
+
|
||||
+ if (memcmp (buf, linux_clone_code, LINUX_CLONE_LEN) != 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+amd64_linux_outermost_frame (struct frame_info *this_frame)
|
||||
+{
|
||||
+ CORE_ADDR pc = get_frame_pc (this_frame);
|
||||
+ const char *name;
|
||||
+
|
||||
+ find_pc_partial_function (pc, &name, NULL, NULL);
|
||||
+
|
||||
+ /* If we have NAME, we can optimize the search.
|
||||
+ `clone' NAME still needs to have the code checked as its name may be
|
||||
+ present in the user code.
|
||||
+ `__clone' NAME should not be present in the user code but in the initial
|
||||
+ parts of the `__clone' implementation the unwind still makes sense.
|
||||
+ More detailed unwinding decision would be too much sensitive to possible
|
||||
+ subtle changes in specific glibc revisions. */
|
||||
+ if (name == NULL || strcmp (name, "clone") == 0
|
||||
+ || strcmp ("__clone", name) == 0)
|
||||
+ return (amd64_linux_clone_running (this_frame) != 0);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
|
||||
{
|
||||
@@ -1547,6 +1621,8 @@ amd64_linux_init_abi (struct gdbarch_inf
|
||||
|
||||
amd64_linux_init_abi_common (info, gdbarch);
|
||||
|
||||
+ tdep->outermost_frame_p = amd64_linux_outermost_frame;
|
||||
+
|
||||
/* GNU/Linux uses SVR4-style shared libraries. */
|
||||
set_solib_svr4_fetch_link_map_offsets
|
||||
(gdbarch, svr4_lp64_fetch_link_map_offsets);
|
||||
Index: gdb-7.4.50.20120703/gdb/amd64-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/amd64-tdep.c 2012-06-16 17:20:22.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/amd64-tdep.c 2012-07-03 17:32:12.335604415 +0200
|
||||
@@ -2324,6 +2324,7 @@ amd64_frame_unwind_stop_reason (struct f
|
||||
{
|
||||
struct amd64_frame_cache *cache =
|
||||
amd64_frame_cache (this_frame, this_cache);
|
||||
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
|
||||
|
||||
if (!cache->base_p)
|
||||
return UNWIND_UNAVAILABLE;
|
||||
@@ -2332,6 +2333,10 @@ amd64_frame_unwind_stop_reason (struct f
|
||||
if (cache->base == 0)
|
||||
return UNWIND_OUTERMOST;
|
||||
|
||||
+ /* Detect OS dependent outermost frames; such as `clone'. */
|
||||
+ if (tdep->outermost_frame_p && tdep->outermost_frame_p (this_frame))
|
||||
+ return UNWIND_OUTERMOST;
|
||||
+
|
||||
return UNWIND_NO_REASON;
|
||||
}
|
||||
|
||||
@@ -2341,6 +2346,7 @@ amd64_frame_this_id (struct frame_info *
|
||||
{
|
||||
struct amd64_frame_cache *cache =
|
||||
amd64_frame_cache (this_frame, this_cache);
|
||||
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
|
||||
|
||||
if (!cache->base_p)
|
||||
return;
|
||||
@@ -2349,6 +2355,10 @@ amd64_frame_this_id (struct frame_info *
|
||||
if (cache->base == 0)
|
||||
return;
|
||||
|
||||
+ /* Detect OS dependent outermost frames; such as `clone'. */
|
||||
+ if (tdep->outermost_frame_p && tdep->outermost_frame_p (this_frame))
|
||||
+ return;
|
||||
+
|
||||
(*this_id) = frame_id_build (cache->base + 16, cache->pc);
|
||||
}
|
||||
|
||||
Index: gdb-7.4.50.20120703/gdb/i386-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/i386-tdep.c 2012-06-18 19:31:34.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/i386-tdep.c 2012-07-03 17:32:12.339604409 +0200
|
||||
@@ -7655,6 +7655,9 @@ i386_gdbarch_init (struct gdbarch_info i
|
||||
|
||||
tdep->xsave_xcr0_offset = -1;
|
||||
|
||||
+ /* Unwinding stops on i386 automatically. */
|
||||
+ tdep->outermost_frame_p = NULL;
|
||||
+
|
||||
tdep->record_regmap = i386_record_regmap;
|
||||
|
||||
set_gdbarch_long_long_align_bit (gdbarch, 32);
|
||||
Index: gdb-7.4.50.20120703/gdb/i386-tdep.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/i386-tdep.h 2012-06-13 22:29:15.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/i386-tdep.h 2012-07-03 17:32:12.340604408 +0200
|
||||
@@ -219,6 +219,9 @@ struct gdbarch_tdep
|
||||
int (*i386_sysenter_record) (struct regcache *regcache);
|
||||
/* Parse syscall args. */
|
||||
int (*i386_syscall_record) (struct regcache *regcache);
|
||||
+
|
||||
+ /* Detect OS dependent outermost frames; such as `clone'. */
|
||||
+ int (*outermost_frame_p) (struct frame_info *this_frame);
|
||||
};
|
||||
|
||||
/* Floating-point registers. */
|
||||
Index: gdb-7.4.50.20120703/gdb/ia64-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/ia64-tdep.c 2012-07-03 17:30:09.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/ia64-tdep.c 2012-07-03 17:32:12.343604405 +0200
|
||||
@@ -2176,6 +2176,138 @@ static const struct frame_unwind ia64_fr
|
||||
default_frame_sniffer
|
||||
};
|
||||
|
||||
+/* Detect the outermost frame; during unwind of
|
||||
+ #6 0x2000000000347100 in __clone2 () from /lib/libc.so.6.1
|
||||
+ avoid the additional bogus frame
|
||||
+ #7 0x0000000000000000 in ?? () */
|
||||
+
|
||||
+static char linux_clone2_code[] =
|
||||
+{
|
||||
+/* libc/sysdeps/unix/sysv/linux/ia64/clone2.S */
|
||||
+ 0x09, 0x00, 0x20, 0x12, 0x90, 0x11, 0x00, 0x40,
|
||||
+ 0x28, 0x20, 0x23, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||
+/* st4 [r9]=r8 */
|
||||
+/* st4 [r10]=r8 */
|
||||
+/* ;; */
|
||||
+/* #endif */
|
||||
+ 0x02, 0x50, 0x21, 0x40, 0x18, 0x14, 0x90, 0x02,
|
||||
+ 0x90, 0x00, 0x42, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||
+/* 1: ld8 out1=[in0],8 |* Retrieve code pointer. *| */
|
||||
+/* mov out0=in4 |* Pass proper argument to fn *| */
|
||||
+/* ;; */
|
||||
+ 0x11, 0x08, 0x00, 0x40, 0x18, 0x10, 0x60, 0x50,
|
||||
+ 0x05, 0x80, 0x03, 0x00, 0x68, 0x00, 0x80, 0x12,
|
||||
+/* ld8 gp=[in0] |* Load function gp. *| */
|
||||
+/* mov b6=out1 */
|
||||
+/* br.call.dptk.many rp=b6 |* Call fn(arg) in the child *| */
|
||||
+/* ;; */
|
||||
+ 0x10, 0x48, 0x01, 0x10, 0x00, 0x21, 0x10, 0x00,
|
||||
+ 0xa0, 0x00, 0x42, 0x00, 0x98, 0xdf, 0xf7, 0x5b,
|
||||
+/* mov out0=r8 |* Argument to _exit *| */
|
||||
+/* mov gp=loc0 */
|
||||
+/* .globl HIDDEN_JUMPTARGET(_exit) */
|
||||
+/* br.call.dpnt.many rp=HIDDEN_JUMPTARGET(_exit) */
|
||||
+/* |* call _exit with result from fn. *| */
|
||||
+ 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x02, 0x00, 0x80, 0x00, 0x00, 0x84, 0x00
|
||||
+/* ret |* Not reached. *| */
|
||||
+};
|
||||
+
|
||||
+#define LINUX_CLONE_PRE_SLOTS 3 /* Number of slots before PC. */
|
||||
+#define LINUX_CLONE_LEN (sizeof linux_clone2_code)
|
||||
+
|
||||
+static int
|
||||
+ia64_linux_clone2_running (struct frame_info *this_frame)
|
||||
+{
|
||||
+ CORE_ADDR pc = get_frame_pc (this_frame);
|
||||
+ char buf[LINUX_CLONE_LEN];
|
||||
+ struct minimal_symbol *minsym;
|
||||
+ long long instr;
|
||||
+
|
||||
+ if (!safe_frame_unwind_memory (this_frame, pc - LINUX_CLONE_PRE_SLOTS * 16,
|
||||
+ buf, LINUX_CLONE_LEN))
|
||||
+ return 0;
|
||||
+
|
||||
+ if (memcmp (buf, linux_clone2_code, LINUX_CLONE_PRE_SLOTS * 16) != 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Adjust the expected "_exit" address. */
|
||||
+ minsym = lookup_minimal_symbol_text ("_exit", NULL);
|
||||
+ if (minsym == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
+ instr = slotN_contents (&linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16], 2);
|
||||
+ instr &= ~(((1L << 20) - 1) << 13);
|
||||
+ /* Address is relative to the jump instruction slot, not the next one. */
|
||||
+ instr |= (((SYMBOL_VALUE_ADDRESS (minsym) - (pc & ~0xfL)) >> 4)
|
||||
+ & ((1L << 20) - 1)) << 13;
|
||||
+ replace_slotN_contents (&linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16], instr,
|
||||
+ 2);
|
||||
+
|
||||
+ if (memcmp (&buf[LINUX_CLONE_PRE_SLOTS * 16],
|
||||
+ &linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16],
|
||||
+ LINUX_CLONE_LEN - (LINUX_CLONE_PRE_SLOTS * 16)) != 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+ia64_outermost_frame (struct frame_info *this_frame)
|
||||
+{
|
||||
+ CORE_ADDR pc = get_frame_pc (this_frame);
|
||||
+ char *name;
|
||||
+
|
||||
+ find_pc_partial_function (pc, &name, NULL, NULL);
|
||||
+
|
||||
+ /* If we have NAME, we can optimize the search.
|
||||
+ `clone' NAME still needs to have the code checked as its name may be
|
||||
+ present in the user code.
|
||||
+ `__clone' NAME should not be present in the user code but in the initial
|
||||
+ parts of the `__clone' implementation the unwind still makes sense.
|
||||
+ More detailed unwinding decision would be too much sensitive to possible
|
||||
+ subtle changes in specific glibc revisions. */
|
||||
+ if (name == NULL || strcmp (name, "clone2") == 0
|
||||
+ || strcmp ("__clone2", name) == 0)
|
||||
+ return (ia64_linux_clone2_running (this_frame) != 0);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+ia64_clone2_frame_this_id (struct frame_info *this_frame, void **this_cache,
|
||||
+ struct frame_id *this_id)
|
||||
+{
|
||||
+ /* Leave the default outermost frame at *THIS_ID. */
|
||||
+}
|
||||
+
|
||||
+static struct value *
|
||||
+ia64_clone2_frame_prev_register (struct frame_info *this_frame,
|
||||
+ void **this_cache, int regnum)
|
||||
+{
|
||||
+ return frame_unwind_got_register (this_frame, regnum, regnum);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+ia64_clone2_frame_sniffer (const struct frame_unwind *self,
|
||||
+ struct frame_info *this_frame,
|
||||
+ void **this_prologue_cache)
|
||||
+{
|
||||
+ if (ia64_outermost_frame (this_frame))
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct frame_unwind ia64_clone2_frame_unwind =
|
||||
+{
|
||||
+ NORMAL_FRAME,
|
||||
+ &ia64_clone2_frame_this_id,
|
||||
+ &ia64_clone2_frame_prev_register,
|
||||
+ NULL,
|
||||
+ &ia64_clone2_frame_sniffer
|
||||
+};
|
||||
+
|
||||
/* Signal trampolines. */
|
||||
|
||||
static void
|
||||
@@ -4146,6 +4278,7 @@ ia64_gdbarch_init (struct gdbarch_info i
|
||||
set_gdbarch_dummy_id (gdbarch, ia64_dummy_id);
|
||||
|
||||
set_gdbarch_unwind_pc (gdbarch, ia64_unwind_pc);
|
||||
+ frame_unwind_append_unwinder (gdbarch, &ia64_clone2_frame_unwind);
|
||||
#ifdef HAVE_LIBUNWIND_IA64_H
|
||||
frame_unwind_append_unwinder (gdbarch,
|
||||
&ia64_libunwind_sigtramp_frame_unwind);
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.c 2012-07-03 17:32:12.344604404 +0200
|
||||
@@ -0,0 +1,39 @@
|
||||
+/* 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., 51 Franklin Street, Fifth Floor, Boston,
|
||||
+ MA 02110-1301, USA. */
|
||||
+
|
||||
+
|
||||
+#include <pthread.h>
|
||||
+#include <unistd.h>
|
||||
+#include <assert.h>
|
||||
+
|
||||
+
|
||||
+void *threader (void *arg)
|
||||
+{
|
||||
+ assert (0);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+int main (void)
|
||||
+{
|
||||
+ pthread_t t1;
|
||||
+
|
||||
+ pthread_create (&t1, NULL, threader, (void *) NULL);
|
||||
+ for (;;)
|
||||
+ pause();
|
||||
+}
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2012-07-03 17:32:12.344604404 +0200
|
||||
@@ -0,0 +1,61 @@
|
||||
+# 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.
|
||||
+
|
||||
+# Backtraced `clone' must not have `PC == 0' as its previous frame.
|
||||
+
|
||||
+if $tracelevel then {
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+set testfile bt-clone-stop
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+if { [gdb_compile_pthreads "${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}
|
||||
+
|
||||
+# threader: threader.c:8: threader: Assertion `0' failed.
|
||||
+# Program received signal SIGABRT, Aborted.
|
||||
+
|
||||
+gdb_test "run" \
|
||||
+ "Program received signal SIGABRT.*" \
|
||||
+ "run"
|
||||
+
|
||||
+# Former gdb unwind (the first function is `clone'):
|
||||
+# #5 0x0000003421ecd62d in ?? () from /lib64/libc.so.6
|
||||
+# #6 0x0000000000000000 in ?? ()
|
||||
+# (gdb)
|
||||
+# Tested `amd64_linux_outermost_frame' functionality should omit the line `#6'.
|
||||
+#
|
||||
+# Two `-re' cases below must be in this order (1st is a subset of the 2nd one).
|
||||
+# Unhandled case below should not happen and it is fortunately handled by
|
||||
+# `amd64_linux_outermost_frame' as FAIL (and result `0x0 entry output invalid').
|
||||
+gdb_test_multiple "bt" "0x0 entry output invalid" {
|
||||
+ -re "in threader \\(.*\n#\[0-9\]* *0x0* in .*$gdb_prompt $" {
|
||||
+ fail "0x0 entry found"
|
||||
+ }
|
||||
+ -re "in threader \\(.*$gdb_prompt $" {
|
||||
+ pass "0x0 entry not found"
|
||||
+ }
|
||||
+}
|
|
@ -1,8 +1,50 @@
|
|||
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
|
||||
|
||||
|
||||
--- /dev/null 2006-12-17 14:18:21.881669220 -0500
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/step-over-trampoline.exp 2006-12-17 16:52:51.000000000 -0500
|
||||
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.
|
||||
+
|
||||
|
@ -26,7 +68,7 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
|
|||
+
|
||||
+set testfile step-over-trampoline
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
|
@ -58,34 +100,3 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
|
|||
+ fail "stepped into trampoline"
|
||||
+ }
|
||||
+}
|
||||
--- /dev/null 2006-12-17 14:18:21.881669220 -0500
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/step-over-trampoline.c 2006-12-17 16:18:12.000000000 -0500
|
||||
@@ -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;
|
||||
+}
|
||||
|
|
|
@ -1,21 +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
|
||||
|
||||
|
||||
Index: gdb-7.2.50.20110117/gdb/symtab.c
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20110117.orig/gdb/symtab.c 2011-01-17 15:47:37.000000000 +0100
|
||||
+++ gdb-7.2.50.20110117/gdb/symtab.c 2011-01-17 15:51:48.000000000 +0100
|
||||
@@ -2015,6 +2015,13 @@ find_pc_sect_line (CORE_ADDR pc, struct
|
||||
SYMBOL_LINKAGE_NAME (msymbol)); */
|
||||
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 (SYMBOL_VALUE (mfunsym) == pc)
|
||||
+ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", SYMBOL_LINKAGE_NAME (msymbol), paddress (target_gdbarch, pc));
|
||||
+ 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
|
||||
return find_pc_line (SYMBOL_VALUE_ADDRESS (mfunsym), 0);
|
||||
}
|
||||
{
|
||||
/* Detect an obvious case of infinite recursion. If this
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp
|
||||
--- gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp 2007-07-31 13:04:12.000000000 -0400
|
||||
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.
|
||||
+
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
diff -u -X /home/jkratoch/.diffi.list -ruNp gdb-6.5/gdb/testsuite/gdb.base/gcore-excessive-memory.c gdb-6.5-unknown/gdb/testsuite/gdb.base/gcore-excessive-memory.c
|
||||
--- gdb-6.5/gdb/testsuite/gdb.base/gcore-excessive-memory.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ gdb-6.5-unknown/gdb/testsuite/gdb.base/gcore-excessive-memory.c 2008-01-08 11:25:45.000000000 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -39,9 +48,10 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp gdb-6.5/gdb/testsuite/gdb.base/gcore
|
|||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff -u -X /home/jkratoch/.diffi.list -ruNp gdb-6.5/gdb/testsuite/gdb.base/gcore-excessive-memory.exp gdb-6.5-unknown/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
|
||||
--- gdb-6.5/gdb/testsuite/gdb.base/gcore-excessive-memory.exp 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ gdb-6.5-unknown/gdb/testsuite/gdb.base/gcore-excessive-memory.exp 2008-01-08 11:47:32.000000000 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -61,9 +71,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp gdb-6.5/gdb/testsuite/gdb.base/gcore
|
|||
+
|
||||
+set testfile gcore-excessive-memory
|
||||
+set srcfile ${testfile}.c
|
||||
+set shfile ${objdir}/${subdir}/${testfile}-gdb.sh
|
||||
+set corefile ${objdir}/${subdir}/${testfile}.core
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+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
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
diff -u -rup gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.c gdb-6.3/gdb/testsuite/gdb.base/unwind-leak.c
|
||||
--- gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.c 2007-12-19 15:12:55.000000000 -0500
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/unwind-leak.c 2007-12-19 13:55:22.000000000 -0500
|
||||
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.
|
||||
+
|
||||
|
@ -31,9 +40,10 @@ diff -u -rup gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.c gdb-6.3/gdb/tests
|
|||
+ alarm (0);
|
||||
+ return 0;
|
||||
+}
|
||||
diff -u -rup gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.exp gdb-6.3/gdb/testsuite/gdb.base/unwind-leak.exp
|
||||
--- gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.exp 2007-12-19 15:12:53.000000000 -0500
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.base/unwind-leak.exp 2007-12-19 15:11:35.000000000 -0500
|
||||
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.
|
||||
+
|
||||
|
@ -53,8 +63,8 @@ diff -u -rup gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.exp gdb-6.3/gdb/tes
|
|||
+
|
||||
+set testfile unwind-leak
|
||||
+set srcfile ${testfile}.c
|
||||
+set shfile ${objdir}/${subdir}/${testfile}-gdb.sh
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+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
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
Index: ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
|
||||
===================================================================
|
||||
RCS file: ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
|
||||
diff -N ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp 15 Nov 2006 21:43:24 -0000
|
||||
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.
|
||||
+
|
||||
|
|
|
@ -1,55 +1,18 @@
|
|||
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
|
||||
|
||||
--- /dev/null 2007-12-14 20:45:09.113039517 +0100
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/watchpoint-during-step.exp 2007-12-24 19:42:00.000000000 +0100
|
||||
@@ -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 ${objdir}/${subdir}/${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"
|
||||
--- /dev/null 2007-12-14 20:45:09.113039517 +0100
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/watchpoint-during-step.c 2007-12-24 19:38:10.000000000 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -81,3 +44,52 @@ Fix has been committed to:
|
|||
+ 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"
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
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
|
||||
|
||||
|
||||
Index: ./gdb/testsuite/gdb.base/readline-overflow.exp
|
||||
===================================================================
|
||||
RCS file: ./gdb/testsuite/gdb.base/readline-overflow.exp
|
||||
diff -N ./gdb/testsuite/gdb.base/readline-overflow.exp
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.base/readline-overflow.exp 13 Nov 2006 23:42:50 -0000
|
||||
@@ -0,0 +1,125 @@
|
||||
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
|
||||
|
@ -39,98 +44,76 @@ diff -N ./gdb/testsuite/gdb.base/readline-overflow.exp
|
|||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+# 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.
|
||||
+global env
|
||||
+if [info exists env(INPUTRC)] {
|
||||
+ set old_inputrc $env(INPUTRC)
|
||||
+}
|
||||
+set env(INPUTRC) "/dev/null"
|
||||
+
|
||||
+set oldtimeout1 $timeout
|
||||
+set timeout 600
|
||||
+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
|
||||
+
|
||||
+if [info exists env(GDBHISTFILE)] {
|
||||
+ set old_gdbhistfile $env(GDBHISTFILE)
|
||||
+}
|
||||
+if [info exists env(HISTSIZE)] {
|
||||
+ set old_histsize $env(HISTSIZE)
|
||||
+}
|
||||
+set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
|
||||
+set env(HISTSIZE) "10"
|
||||
+ # 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"
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ 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 {
|
||||
+ 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
|
||||
+ }
|
||||
+ incr i
|
||||
+ if {$i <= $total} {
|
||||
+ send_gdb "X"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ }
|
||||
+ -re "\[ \b\r\n\]" {
|
||||
+ exp_continue
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ eof {
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters, reason: EOF"
|
||||
+ gdb_clear_suppressed
|
||||
+ 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
|
||||
+ 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
|
||||
+ 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"
|
||||
+}
|
||||
+gdb_test "\r" \
|
||||
+ "No executable file specified..*" \
|
||||
+ "All the characters transferred"
|
||||
+
|
||||
+
|
||||
+# Restore globals modified in this test...
|
||||
+if [info exists old_inputrc] {
|
||||
+ set env(INPUTRC) $old_inputrc
|
||||
+} else {
|
||||
+ unset env(INPUTRC)
|
||||
+}
|
||||
+if [info exists old_gdbhistfile] {
|
||||
+ set env(GDBHISTFILE) $old_gdbhistfile
|
||||
+} else {
|
||||
+ unset env(GDBHISTFILE)
|
||||
+}
|
||||
+if [info exists old_histsize] {
|
||||
+ set env(HISTSIZE) $old_histsize
|
||||
+} else {
|
||||
+ unset env(HISTSIZE)
|
||||
+}
|
||||
+set timeout $oldtimeout1
|
||||
+
|
||||
+return 0
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-lib.c gdb-6.5/gdb/testsuite/gdb.base/datalib-lib.c
|
||||
--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-lib.c 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/datalib-lib.c 2008-05-29 13:51:50.000000000 -0400
|
||||
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.
|
||||
+
|
||||
|
@ -24,9 +33,10 @@ diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-lib.c gdb-6.5/gdb/tes
|
|||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int var;
|
||||
diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-main.c gdb-6.5/gdb/testsuite/gdb.base/datalib-main.c
|
||||
--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-main.c 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/datalib-main.c 2008-05-29 13:51:39.000000000 -0400
|
||||
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.
|
||||
+
|
||||
|
@ -54,9 +64,10 @@ diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-main.c gdb-6.5/gdb/te
|
|||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib.exp gdb-6.5/gdb/testsuite/gdb.base/datalib.exp
|
||||
--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib.exp 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ gdb-6.5/gdb/testsuite/gdb.base/datalib.exp 2008-05-29 14:58:33.000000000 -0400
|
||||
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.
|
||||
+
|
||||
|
@ -77,8 +88,8 @@ diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib.exp gdb-6.5/gdb/tests
|
|||
+set testfile datalib
|
||||
+set srcfilemain ${testfile}-main.c
|
||||
+set srcfilelib ${testfile}-lib.c
|
||||
+set libfile ${objdir}/${subdir}/${testfile}-lib.so
|
||||
+set binfile ${objdir}/${subdir}/${testfile}-main
|
||||
+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
|
||||
|
|
|
@ -1,15 +1,21 @@
|
|||
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
|
||||
|
@ -23,10 +29,10 @@ The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
|
|||
|
||||
Port to gdb-6.7.50.20080227.
|
||||
|
||||
Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c 2008-02-27 09:00:15.000000000 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -53,10 +59,10 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
|
|||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c 2008-02-27 09:00:15.000000000 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -80,9 +86,11 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
|
|||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+__thread int var = 42;
|
||||
--- /dev/null 2009-02-10 00:19:00.494289687 +0100
|
||||
+++ gdb-6.8.50.20090209-x/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2009-02-10 00:49:38.000000000 +0100
|
||||
@@ -0,0 +1,86 @@
|
||||
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
|
||||
|
@ -107,10 +115,10 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
|
|||
+set srcmainfile ${testfile}-main.c
|
||||
+set srcsharedfile ${testfile}-shared.c
|
||||
+
|
||||
+set binmainfile ${objdir}/${subdir}/${testfile}-main
|
||||
+set binmainfile [standard_output_file ${testfile}-main]
|
||||
+set binsharedbase ${testfile}-shared.so
|
||||
+set binsharedfile ${objdir}/${subdir}/${binsharedbase}
|
||||
+set binshareddebugfile ${objdir}/${subdir}/${binsharedbase}.debug
|
||||
+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.
|
||||
|
@ -144,7 +152,8 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
|
|||
+# \$PWD is easy - it is the absolute way
|
||||
+# ${subdir} would fail on "print var"
|
||||
+
|
||||
+foreach ld_library_path [list [pwd]/${subdir} ./${subdir}] name { absolute relative } {
|
||||
+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
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
2007-09-23 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New variables
|
||||
X_SHDR_SHSTRTAB and I_SHDR_SHSTRTAB. Fixed the CONTENTS_SIZE trimming
|
||||
check for its aligned size between the last segment and still before
|
||||
the section header end. Added variables check to cover also the
|
||||
section header string table.
|
||||
|
||||
--- gdb-7.4.50.20120120-orig/bfd/elfcode.h 2012-02-29 09:17:08.000000000 +0100
|
||||
+++ gdb-7.4.50.20120120/bfd/elfcode.h 2012-02-29 10:23:03.000000000 +0100
|
||||
@@ -1621,6 +1621,8 @@ NAME(_bfd_elf,bfd_from_remote_memory)
|
||||
Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */
|
||||
Elf_External_Phdr *x_phdrs;
|
||||
Elf_Internal_Phdr *i_phdrs, *last_phdr;
|
||||
+ Elf_External_Shdr *x_shdrs;
|
||||
+ Elf_Internal_Shdr *i_shdrs;
|
||||
bfd *nbfd;
|
||||
struct bfd_in_memory *bim;
|
||||
int contents_size;
|
||||
@@ -1740,24 +1742,46 @@ NAME(_bfd_elf,bfd_from_remote_memory)
|
||||
|
||||
/* Trim the last segment so we don't bother with zeros in the last page
|
||||
that are off the end of the file. However, if the extra bit in that
|
||||
- page includes the section headers, keep them. */
|
||||
- if ((bfd_vma) contents_size > last_phdr->p_offset + last_phdr->p_filesz
|
||||
- && (bfd_vma) contents_size >= (i_ehdr.e_shoff
|
||||
- + i_ehdr.e_shnum * i_ehdr.e_shentsize))
|
||||
+ page includes the section headers os the section header string table,
|
||||
+ keep them. */
|
||||
+ if ((bfd_vma) contents_size > last_phdr->p_offset + last_phdr->p_filesz)
|
||||
+ contents_size = last_phdr->p_offset + last_phdr->p_filesz;
|
||||
+
|
||||
+ if ((bfd_vma) contents_size < i_ehdr.e_shoff
|
||||
+ + i_ehdr.e_shnum * i_ehdr.e_shentsize)
|
||||
+ contents_size = i_ehdr.e_shoff + i_ehdr.e_shnum * i_ehdr.e_shentsize;
|
||||
+
|
||||
+ /* Verify also all the sections fit into CONTENTS_SIZE. */
|
||||
+
|
||||
+ x_shdrs = bfd_malloc (i_ehdr.e_shnum * (sizeof *x_shdrs + sizeof *i_shdrs));
|
||||
+ if (x_shdrs == NULL)
|
||||
{
|
||||
- contents_size = last_phdr->p_offset + last_phdr->p_filesz;
|
||||
- if ((bfd_vma) contents_size < (i_ehdr.e_shoff
|
||||
- + i_ehdr.e_shnum * i_ehdr.e_shentsize))
|
||||
- contents_size = i_ehdr.e_shoff + i_ehdr.e_shnum * i_ehdr.e_shentsize;
|
||||
+ free (x_phdrs);
|
||||
+ bfd_set_error (bfd_error_no_memory);
|
||||
+ return NULL;
|
||||
}
|
||||
+ err = target_read_memory (ehdr_vma + i_ehdr.e_shoff, (bfd_byte *) x_shdrs,
|
||||
+ i_ehdr.e_shnum * sizeof *x_shdrs);
|
||||
+ if (err)
|
||||
+ i_shdrs = NULL;
|
||||
else
|
||||
- contents_size = last_phdr->p_offset + last_phdr->p_filesz;
|
||||
+ {
|
||||
+ i_shdrs = (Elf_Internal_Shdr *) &x_shdrs[i_ehdr.e_shnum];
|
||||
+ for (i = 0; i < i_ehdr.e_shnum; ++i)
|
||||
+ {
|
||||
+ elf_swap_shdr_in (templ, &x_shdrs[i], &i_shdrs[i]);
|
||||
+
|
||||
+ if ((bfd_vma) contents_size < i_shdrs[i].sh_offset + i_shdrs[i].sh_size)
|
||||
+ contents_size = i_shdrs[i].sh_offset + i_shdrs[i].sh_size;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* Now we know the size of the whole image we want read in. */
|
||||
contents = (bfd_byte *) bfd_zmalloc (contents_size);
|
||||
if (contents == NULL)
|
||||
{
|
||||
free (x_phdrs);
|
||||
+ free (x_shdrs);
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1776,6 +1800,7 @@ NAME(_bfd_elf,bfd_from_remote_memory)
|
||||
if (err)
|
||||
{
|
||||
free (x_phdrs);
|
||||
+ free (x_shdrs);
|
||||
free (contents);
|
||||
bfd_set_error (bfd_error_system_call);
|
||||
errno = err;
|
||||
@@ -1784,10 +1809,32 @@ NAME(_bfd_elf,bfd_from_remote_memory)
|
||||
}
|
||||
free (x_phdrs);
|
||||
|
||||
- /* If the segments visible in memory didn't include the section headers,
|
||||
+ if (i_shdrs)
|
||||
+ {
|
||||
+ memcpy (contents + i_ehdr.e_shoff, x_shdrs,
|
||||
+ i_ehdr.e_shnum * sizeof *x_shdrs);
|
||||
+
|
||||
+ for (i = 0; i < i_ehdr.e_shnum; ++i)
|
||||
+ {
|
||||
+ bfd_vma start = i_shdrs[i].sh_offset;
|
||||
+ bfd_vma end = i_shdrs[i].sh_offset + i_shdrs[i].sh_size;
|
||||
+
|
||||
+ if (end > (bfd_vma) contents_size)
|
||||
+ end = contents_size;
|
||||
+ err = target_read_memory (ehdr_vma + start, contents + start,
|
||||
+ end - start);
|
||||
+ if (err)
|
||||
+ {
|
||||
+ i_shdrs = NULL;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ free (x_shdrs);
|
||||
+
|
||||
+ /* If the segments readable in memory didn't include the section headers,
|
||||
then clear them from the file header. */
|
||||
- if ((bfd_vma) contents_size < (i_ehdr.e_shoff
|
||||
- + i_ehdr.e_shnum * i_ehdr.e_shentsize))
|
||||
+ if (i_shdrs == NULL)
|
||||
{
|
||||
memset (&x_ehdr.e_shoff, 0, sizeof x_ehdr.e_shoff);
|
||||
memset (&x_ehdr.e_shnum, 0, sizeof x_ehdr.e_shnum);
|
|
@ -1,5 +1,11 @@
|
|||
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
|
||||
Subject: Re: [patch] print a more useful error message for "gdb core"
|
||||
|
||||
[ Fixed up since the mail. ]
|
||||
|
||||
|
@ -31,16 +37,13 @@ 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.
|
||||
|
@ -58,33 +61,19 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
|
|||
* exec.c (exec_file_attach): Print a more useful error message if the
|
||||
user did "gdb core".
|
||||
|
||||
Index: gdb-7.4.91.20120801/gdb/exceptions.h
|
||||
===================================================================
|
||||
--- gdb-7.4.91.20120801.orig/gdb/exceptions.h 2012-01-04 09:17:01.000000000 +0100
|
||||
+++ gdb-7.4.91.20120801/gdb/exceptions.h 2012-08-01 18:43:39.806959992 +0200
|
||||
@@ -86,6 +86,9 @@ enum errors {
|
||||
/* DW_OP_GNU_entry_value resolving failed. */
|
||||
NO_ENTRY_VALUE_ERROR,
|
||||
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/>. */
|
||||
|
||||
+ /* Attempt to load a core file as executable. */
|
||||
+ IS_CORE_ERROR,
|
||||
+
|
||||
/* Add more errors here. */
|
||||
NR_ERRORS
|
||||
};
|
||||
Index: gdb-7.4.91.20120801/gdb/exec.c
|
||||
===================================================================
|
||||
--- gdb-7.4.91.20120801.orig/gdb/exec.c 2012-08-01 18:36:51.000000000 +0200
|
||||
+++ gdb-7.4.91.20120801/gdb/exec.c 2012-08-01 18:44:39.928627287 +0200
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "gdbthread.h"
|
||||
#include "progspace.h"
|
||||
#include "gdb_bfd.h"
|
||||
#include "defs.h"
|
||||
+#include "arch-utils.h"
|
||||
+#include "exceptions.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "readline/readline.h"
|
||||
@@ -242,12 +243,27 @@ exec_file_attach (char *filename, int fr
|
||||
#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))
|
||||
{
|
||||
|
@ -99,64 +88,61 @@ Index: gdb-7.4.91.20120801/gdb/exec.c
|
|||
/* Make sure to close exec_bfd, or else "run" might try to use
|
||||
it. */
|
||||
exec_close ();
|
||||
- error (_("\"%s\": not in executable format: %s"),
|
||||
- scratch_pathname,
|
||||
- gdb_bfd_errmsg (bfd_get_error (), matching));
|
||||
- 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);
|
||||
+ _("\"%s\" is a core file.\n"
|
||||
+ "Please specify an executable to debug."),
|
||||
+ scratch_pathname);
|
||||
+ else
|
||||
+ error (_("\"%s\": not in executable format: %s"),
|
||||
+ scratch_pathname,
|
||||
+ gdb_bfd_errmsg (bfd_get_error (), matching));
|
||||
+ error (_("\"%ps\": not in executable format: %s"),
|
||||
+ styled_string (file_name_style.style (), scratch_pathname),
|
||||
+ gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
}
|
||||
|
||||
/* FIXME - This should only be run for RS6000, but the ifdef is a poor
|
||||
Index: gdb-7.4.91.20120801/gdb/main.c
|
||||
===================================================================
|
||||
--- gdb-7.4.91.20120801.orig/gdb/main.c 2012-08-01 18:36:51.000000000 +0200
|
||||
+++ gdb-7.4.91.20120801/gdb/main.c 2012-08-01 18:43:39.810959970 +0200
|
||||
@@ -266,6 +266,36 @@ typedef struct cmdarg {
|
||||
/* Define type VEC (cmdarg_s). */
|
||||
DEF_VEC_O (cmdarg_s);
|
||||
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 (char *filename, int from_tty)
|
||||
+exec_or_core_file_attach (const char *filename, int from_tty)
|
||||
+{
|
||||
+ volatile struct gdb_exception e;
|
||||
+
|
||||
+ gdb_assert (exec_bfd == NULL);
|
||||
+
|
||||
+ TRY_CATCH (e, RETURN_MASK_ALL)
|
||||
+ try
|
||||
+ {
|
||||
+ exec_file_attach (filename, from_tty);
|
||||
+ }
|
||||
+ if (e.reason < 0)
|
||||
+ catch (gdb_exception_error &e)
|
||||
+ {
|
||||
+ if (e.error == IS_CORE_ERROR)
|
||||
+ {
|
||||
+ core_file_command (filename, from_tty);
|
||||
+ 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 (e);
|
||||
+ throw_exception (std::move (e));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int
|
||||
captured_main (void *data)
|
||||
static void
|
||||
captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
@@ -762,6 +792,8 @@ captured_main (void *data)
|
||||
@@ -959,6 +987,8 @@ captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
symarg = argv[optind];
|
||||
execarg = argv[optind];
|
||||
|
@ -165,11 +151,11 @@ Index: gdb-7.4.91.20120801/gdb/main.c
|
|||
optind++;
|
||||
}
|
||||
|
||||
@@ -917,11 +949,25 @@ captured_main (void *data)
|
||||
@@ -1114,12 +1144,25 @@ captured_main_1 (struct captured_main_args *context)
|
||||
&& symarg != NULL
|
||||
&& strcmp (execarg, symarg) == 0)
|
||||
{
|
||||
+ catch_command_errors_ftype *func;
|
||||
+ 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). */
|
||||
|
@ -184,13 +170,27 @@ Index: gdb-7.4.91.20120801/gdb/main.c
|
|||
/* 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! */
|
||||
- if (catch_command_errors (exec_file_attach, execarg,
|
||||
- !batch_flag, RETURN_MASK_ALL))
|
||||
- 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. */
|
||||
+ if (catch_command_errors (func, execarg, !batch_flag, RETURN_MASK_ALL)
|
||||
+ && core_bfd == NULL)
|
||||
catch_command_errors (symbol_file_add_main, symarg,
|
||||
!batch_flag, RETURN_MASK_ALL);
|
||||
+ 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}]"
|
|
@ -1,8 +1,15 @@
|
|||
Index: gdb-7.4.50.20120602/gdb/elfread.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/elfread.c 2012-06-02 21:35:09.669510757 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/elfread.c 2012-06-02 21:35:31.106502660 +0200
|
||||
@@ -1658,6 +1658,19 @@ build_id_to_filename (struct build_id *b
|
||||
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
|
||||
|
||||
|
@ -22,10 +29,9 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
|
||||
and avoid their duplicities during a single inferior run. */
|
||||
|
||||
Index: gdb-7.4.50.20120602/gdb/proc-service.list
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/proc-service.list 2012-06-02 21:35:09.669510757 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/proc-service.list 2012-06-02 21:35:14.296508989 +0200
|
||||
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;
|
||||
|
|
|
@ -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),
|
|
@ -1,47 +1,250 @@
|
|||
Index: gdb-7.4.50.20120602/gdb/event-top.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/event-top.c 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/event-top.c 2012-06-02 21:08:23.479221885 +0200
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "observer.h"
|
||||
#include "continuations.h"
|
||||
#include "gdbcmd.h" /* for dont_repeat() */
|
||||
+#include "symfile.h"
|
||||
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.patch
|
||||
|
||||
;;=push+jan
|
||||
|
||||
diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
|
||||
--- a/gdb/aclocal.m4
|
||||
+++ b/gdb/aclocal.m4
|
||||
@@ -11,7 +11,223 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
/* readline include files. */
|
||||
#include "readline/readline.h"
|
||||
@@ -176,6 +177,8 @@ rl_callback_read_char_wrapper (gdb_clien
|
||||
void
|
||||
cli_command_loop (void)
|
||||
{
|
||||
+ debug_flush_missing ();
|
||||
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
+# serial 1 (pkg-config-0.24)
|
||||
+#
|
||||
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
+#
|
||||
+# 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.
|
||||
+#
|
||||
+# As a special exception to the GNU General Public License, if you
|
||||
+# distribute this file as part of a program that contains a
|
||||
+# configuration script generated by Autoconf, you may include it under
|
||||
+# the same distribution terms that you use for the rest of that program.
|
||||
+
|
||||
display_gdb_prompt (0);
|
||||
|
||||
/* Now it's time to start the event loop. */
|
||||
@@ -241,6 +244,8 @@ display_gdb_prompt (char *new_prompt)
|
||||
/* Reset the nesting depth used when trace-commands is set. */
|
||||
reset_command_nest_depth ();
|
||||
|
||||
+ debug_flush_missing ();
|
||||
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
+# ----------------------------------
|
||||
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
|
||||
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
|
||||
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
|
||||
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
|
||||
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
|
||||
+
|
||||
/* Each interpreter has its own rules on displaying the command
|
||||
prompt. */
|
||||
if (!current_interp_display_prompt_p ())
|
||||
Index: gdb-7.4.50.20120602/gdb/elfread.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/elfread.c 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/elfread.c 2012-06-02 21:08:23.482221882 +0200
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "gdbcore.h"
|
||||
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
+fi
|
||||
+if test -n "$PKG_CONFIG"; then
|
||||
+ _pkg_min_version=m4_default([$1], [0.9.0])
|
||||
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ else
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ PKG_CONFIG=""
|
||||
+ fi
|
||||
+fi[]dnl
|
||||
+])# PKG_PROG_PKG_CONFIG
|
||||
+
|
||||
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
+#
|
||||
+# Check to see whether a particular set of modules exists. Similar
|
||||
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
+#
|
||||
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
+# only at the first occurence in configure.ac, so if the first place
|
||||
+# it's called might be skipped (such as if it is within an "if", you
|
||||
+# have to call PKG_CHECK_EXISTS manually
|
||||
+# --------------------------------------------------------------
|
||||
+AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+if test -n "$PKG_CONFIG" && \
|
||||
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
+ m4_default([$2], [:])
|
||||
+m4_ifvaln([$3], [else
|
||||
+ $3])dnl
|
||||
+fi])
|
||||
+
|
||||
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
+# ---------------------------------------------
|
||||
+m4_define([_PKG_CONFIG],
|
||||
+[if test -n "$$1"; then
|
||||
+ pkg_cv_[]$1="$$1"
|
||||
+ elif test -n "$PKG_CONFIG"; then
|
||||
+ PKG_CHECK_EXISTS([$3],
|
||||
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
|
||||
+ test "x$?" != "x0" && pkg_failed=yes ],
|
||||
+ [pkg_failed=yes])
|
||||
+ else
|
||||
+ pkg_failed=untried
|
||||
+fi[]dnl
|
||||
+])# _PKG_CONFIG
|
||||
+
|
||||
+# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+# -----------------------------
|
||||
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
+ _pkg_short_errors_supported=yes
|
||||
+else
|
||||
+ _pkg_short_errors_supported=no
|
||||
+fi[]dnl
|
||||
+])# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+
|
||||
+
|
||||
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
+# [ACTION-IF-NOT-FOUND])
|
||||
+#
|
||||
+#
|
||||
+# Note that if there is a possibility the first call to
|
||||
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
+#
|
||||
+#
|
||||
+# --------------------------------------------------------------
|
||||
+AC_DEFUN([PKG_CHECK_MODULES],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
+
|
||||
+pkg_failed=no
|
||||
+AC_MSG_CHECKING([for $1])
|
||||
+
|
||||
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
+
|
||||
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
+and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
+See the pkg-config man page for more details.])
|
||||
+
|
||||
+if test $pkg_failed = yes; then
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+ if test $_pkg_short_errors_supported = yes; then
|
||||
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
|
||||
+ else
|
||||
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
|
||||
+ fi
|
||||
+ # Put the nasty error message in config.log where it belongs
|
||||
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
+
|
||||
+ m4_default([$4], [AC_MSG_ERROR(
|
||||
+[Package requirements ($2) were not met:
|
||||
+
|
||||
+$$1_PKG_ERRORS
|
||||
+
|
||||
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
+installed software in a non-standard prefix.
|
||||
+
|
||||
+_PKG_TEXT])[]dnl
|
||||
+ ])
|
||||
+elif test $pkg_failed = untried; then
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ m4_default([$4], [AC_MSG_FAILURE(
|
||||
+[The pkg-config script could not be found or is too old. Make sure it
|
||||
+is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
+path to pkg-config.
|
||||
+
|
||||
+_PKG_TEXT
|
||||
+
|
||||
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
|
||||
+ ])
|
||||
+else
|
||||
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ $3
|
||||
+fi[]dnl
|
||||
+])# PKG_CHECK_MODULES
|
||||
+
|
||||
+
|
||||
+# PKG_INSTALLDIR(DIRECTORY)
|
||||
+# -------------------------
|
||||
+# Substitutes the variable pkgconfigdir as the location where a module
|
||||
+# should install pkg-config .pc files. By default the directory is
|
||||
+# $libdir/pkgconfig, but the default can be changed by passing
|
||||
+# DIRECTORY. The user can override through the --with-pkgconfigdir
|
||||
+# parameter.
|
||||
+AC_DEFUN([PKG_INSTALLDIR],
|
||||
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
|
||||
+m4_pushdef([pkg_description],
|
||||
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
|
||||
+AC_ARG_WITH([pkgconfigdir],
|
||||
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
|
||||
+ [with_pkgconfigdir=]pkg_default)
|
||||
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
|
||||
+m4_popdef([pkg_default])
|
||||
+m4_popdef([pkg_description])
|
||||
+]) dnl PKG_INSTALLDIR
|
||||
+
|
||||
+
|
||||
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
|
||||
+# -------------------------
|
||||
+# Substitutes the variable noarch_pkgconfigdir as the location where a
|
||||
+# module should install arch-independent pkg-config .pc files. By
|
||||
+# default the directory is $datadir/pkgconfig, but the default can be
|
||||
+# changed by passing DIRECTORY. The user can override through the
|
||||
+# --with-noarch-pkgconfigdir parameter.
|
||||
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
|
||||
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
|
||||
+m4_pushdef([pkg_description],
|
||||
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
|
||||
+AC_ARG_WITH([noarch-pkgconfigdir],
|
||||
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
|
||||
+ [with_noarch_pkgconfigdir=]pkg_default)
|
||||
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
|
||||
+m4_popdef([pkg_default])
|
||||
+m4_popdef([pkg_description])
|
||||
+]) dnl PKG_NOARCH_INSTALLDIR
|
||||
+
|
||||
+
|
||||
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
|
||||
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
+# -------------------------------------------
|
||||
+# Retrieves the value of the pkg-config variable for the given module.
|
||||
+AC_DEFUN([PKG_CHECK_VAR],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
|
||||
+
|
||||
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
|
||||
+AS_VAR_COPY([$1], [pkg_cv_][$1])
|
||||
+
|
||||
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
|
||||
+])# PKG_CHECK_VAR
|
||||
+
|
||||
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
|
||||
+
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "gdb_bfd.h"
|
||||
#include "gdbcmd.h"
|
||||
#include "observer.h"
|
||||
+#include "elf/external.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
extern void _initialize_elfread (void);
|
||||
@@ -1647,8 +1648,361 @@ build_id_to_filename (struct build_id *b
|
||||
return retval;
|
||||
#include "gdbcore.h"
|
||||
+#include "inferior.h"
|
||||
#include "objfiles.h"
|
||||
#include "observable.h"
|
||||
#include "symfile.h"
|
||||
@@ -697,8 +698,374 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
return result;
|
||||
}
|
||||
|
||||
+#ifdef HAVE_LIBRPM
|
||||
|
@ -118,6 +321,9 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (is_target_filename (filename))
|
||||
+ return 0;
|
||||
+
|
||||
+ if (filename[0] != '/')
|
||||
+ {
|
||||
+ warning (_("Ignoring non-absolute filename: <%s>"), filename);
|
||||
|
@ -146,13 +352,13 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (!((headerFormat_p = dlsym (h, "headerFormat"))
|
||||
+ && (rpmReadConfigFiles_p = dlsym (h, "rpmReadConfigFiles"))
|
||||
+ && (rpmdbFreeIterator_p = dlsym (h, "rpmdbFreeIterator"))
|
||||
+ && (rpmdbNextIterator_p = dlsym (h, "rpmdbNextIterator"))
|
||||
+ && (rpmtsCreate_p = dlsym (h, "rpmtsCreate"))
|
||||
+ && (rpmtsFree_p = dlsym (h, "rpmtsFree"))
|
||||
+ && (rpmtsInitIterator_p = dlsym (h, "rpmtsInitIterator"))))
|
||||
+ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat"))
|
||||
+ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles"))
|
||||
+ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator"))
|
||||
+ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator"))
|
||||
+ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate"))
|
||||
+ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree"))
|
||||
+ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator"))))
|
||||
+ {
|
||||
+ warning (_("Opened library \"%s\" is incompatible (%s), "
|
||||
+ "missing debuginfos notifications will not be displayed"),
|
||||
|
@ -208,12 +414,12 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
|
||||
+ {
|
||||
+ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
|
||||
+ s2 = memrchr (debuginfo, '-', s - debuginfo);
|
||||
+ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
|
||||
+ }
|
||||
+ if (s2)
|
||||
+ {
|
||||
+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
|
||||
+ s2 = memrchr (debuginfo, '-', s2 - debuginfo);
|
||||
+ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
|
||||
+ }
|
||||
+ if (!s2)
|
||||
+ {
|
||||
|
@ -236,7 +442,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+
|
||||
+ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
|
||||
+ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
|
||||
+ mi_debuginfo = rpmtsInitIterator_p (ts, RPMDBI_LABEL, debuginfo, 0);
|
||||
+ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
|
||||
+ xfree (debuginfo);
|
||||
+ if (mi_debuginfo)
|
||||
+ {
|
||||
|
@ -258,8 +464,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+
|
||||
+ /* Base package name for `debuginfo-install'. We do not use the
|
||||
+ `yum' command directly as the line
|
||||
+ yum --disablerepo='*' --enablerepo='*debug*' \
|
||||
+ install NAME-debuginfo.ARCH
|
||||
+ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
|
||||
+ would be more complicated than just:
|
||||
+ debuginfo-install NAME-VERSION-RELEASE.ARCH
|
||||
+ Do not supply the rpm base name (derived from .src.rpm name) as
|
||||
|
@ -288,7 +493,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+
|
||||
+ *slot = debuginfo;
|
||||
+
|
||||
+ missing_rpm = xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
|
||||
+ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
|
||||
+ strcpy (missing_rpm->rpm, debuginfo);
|
||||
+ missing_rpm->next = missing_rpm_list;
|
||||
+ missing_rpm_list = missing_rpm;
|
||||
|
@ -307,10 +512,10 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+missing_rpm_list_compar (const char *const *ap, const char *const *bp)
|
||||
+static bool
|
||||
+missing_rpm_list_compar (const char *ap, const char *bp)
|
||||
+{
|
||||
+ return strcoll (*ap, *bp);
|
||||
+ return strcoll (ap, bp) < 0;
|
||||
+}
|
||||
+
|
||||
+/* It returns a NULL-terminated array of strings needing to be FREEd. It may
|
||||
|
@ -319,36 +524,50 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+static void
|
||||
+missing_rpm_list_print (void)
|
||||
+{
|
||||
+ char **array, **array_iter;
|
||||
+ struct missing_rpm *list_iter;
|
||||
+ struct cleanup *cleanups;
|
||||
+
|
||||
+ if (missing_rpm_list_entries == 0)
|
||||
+ return;
|
||||
+
|
||||
+ array = xmalloc (sizeof (*array) * missing_rpm_list_entries);
|
||||
+ cleanups = make_cleanup (xfree, array);
|
||||
+ std::vector<const char *> array (missing_rpm_list_entries);
|
||||
+ size_t idx = 0;
|
||||
+
|
||||
+ array_iter = array;
|
||||
+ for (list_iter = missing_rpm_list; list_iter != NULL;
|
||||
+ list_iter = list_iter->next)
|
||||
+ {
|
||||
+ *array_iter++ = list_iter->rpm;
|
||||
+ array[idx++] = list_iter->rpm;
|
||||
+ }
|
||||
+ gdb_assert (array_iter == array + missing_rpm_list_entries);
|
||||
+ gdb_assert (idx == missing_rpm_list_entries);
|
||||
+
|
||||
+ qsort (array, missing_rpm_list_entries, sizeof (*array),
|
||||
+ (int (*) (const void *, const void *)) missing_rpm_list_compar);
|
||||
+ std::sort (array.begin (), array.end (), missing_rpm_list_compar);
|
||||
+
|
||||
+ /* We zero out the number of missing RPMs here because of a nasty
|
||||
+ bug (see RHBZ 1801974).
|
||||
+
|
||||
+ When we call 'puts_unfiltered' below, if pagination is on and if
|
||||
+ the number of missing RPMs is big enough to trigger pagination,
|
||||
+ we will end up in an infinite recursion. The call chain looks
|
||||
+ like this:
|
||||
+
|
||||
+ missing_rpm_list_print -> puts_unfiltered -> fputs_maybe_filtered
|
||||
+ -> prompt_for_continue -> display_gdb_prompt ->
|
||||
+ debug_flush_missing -> missing_rpm_list_print ...
|
||||
+
|
||||
+ For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero
|
||||
+ *before* calling any print function. */
|
||||
+ missing_rpm_list_entries = 0;
|
||||
+
|
||||
+ printf_unfiltered (_("Missing separate debuginfos, use: %s"),
|
||||
+#ifdef DNF_DEBUGINFO_INSTALL
|
||||
+ "dnf "
|
||||
+#endif
|
||||
+ "debuginfo-install");
|
||||
+ for (array_iter = array; array_iter < array + missing_rpm_list_entries;
|
||||
+ array_iter++)
|
||||
+ for (const char *el : array)
|
||||
+ {
|
||||
+ putchar_unfiltered (' ');
|
||||
+ puts_unfiltered (*array_iter);
|
||||
+ puts_unfiltered (" ");
|
||||
+ puts_unfiltered (el);
|
||||
+ }
|
||||
+ putchar_unfiltered ('\n');
|
||||
+ puts_unfiltered ("\n");
|
||||
+
|
||||
+ while (missing_rpm_list != NULL)
|
||||
+ {
|
||||
|
@ -356,9 +575,6 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+ missing_rpm_list = list_iter->next;
|
||||
+ xfree (list_iter);
|
||||
+ }
|
||||
+ missing_rpm_list_entries = 0;
|
||||
+
|
||||
+ do_cleanups (cleanups);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
|
@ -399,11 +615,11 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+
|
||||
/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
|
||||
- Try to install the hash file ...
|
||||
+ yum --disablerepo='*' --enablerepo='*debug*' install ...
|
||||
+ yum --enablerepo='*debug*' install ...
|
||||
avoidance. */
|
||||
|
||||
struct missing_filepair
|
||||
@@ -1702,11 +2056,17 @@ missing_filepair_change (void)
|
||||
@@ -752,11 +1119,17 @@ missing_filepair_change (void)
|
||||
/* All their memory came just from missing_filepair_OBSTACK. */
|
||||
missing_filepair_hash = NULL;
|
||||
}
|
||||
|
@ -421,7 +637,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
missing_filepair_change ();
|
||||
}
|
||||
|
||||
@@ -1773,14 +2133,35 @@ debug_print_missing (const char *binary,
|
||||
@@ -823,14 +1196,38 @@ debug_print_missing (const char *binary, const char *debug)
|
||||
|
||||
*slot = missing_filepair;
|
||||
|
||||
|
@ -430,17 +646,16 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+#ifdef HAVE_LIBRPM
|
||||
+ if (missing_exec == MISSING_EXEC_NOT_TRIED)
|
||||
+ {
|
||||
+ char *exec_filename;
|
||||
+ const char *execfilename = get_exec_file (0);
|
||||
|
||||
- fprintf_unfiltered (gdb_stdlog,
|
||||
- _("Missing separate debuginfo for %s\n"), binary);
|
||||
- if (debug != NULL)
|
||||
- fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
|
||||
- debug);
|
||||
+ exec_filename = get_exec_file (0);
|
||||
+ if (exec_filename != NULL)
|
||||
+ if (execfilename != NULL)
|
||||
+ {
|
||||
+ if (missing_rpm_enlist (exec_filename) == 0)
|
||||
+ if (missing_rpm_enlist (execfilename) == 0)
|
||||
+ missing_exec = MISSING_EXEC_NOT_FOUND;
|
||||
+ else
|
||||
+ missing_exec = MISSING_EXEC_ENLISTED;
|
||||
|
@ -458,239 +673,22 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
|
|||
+ _("Missing separate debuginfo for %s\n"), binary);
|
||||
+ if (debug != NULL)
|
||||
+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
|
||||
+ "yum --disablerepo='*' --enablerepo='*debug*'"
|
||||
+ " install", debug);
|
||||
+#ifdef DNF_DEBUGINFO_INSTALL
|
||||
+ "dnf"
|
||||
+#else
|
||||
+ "yum"
|
||||
+#endif
|
||||
+ " --enablerepo='*debug*' install", debug);
|
||||
+ }
|
||||
}
|
||||
|
||||
static char *
|
||||
Index: gdb-7.4.50.20120602/gdb/symfile.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/symfile.h 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/symfile.h 2012-06-02 21:08:23.499221877 +0200
|
||||
@@ -621,6 +621,8 @@ extern struct build_id *build_id_addr_ge
|
||||
extern char *build_id_to_filename (struct build_id *build_id,
|
||||
char **link_return, int add_debug_suffix);
|
||||
extern void debug_print_missing (const char *binary, const char *debug);
|
||||
+extern void debug_flush_missing (void);
|
||||
+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
|
||||
|
||||
/* From dwarf2read.c */
|
||||
|
||||
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/gdb.exp 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp 2012-06-02 21:08:23.510221873 +0200
|
||||
@@ -1388,7 +1388,7 @@ proc default_gdb_start { } {
|
||||
warning "Couldn't set the width to 0."
|
||||
}
|
||||
}
|
||||
- # Turn off the missing warnings as the testsuite does not expect it.
|
||||
+ # Turn off the missing RPMs warnings as the testsuite does not expect it.
|
||||
send_gdb "set build-id-verbose 0\n"
|
||||
gdb_expect 10 {
|
||||
-re "$gdb_prompt $" {
|
||||
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/mi-support.exp 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp 2012-06-02 21:08:23.523221869 +0200
|
||||
@@ -213,7 +213,7 @@ proc default_mi_gdb_start { args } {
|
||||
warning "Couldn't set the width to 0."
|
||||
}
|
||||
}
|
||||
- # Turn off the missing warnings as the testsuite does not expect it.
|
||||
+ # Turn off the missing RPMs warnings as the testsuite does not expect it.
|
||||
send_gdb "190-gdb-set build-id-verbose 0\n"
|
||||
gdb_expect 10 {
|
||||
-re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
|
||||
Index: gdb-7.4.50.20120602/gdb/tui/tui-interp.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/tui/tui-interp.c 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/tui/tui-interp.c 2012-06-02 21:08:23.524221869 +0200
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "tui/tui.h"
|
||||
#include "tui/tui-io.h"
|
||||
#include "exceptions.h"
|
||||
+#include "symfile.h"
|
||||
|
||||
/* Set to 1 when the TUI mode must be activated when we first start
|
||||
gdb. */
|
||||
Index: gdb-7.4.50.20120602/gdb/aclocal.m4
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/aclocal.m4 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/aclocal.m4 2012-06-02 21:08:23.545221858 +0200
|
||||
@@ -11,6 +11,164 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
+# serial 1 (pkg-config-0.24)
|
||||
+#
|
||||
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
+#
|
||||
+# 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.
|
||||
+#
|
||||
+# As a special exception to the GNU General Public License, if you
|
||||
+# distribute this file as part of a program that contains a
|
||||
+# configuration script generated by Autoconf, you may include it under
|
||||
+# the same distribution terms that you use for the rest of that program.
|
||||
+
|
||||
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
+# ----------------------------------
|
||||
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
||||
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
|
||||
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
|
||||
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
|
||||
+
|
||||
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
+fi
|
||||
+if test -n "$PKG_CONFIG"; then
|
||||
+ _pkg_min_version=m4_default([$1], [0.9.0])
|
||||
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ else
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ PKG_CONFIG=""
|
||||
+ fi
|
||||
+fi[]dnl
|
||||
+])# PKG_PROG_PKG_CONFIG
|
||||
+
|
||||
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
+#
|
||||
+# Check to see whether a particular set of modules exists. Similar
|
||||
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
+#
|
||||
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
+# only at the first occurence in configure.ac, so if the first place
|
||||
+# it's called might be skipped (such as if it is within an "if", you
|
||||
+# have to call PKG_CHECK_EXISTS manually
|
||||
+# --------------------------------------------------------------
|
||||
+AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+if test -n "$PKG_CONFIG" && \
|
||||
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
+ m4_default([$2], [:])
|
||||
+m4_ifvaln([$3], [else
|
||||
+ $3])dnl
|
||||
+fi])
|
||||
+
|
||||
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
+# ---------------------------------------------
|
||||
+m4_define([_PKG_CONFIG],
|
||||
+[if test -n "$$1"; then
|
||||
+ pkg_cv_[]$1="$$1"
|
||||
+ elif test -n "$PKG_CONFIG"; then
|
||||
+ PKG_CHECK_EXISTS([$3],
|
||||
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
||||
+ [pkg_failed=yes])
|
||||
+ else
|
||||
+ pkg_failed=untried
|
||||
+fi[]dnl
|
||||
+])# _PKG_CONFIG
|
||||
+
|
||||
+# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+# -----------------------------
|
||||
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
+ _pkg_short_errors_supported=yes
|
||||
+else
|
||||
+ _pkg_short_errors_supported=no
|
||||
+fi[]dnl
|
||||
+])# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+
|
||||
+
|
||||
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
+# [ACTION-IF-NOT-FOUND])
|
||||
+#
|
||||
+#
|
||||
+# Note that if there is a possibility the first call to
|
||||
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
+#
|
||||
+#
|
||||
+# --------------------------------------------------------------
|
||||
+AC_DEFUN([PKG_CHECK_MODULES],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
+
|
||||
+pkg_failed=no
|
||||
+AC_MSG_CHECKING([for $1])
|
||||
+
|
||||
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
+
|
||||
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
+and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
+See the pkg-config man page for more details.])
|
||||
+
|
||||
+if test $pkg_failed = yes; then
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+ if test $_pkg_short_errors_supported = yes; then
|
||||
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
||||
+ else
|
||||
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
||||
+ fi
|
||||
+ # Put the nasty error message in config.log where it belongs
|
||||
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
+
|
||||
+ m4_default([$4], [AC_MSG_ERROR(
|
||||
+[Package requirements ($2) were not met:
|
||||
+
|
||||
+$$1_PKG_ERRORS
|
||||
+
|
||||
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
+installed software in a non-standard prefix.
|
||||
+
|
||||
+_PKG_TEXT])
|
||||
+ ])
|
||||
+elif test $pkg_failed = untried; then
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ m4_default([$4], [AC_MSG_FAILURE(
|
||||
+[The pkg-config script could not be found or is too old. Make sure it
|
||||
+is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
+path to pkg-config.
|
||||
+
|
||||
+_PKG_TEXT
|
||||
+
|
||||
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
|
||||
+ ])
|
||||
+else
|
||||
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ $3
|
||||
+fi[]dnl
|
||||
+])# PKG_CHECK_MODULES
|
||||
+
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
|
||||
Index: gdb-7.4.50.20120602/gdb/config.in
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/config.in 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/config.in 2012-06-02 21:08:23.546221859 +0200
|
||||
@@ -36,6 +36,9 @@
|
||||
/* Define to BFD's default target vector. */
|
||||
#undef DEFAULT_BFD_VEC
|
||||
/* See build-id.h. */
|
||||
diff --git a/gdb/config.in b/gdb/config.in
|
||||
--- a/gdb/config.in
|
||||
+++ b/gdb/config.in
|
||||
@@ -39,6 +39,9 @@
|
||||
/* Handle .ctf type-info sections */
|
||||
#undef ENABLE_LIBCTF
|
||||
|
||||
+/* librpm version specific library name to dlopen. */
|
||||
+#undef DLOPEN_LIBRPM
|
||||
|
@ -698,9 +696,9 @@ Index: gdb-7.4.50.20120602/gdb/config.in
|
|||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
@@ -216,6 +219,9 @@
|
||||
/* Define if Python 2.7 is being used. */
|
||||
#undef HAVE_LIBPYTHON2_7
|
||||
@@ -247,6 +250,9 @@
|
||||
/* Define if you have the mpfr library. */
|
||||
#undef HAVE_LIBMPFR
|
||||
|
||||
+/* Define if librpm library is being used. */
|
||||
+#undef HAVE_LIBRPM
|
||||
|
@ -708,12 +706,11 @@ Index: gdb-7.4.50.20120602/gdb/config.in
|
|||
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
|
||||
#undef HAVE_LIBUNWIND_IA64_H
|
||||
|
||||
Index: gdb-7.4.50.20120602/gdb/configure
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/configure 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/configure 2012-06-02 21:20:53.245838121 +0200
|
||||
@@ -680,6 +680,11 @@ REPORT_BUGS_TO
|
||||
PKGVERSION
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -769,6 +769,11 @@ PKG_CONFIG
|
||||
HAVE_NATIVE_GCORE_TARGET
|
||||
TARGET_OBS
|
||||
subdirs
|
||||
+RPM_LIBS
|
||||
|
@ -724,50 +721,42 @@ Index: gdb-7.4.50.20120602/gdb/configure
|
|||
GDB_DATADIR
|
||||
DEBUGDIR
|
||||
MAKEINFO_EXTRA_FLAGS
|
||||
@@ -780,6 +785,7 @@ with_gdb_datadir
|
||||
@@ -873,6 +878,7 @@ with_gdb_datadir
|
||||
with_relocated_sources
|
||||
with_auto_load_dir
|
||||
with_auto_load_safe_path
|
||||
+with_rpm
|
||||
enable_targets
|
||||
enable_64_bit_bfd
|
||||
enable_gdbcli
|
||||
@@ -825,6 +831,11 @@ CPPFLAGS
|
||||
CPP
|
||||
MAKEINFO
|
||||
MAKEINFOFLAGS
|
||||
+PKG_CONFIG
|
||||
+PKG_CONFIG_PATH
|
||||
+PKG_CONFIG_LIBDIR
|
||||
enable_gdbmi
|
||||
@@ -949,6 +955,8 @@ PKG_CONFIG_PATH
|
||||
PKG_CONFIG_LIBDIR
|
||||
DEBUGINFOD_CFLAGS
|
||||
DEBUGINFOD_LIBS
|
||||
+RPM_CFLAGS
|
||||
+RPM_LIBS
|
||||
YACC
|
||||
YFLAGS
|
||||
XMKMF'
|
||||
@@ -1494,6 +1505,8 @@ Optional Packages:
|
||||
[--with-auto-load-dir]
|
||||
--without-auto-load-safe-path
|
||||
@@ -1621,6 +1629,8 @@ Optional Packages:
|
||||
do not restrict auto-loaded files locations
|
||||
--with-debuginfod Enable debuginfo lookups with debuginfod
|
||||
(auto/yes/no)
|
||||
+ --with-rpm query rpm database for missing debuginfos (yes/no,
|
||||
+ def. auto=librpm.so)
|
||||
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
|
||||
--with-curses use the curses library instead of the termcap
|
||||
library
|
||||
@@ -1535,6 +1548,13 @@ Some influential environment variables:
|
||||
MAKEINFO Parent configure detects if it is of sufficient version.
|
||||
MAKEINFOFLAGS
|
||||
Parameters for MAKEINFO.
|
||||
+ PKG_CONFIG path to pkg-config utility
|
||||
+ PKG_CONFIG_PATH
|
||||
+ directories to add to pkg-config's search path
|
||||
+ PKG_CONFIG_LIBDIR
|
||||
+ path overriding pkg-config's built-in search path
|
||||
@@ -1702,6 +1712,8 @@ Some influential environment variables:
|
||||
C compiler flags for DEBUGINFOD, overriding pkg-config
|
||||
DEBUGINFOD_LIBS
|
||||
linker flags for DEBUGINFOD, overriding pkg-config
|
||||
+ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
|
||||
+ RPM_LIBS linker flags for RPM, overriding pkg-config
|
||||
YACC The `Yet Another C Compiler' implementation to use. Defaults to
|
||||
the first program found out of: `bison -y', `byacc', `yacc'.
|
||||
YFLAGS The list of arguments that will be passed by default to $YACC.
|
||||
@@ -5015,6 +5035,491 @@ _ACEOF
|
||||
YACC The `Yet Another Compiler Compiler' implementation to use.
|
||||
Defaults to the first program found out of: `bison -y', `byacc',
|
||||
`yacc'.
|
||||
@@ -6666,6 +6678,494 @@ _ACEOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
|
||||
$as_echo "$with_auto_load_safe_path" >&6; }
|
||||
|
||||
|
@ -1002,6 +991,7 @@ Index: gdb-7.4.50.20120602/gdb/configure
|
|||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
+ if test -n "$ac_tool_prefix"; then
|
||||
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
|
||||
|
@ -1130,6 +1120,7 @@ Index: gdb-7.4.50.20120602/gdb/configure
|
|||
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
+ test $ac_status = 0; }; then
|
||||
+ pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
|
||||
+ test "x$?" != "x0" && pkg_failed=yes
|
||||
+else
|
||||
+ pkg_failed=yes
|
||||
+fi
|
||||
|
@ -1146,6 +1137,7 @@ Index: gdb-7.4.50.20120602/gdb/configure
|
|||
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
+ test $ac_status = 0; }; then
|
||||
+ pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
|
||||
+ test "x$?" != "x0" && pkg_failed=yes
|
||||
+else
|
||||
+ pkg_failed=yes
|
||||
+fi
|
||||
|
@ -1165,9 +1157,9 @@ Index: gdb-7.4.50.20120602/gdb/configure
|
|||
+ _pkg_short_errors_supported=no
|
||||
+fi
|
||||
+ if test $_pkg_short_errors_supported = yes; then
|
||||
+ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
|
||||
+ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1`
|
||||
+ else
|
||||
+ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
|
||||
+ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1`
|
||||
+ fi
|
||||
+ # Put the nasty error message in config.log where it belongs
|
||||
+ echo "$RPM_PKG_ERRORS" >&5
|
||||
|
@ -1259,11 +1251,10 @@ Index: gdb-7.4.50.20120602/gdb/configure
|
|||
|
||||
|
||||
subdirs="$subdirs testsuite"
|
||||
Index: gdb-7.4.50.20120602/gdb/configure.ac
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/configure.ac 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/configure.ac 2012-06-02 21:08:23.560221855 +0200
|
||||
@@ -166,6 +166,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
|
||||
diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
--- a/gdb/configure.ac
|
||||
+++ b/gdb/configure.ac
|
||||
@@ -143,6 +143,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
|
||||
[Directories safe to hold auto-loaded files.])
|
||||
AC_MSG_RESULT([$with_auto_load_safe_path])
|
||||
|
||||
|
@ -1463,16 +1454,46 @@ Index: gdb-7.4.50.20120602/gdb/configure.ac
|
|||
AC_CONFIG_SUBDIRS(testsuite)
|
||||
|
||||
# Check whether to support alternative target configurations
|
||||
Index: gdb-7.4.50.20120602/gdb/corelow.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/corelow.c 2012-06-02 21:08:08.651227347 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/corelow.c 2012-06-02 21:08:23.561221855 +0200
|
||||
@@ -317,7 +317,7 @@ build_id_locate_exec (int from_tty)
|
||||
symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
|
||||
diff --git a/gdb/event-top.c b/gdb/event-top.c
|
||||
--- a/gdb/event-top.c
|
||||
+++ b/gdb/event-top.c
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "gdbsupport/gdb_select.h"
|
||||
#include "gdbsupport/gdb-sigmask.h"
|
||||
#include "async-event.h"
|
||||
+#include "symfile.h"
|
||||
|
||||
/* readline include files. */
|
||||
#include "readline/readline.h"
|
||||
@@ -364,6 +365,8 @@ display_gdb_prompt (const char *new_prompt)
|
||||
/* Reset the nesting depth used when trace-commands is set. */
|
||||
reset_command_nest_depth ();
|
||||
|
||||
+ debug_flush_missing ();
|
||||
+
|
||||
/* Do not call the python hook on an explicit prompt change as
|
||||
passed to this function, as this forms a secondary/local prompt,
|
||||
IE, displayed but not set. */
|
||||
@@ -773,7 +776,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
|
||||
command_handler (cmd);
|
||||
|
||||
if (ui->prompt_state != PROMPTED)
|
||||
- display_gdb_prompt (0);
|
||||
+ {
|
||||
+ debug_flush_missing ();
|
||||
+ display_gdb_prompt (0);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
- debug_print_missing (_("the main executable file"), build_id_filename);
|
||||
+ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename);
|
||||
}
|
||||
|
||||
do_cleanups (back_to);
|
||||
diff --git a/gdb/symfile.h b/gdb/symfile.h
|
||||
--- a/gdb/symfile.h
|
||||
+++ b/gdb/symfile.h
|
||||
@@ -560,6 +560,7 @@ extern void generic_load (const char *args, int from_tty);
|
||||
/* build-id support. */
|
||||
extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
|
||||
extern void debug_print_missing (const char *binary, const char *debug);
|
||||
+extern void debug_flush_missing (void);
|
||||
#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
|
||||
|
||||
/* From dwarf2read.c */
|
||||
|
|
|
@ -1,18 +1,32 @@
|
|||
--- gdb-7.4.50.20120120/gdb/solib-svr4.c.orig 2012-03-17 10:23:11.000000000 +0100
|
||||
+++ gdb-7.4.50.20120120/gdb/solib-svr4.c 2012-03-17 10:36:22.265628529 +0100
|
||||
@@ -1228,14 +1228,27 @@ svr4_read_so_list (CORE_ADDR lm, struct
|
||||
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 build_id *build_id;
|
||||
+ struct build_id *build_id = NULL;
|
||||
- struct bfd_build_id *build_id;
|
||||
+ struct bfd_build_id *build_id = NULL;
|
||||
|
||||
strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
|
||||
new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
|
||||
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 (new->so_name, new->so_original_name);
|
||||
strcpy (newobj->so_name, newobj->so_original_name);
|
||||
|
||||
- build_id = build_id_addr_get (new->lm_info->l_ld);
|
||||
- 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.
|
||||
|
@ -26,16 +40,16 @@
|
|||
+ 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 (new->lm_info->l_ld);
|
||||
+ build_id = build_id_addr_get (li->l_ld);
|
||||
if (build_id != NULL)
|
||||
{
|
||||
char *name, *build_id_filename;
|
||||
@@ -1250,23 +1263,7 @@ svr4_read_so_list (CORE_ADDR lm, struct
|
||||
@@ -1362,23 +1375,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
xfree (name);
|
||||
}
|
||||
else
|
||||
- {
|
||||
- debug_print_missing (new->so_name, build_id_filename);
|
||||
- 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
|
||||
|
@ -49,9 +63,175 @@
|
|||
- if (symfile_objfile != NULL
|
||||
- && (symfile_objfile->flags
|
||||
- & OBJF_BUILD_ID_CORE_LOADED) != 0)
|
||||
- new->so_name[0] = 0;
|
||||
- newobj->so_name[0] = 0;
|
||||
- }
|
||||
+ debug_print_missing (new->so_name, build_id_filename);
|
||||
+ 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
|
@ -1,3 +1,11 @@
|
|||
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'.
|
||||
|
@ -6,21 +14,25 @@
|
|||
|
||||
* gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files.
|
||||
|
||||
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.base/gcorebg.c 25 Feb 2007 12:21:20 -0000
|
||||
@@ -0,0 +1,43 @@
|
||||
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[256];
|
||||
+ char buf[1024*2 + 500];
|
||||
+ int gotint;
|
||||
+
|
||||
+ if (argc != 4)
|
||||
+ {
|
||||
|
@ -37,8 +49,10 @@
|
|||
+ if (strcmp (argv[1], "detached") == 0)
|
||||
+ setpgrp ();
|
||||
+ ppid = getppid ();
|
||||
+ sprintf (buf, "sh %s -o %s %d", argv[2], argv[3], (int) ppid);
|
||||
+ 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;
|
||||
+
|
||||
|
@ -48,13 +62,16 @@
|
|||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ fprintf (stderr,"Sleeping as PID %d\n", getpid ());
|
||||
+ sleep (60);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.base/gcorebg.exp 25 Feb 2007 12:21:20 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -81,14 +98,14 @@
|
|||
+# accessible terminal.
|
||||
+
|
||||
+if ![info exists GCORE] {
|
||||
+ set GCORE "${srcdir}/../gdb_gcore.sh"
|
||||
+ set GCORE "[standard_output_file ../../../../gcore]"
|
||||
+}
|
||||
+verbose "using GCORE = $GCORE" 2
|
||||
+
|
||||
+set testfile "gcorebg"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set corefile ${objdir}/${subdir}/${testfile}.test
|
||||
+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
|
||||
|
@ -137,11 +154,11 @@
|
|||
+ pass "Spawning $detached gcore"
|
||||
+ remote_expect target 20 {
|
||||
+ timeout {
|
||||
+ fail "Spawned $detached gcore finished"
|
||||
+ fail "Spawned $detached gcore finished (timeout)"
|
||||
+ remote_exec target "kill -9 -[exp_pid -i $res]"
|
||||
+ return 1
|
||||
+ }
|
||||
+ eof {
|
||||
+ "Saved corefile .*\r\nKilling parent PID " {
|
||||
+ pass "Spawned $detached gcore finished"
|
||||
+ remote_wait target 20
|
||||
+ }
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
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.
|
||||
|
||||
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.arch/powerpc-power6.exp 25 Feb 2007 18:27:39 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -33,7 +42,7 @@ requires too recent GCC.
|
|||
+
|
||||
+set testfile "powerpc-power6"
|
||||
+set srcfile ${testfile}.s
|
||||
+set objfile ${objdir}/${subdir}/${testfile}.o
|
||||
+set objfile [standard_output_file ${testfile}.o]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
|
||||
+ untested "PowerPC prologue tests"
|
||||
|
@ -53,17 +62,19 @@ requires too recent GCC.
|
|||
+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 *f1,f2,f1\r\n.*" "Power6 disassembly daddq"
|
||||
+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 *f1,f2,f1\r\n.*" "Power6 disassembly dsubq"
|
||||
+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 *f1,f2,f1\r\n.*" "Power6 disassembly dmulq"
|
||||
+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 *f1,f2,f1\r\n.*" "Power6 disassembly ddivq"
|
||||
+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,f1\r\n.*" "Power6 disassembly dcmpuq"
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.arch/powerpc-power6.s 25 Feb 2007 18:27:39 -0000
|
||||
+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
|
||||
|
@ -72,12 +83,12 @@ requires too recent GCC.
|
|||
+ .long 0x7c284fec /* dcbzl r8,r9 */
|
||||
+ .long 0xed405834 /* frsqrtes f10,f11 */
|
||||
+ .long 0xec220804 /* dadd f1,f2,f1 */
|
||||
+ .long 0xfc220804 /* daddq f1,f2,f1 */
|
||||
+ .long 0xfc020004 /* daddq f0,f2,f0 */
|
||||
+ .long 0xec220c04 /* dsub f1,f2,f1 */
|
||||
+ .long 0xfc220c04 /* dsubq f1,f2,f1 */
|
||||
+ .long 0xfc020404 /* dsubq f0,f2,f0 */
|
||||
+ .long 0xec220844 /* dmul f1,f2,f1 */
|
||||
+ .long 0xfc220844 /* dmulq f1,f2,f1 */
|
||||
+ .long 0xfc020044 /* dmulq f0,f2,f0 */
|
||||
+ .long 0xec220c44 /* ddiv f1,f2,f1 */
|
||||
+ .long 0xfc220c44 /* ddivq f1,f2,f1 */
|
||||
+ .long 0xfc020444 /* ddivq f0,f2,f0 */
|
||||
+ .long 0xec820d04 /* dcmpu cr1,f2,f1 */
|
||||
+ .long 0xfc820d04 /* dcmpuq cr1,f2,f1 */
|
||||
+ .long 0xfc820504 /* dcmpuq cr1,f2,f0 */
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
2008-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.8pre.
|
||||
Remove the `[' character from the GDB-6.8 default message.
|
||||
|
||||
Index: gdb-7.2.50.20110320/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20110320.orig/gdb/linux-nat.c 2011-03-20 16:59:51.000000000 +0100
|
||||
+++ gdb-7.2.50.20110320/gdb/linux-nat.c 2011-03-20 16:59:51.000000000 +0100
|
||||
@@ -716,7 +716,7 @@ holding the child stopped. Try \"set de
|
||||
remove_breakpoints_pid (GET_PID (inferior_ptid));
|
||||
}
|
||||
|
||||
- if (info_verbose || debug_linux_nat)
|
||||
+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_linux_nat)
|
||||
{
|
||||
target_terminal_ours ();
|
||||
fprintf_filtered (gdb_stdlog,
|
||||
Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c 2011-03-20 16:59:51.000000000 +0100
|
||||
@@ -0,0 +1,57 @@
|
||||
+/* 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 <sys/types.h>
|
||||
+#include <sys/wait.h>
|
||||
+#include <unistd.h>
|
||||
+#include <assert.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+static void func (void)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+int main (void)
|
||||
+{
|
||||
+ pid_t child;
|
||||
+
|
||||
+ child = fork ();
|
||||
+ switch (child)
|
||||
+ {
|
||||
+ case -1:
|
||||
+ abort ();
|
||||
+ case 0:
|
||||
+ func ();
|
||||
+ break;
|
||||
+ default:
|
||||
+ {
|
||||
+/* We do not test the switching to the other fork by GDB `fork 1'. */
|
||||
+#if 0
|
||||
+ pid_t got;
|
||||
+
|
||||
+ got = waitpid (child, NULL, 0);
|
||||
+ assert (got == child);
|
||||
+#endif
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp 2011-03-20 17:12:22.000000000 +0100
|
||||
@@ -0,0 +1,36 @@
|
||||
+# 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 fork-detach
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${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}
|
||||
+
|
||||
+gdb_run_cmd
|
||||
+# `Starting program: .*' prefix is available since gdb-6.7.
|
||||
+gdb_test "" \
|
||||
+ "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
|
||||
+ "Info message caught"
|
|
@ -1,12 +1,20 @@
|
|||
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.
|
||||
|
||||
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c 2008-12-08 22:27:01.000000000 +0100
|
||||
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.
|
||||
+
|
||||
|
@ -179,10 +187,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
|
|||
+
|
||||
+ return 0; /* _exit_ */
|
||||
+}
|
||||
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp 2008-12-08 22:31:01.000000000 +0100
|
||||
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
|
||||
|
@ -209,7 +217,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
|
|||
+
|
||||
+set testfile atomic-seq-threaded
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+foreach opts {{} {compiler=gcc4} {FAIL}} {
|
||||
+ if {$opts eq "FAIL"} {
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
Index: gdb-7.4.50.20120703/gdb/infrun.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/infrun.c 2012-07-03 20:26:25.060940765 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/infrun.c 2012-07-03 20:26:32.808929860 +0200
|
||||
@@ -1591,7 +1591,7 @@ static const char *const scheduler_enums
|
||||
schedlock_step,
|
||||
NULL
|
||||
};
|
||||
-static const char *scheduler_mode = schedlock_off;
|
||||
+static const char *scheduler_mode = schedlock_step;
|
||||
static void
|
||||
show_scheduler_mode (struct ui_file *file, int from_tty,
|
||||
struct cmd_list_element *c, const char *value)
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-console.exp 2012-07-03 20:26:25.060940765 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp 2012-07-03 20:26:32.809929858 +0200
|
||||
@@ -46,6 +46,9 @@ if { [gdb_compile "${srcdir}/${subdir}/
|
||||
|
||||
mi_run_to_main
|
||||
|
||||
+# thread-id=\"all\" vs. thread-id=\"1\" below:
|
||||
+mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
|
||||
+
|
||||
# Next over the hello() call which will produce lots of output
|
||||
mi_gdb_test "220-exec-next" \
|
||||
"220\\^running(\r\n\\*running,thread-id=\"all\")?" \
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi2-console.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi2-console.exp 2012-07-03 20:26:25.060940765 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi2-console.exp 2012-07-03 20:26:32.809929858 +0200
|
||||
@@ -46,6 +46,9 @@ if { [gdb_compile "${srcdir}/${subdir}/
|
||||
|
||||
mi_run_to_main
|
||||
|
||||
+# thread-id=\"all\" vs. thread-id=\"1\" below:
|
||||
+mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
|
||||
+
|
||||
# Next over the hello() call which will produce lots of output
|
||||
mi_gdb_test "220-exec-next" "220\\^running(\r\n)?(\\*running,thread-id=\"all\")?" \
|
||||
"Started step over hello"
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-cli.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2012-07-03 20:26:25.060940765 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-cli.exp 2012-07-03 20:26:32.810929856 +0200
|
||||
@@ -175,7 +175,7 @@ mi_execute_to "exec-continue" "breakpoin
|
||||
# Test that the token is output even for CLI commands
|
||||
# Also test that *stopped includes frame information.
|
||||
mi_gdb_test "34 next" \
|
||||
- ".*34\\\^running.*\\*running,thread-id=\"all\"" \
|
||||
+ ".*34\\\^running.*\\*running,thread-id=\"1\"" \
|
||||
"34 next: run"
|
||||
|
||||
if {!$async} {
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-logging.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2012-06-29 00:11:23.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-logging.exp 2012-07-03 20:29:03.573717651 +0200
|
||||
@@ -56,7 +56,7 @@ close $chan
|
||||
|
||||
set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
|
||||
|
||||
-if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
|
||||
+if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
|
||||
pass "Log file contents"
|
||||
} else {
|
||||
fail "Log file contents"
|
||||
@@ -79,7 +79,7 @@ set chan [open $milogfile]
|
||||
set logcontent [read $chan]
|
||||
close $chan
|
||||
|
||||
-if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
|
||||
+if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
|
||||
pass "Redirect log file contents"
|
||||
} else {
|
||||
fail "Redirect log file contents"
|
|
@ -1,204 +0,0 @@
|
|||
2007-06-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* inferior.h (enum resume_step): New definition.
|
||||
(resume): Change STEP parameter type to ENUM RESUME_STEP.
|
||||
* infrun.c (resume): Likewise. Extend debug printing of the STEP
|
||||
parameter. Lock the scheduler only for intentional stepping.
|
||||
(proceed): Replace the variable ONESTEP with tristate RESUME_STEP.
|
||||
Set the third RESUME_STEP state according to BPSTAT_SHOULD_STEP.
|
||||
(currently_stepping): Change the return type to ENUM RESUME_STEP.
|
||||
Return RESUME_STEP_NEEDED if it is just due to BPSTAT_SHOULD_STEP.
|
||||
* linux-nat.c (select_singlestep_lwp_callback): Do not focus on
|
||||
the software watchpoint events.
|
||||
* linux-nat.h (struct lwp_info): Redeclare STEP as ENUM RESUME_STEP.
|
||||
|
||||
2007-10-19 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* infrun.c (proceed): RESUME_STEP initialized for non-stepping.
|
||||
RESUME_STEP set according to STEP only at the end of the function.
|
||||
|
||||
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.8pre.
|
||||
|
||||
Index: gdb-7.4.50.20120714/gdb/inferior.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120714.orig/gdb/inferior.h 2012-06-13 20:15:05.000000000 +0200
|
||||
+++ gdb-7.4.50.20120714/gdb/inferior.h 2012-07-14 23:21:01.795161794 +0200
|
||||
@@ -159,7 +159,15 @@ extern void reopen_exec_file (void);
|
||||
/* The `resume' routine should only be called in special circumstances.
|
||||
Normally, use `proceed', which handles a lot of bookkeeping. */
|
||||
|
||||
-extern void resume (int, enum gdb_signal);
|
||||
+enum resume_step
|
||||
+ {
|
||||
+ /* currently_stepping () should return non-zero for non-continue. */
|
||||
+ RESUME_STEP_CONTINUE = 0,
|
||||
+ RESUME_STEP_USER, /* Stepping is intentional by the user. */
|
||||
+ RESUME_STEP_NEEDED /* Stepping only for software watchpoints. */
|
||||
+ };
|
||||
+
|
||||
+extern void resume (enum resume_step, enum gdb_signal);
|
||||
|
||||
extern ptid_t user_visible_resume_ptid (int step);
|
||||
|
||||
Index: gdb-7.4.50.20120714/gdb/infrun.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120714.orig/gdb/infrun.c 2012-07-01 12:37:04.000000000 +0200
|
||||
+++ gdb-7.4.50.20120714/gdb/infrun.c 2012-07-14 23:21:01.800161767 +0200
|
||||
@@ -79,7 +79,7 @@ static int follow_fork (void);
|
||||
static void set_schedlock_func (char *args, int from_tty,
|
||||
struct cmd_list_element *c);
|
||||
|
||||
-static int currently_stepping (struct thread_info *tp);
|
||||
+static enum resume_step currently_stepping (struct thread_info *tp);
|
||||
|
||||
static int currently_stepping_or_nexting_callback (struct thread_info *tp,
|
||||
void *data);
|
||||
@@ -1672,7 +1672,8 @@ user_visible_resume_ptid (int step)
|
||||
}
|
||||
else if ((scheduler_mode == schedlock_on)
|
||||
|| (scheduler_mode == schedlock_step
|
||||
- && (step || singlestep_breakpoints_inserted_p)))
|
||||
+ && (step == RESUME_STEP_USER
|
||||
+ || singlestep_breakpoints_inserted_p)))
|
||||
{
|
||||
/* User-settable 'scheduler' mode requires solo thread resume. */
|
||||
resume_ptid = inferior_ptid;
|
||||
@@ -1690,7 +1691,7 @@ user_visible_resume_ptid (int step)
|
||||
STEP nonzero if we should step (zero to continue instead).
|
||||
SIG is the signal to give the inferior (zero for none). */
|
||||
void
|
||||
-resume (int step, enum gdb_signal sig)
|
||||
+resume (enum resume_step step, enum gdb_signal sig)
|
||||
{
|
||||
int should_resume = 1;
|
||||
struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
|
||||
@@ -1723,9 +1724,13 @@ resume (int step, enum gdb_signal sig)
|
||||
|
||||
if (debug_infrun)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
- "infrun: resume (step=%d, signal=%d), "
|
||||
+ "infrun: resume (step=%s, signal=%d), "
|
||||
"trap_expected=%d, current thread [%s] at %s\n",
|
||||
- step, sig, tp->control.trap_expected,
|
||||
+ (step == RESUME_STEP_CONTINUE
|
||||
+ ? "RESUME_STEP_CONTINUE"
|
||||
+ : (step == RESUME_STEP_USER ? "RESUME_STEP_USER"
|
||||
+ : "RESUME_STEP_NEEDED")),
|
||||
+ sig, tp->control.trap_expected,
|
||||
target_pid_to_str (inferior_ptid),
|
||||
paddress (gdbarch, pc));
|
||||
|
||||
@@ -2102,7 +2107,7 @@ proceed (CORE_ADDR addr, enum gdb_signal
|
||||
struct thread_info *tp;
|
||||
CORE_ADDR pc;
|
||||
struct address_space *aspace;
|
||||
- int oneproc = 0;
|
||||
+ enum resume_step resume_step = RESUME_STEP_CONTINUE;
|
||||
|
||||
/* If we're stopped at a fork/vfork, follow the branch set by the
|
||||
"set follow-fork-mode" command; otherwise, we'll just proceed
|
||||
@@ -2142,13 +2147,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
|
||||
actually be executing the breakpoint insn anyway.
|
||||
We'll be (un-)executing the previous instruction. */
|
||||
|
||||
- oneproc = 1;
|
||||
+ resume_step = RESUME_STEP_USER;
|
||||
else if (gdbarch_single_step_through_delay_p (gdbarch)
|
||||
&& gdbarch_single_step_through_delay (gdbarch,
|
||||
get_current_frame ()))
|
||||
/* We stepped onto an instruction that needs to be stepped
|
||||
again before re-inserting the breakpoint, do so. */
|
||||
- oneproc = 1;
|
||||
+ resume_step = RESUME_STEP_USER;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2179,13 +2184,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
|
||||
is required it returns TRUE and sets the current thread to
|
||||
the old thread. */
|
||||
if (prepare_to_proceed (step))
|
||||
- oneproc = 1;
|
||||
+ resume_step = RESUME_STEP_USER;
|
||||
}
|
||||
|
||||
/* prepare_to_proceed may change the current thread. */
|
||||
tp = inferior_thread ();
|
||||
|
||||
- if (oneproc)
|
||||
+ if (resume_step == RESUME_STEP_USER)
|
||||
{
|
||||
tp->control.trap_expected = 1;
|
||||
/* If displaced stepping is enabled, we can step over the
|
||||
@@ -2272,8 +2277,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
|
||||
/* Reset to normal state. */
|
||||
init_infwait_state ();
|
||||
|
||||
+ if (step)
|
||||
+ resume_step = RESUME_STEP_USER;
|
||||
+ if (resume_step == RESUME_STEP_CONTINUE && bpstat_should_step ())
|
||||
+ resume_step = RESUME_STEP_NEEDED;
|
||||
+
|
||||
/* Resume inferior. */
|
||||
- resume (oneproc || step || bpstat_should_step (), tp->suspend.stop_signal);
|
||||
+ resume (resume_step, tp->suspend.stop_signal);
|
||||
|
||||
/* Wait for it to stop (if not standalone)
|
||||
and in any case decode why it stopped, and act accordingly. */
|
||||
@@ -5205,13 +5215,18 @@ process_event_stop_test:
|
||||
|
||||
/* Is thread TP in the middle of single-stepping? */
|
||||
|
||||
-static int
|
||||
+static enum resume_step
|
||||
currently_stepping (struct thread_info *tp)
|
||||
{
|
||||
- return ((tp->control.step_range_end
|
||||
- && tp->control.step_resume_breakpoint == NULL)
|
||||
- || tp->control.trap_expected
|
||||
- || bpstat_should_step ());
|
||||
+ if ((tp->control.step_range_end
|
||||
+ && tp->control.step_resume_breakpoint == NULL)
|
||||
+ || tp->control.trap_expected)
|
||||
+ return RESUME_STEP_USER;
|
||||
+
|
||||
+ if (bpstat_should_step ())
|
||||
+ return RESUME_STEP_NEEDED;
|
||||
+
|
||||
+ return RESUME_STEP_CONTINUE;
|
||||
}
|
||||
|
||||
/* Returns true if any thread *but* the one passed in "data" is in the
|
||||
Index: gdb-7.4.50.20120714/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120714.orig/gdb/linux-nat.c 2012-07-07 14:13:56.000000000 +0200
|
||||
+++ gdb-7.4.50.20120714/gdb/linux-nat.c 2012-07-14 23:21:01.803161750 +0200
|
||||
@@ -2982,7 +2982,11 @@ static int
|
||||
select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
|
||||
{
|
||||
if (lp->last_resume_kind == resume_step
|
||||
- && lp->status != 0)
|
||||
+ && lp->status != 0
|
||||
+ /* We do not focus on software watchpoints as we would not catch
|
||||
+ STEPPING_PAST_SINGLESTEP_BREAKPOINT breakpoints in some other thread
|
||||
+ as they would remain pending due to `Push back breakpoint for %s'. */
|
||||
+ && lp->step == RESUME_STEP_USER)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
Index: gdb-7.4.50.20120714/gdb/linux-nat.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120714.orig/gdb/linux-nat.h 2012-07-06 18:52:20.000000000 +0200
|
||||
+++ gdb-7.4.50.20120714/gdb/linux-nat.h 2012-07-14 23:21:17.414075355 +0200
|
||||
@@ -73,8 +73,8 @@ struct lwp_info
|
||||
/* If non-zero, a pending wait status. */
|
||||
int status;
|
||||
|
||||
- /* Non-zero if we were stepping this LWP. */
|
||||
- int step;
|
||||
+ /* The kind of stepping of this LWP. */
|
||||
+ enum resume_step step;
|
||||
|
||||
/* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data
|
||||
watchpoint trap. */
|
|
@ -1,23 +1,29 @@
|
|||
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/annota1.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/testsuite/gdb.base/annota1.exp 2012-03-16 17:47:33.000000000 +0100
|
||||
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/annota1.exp 2012-06-02 18:27:46.623210711 +0200
|
||||
@@ -45,6 +45,8 @@ gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
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"
|
||||
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/annota3.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/testsuite/gdb.base/annota3.exp 2012-02-28 23:40:48.000000000 +0100
|
||||
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/annota3.exp 2012-06-02 18:28:00.375206457 +0200
|
||||
@@ -45,6 +45,8 @@ gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
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"
|
||||
+
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/staticthreads.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20111219.orig/gdb/testsuite/gdb.threads/staticthreads.exp 2011-12-19 21:07:01.436475201 +0100
|
||||
+++ gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/staticthreads.exp 2011-12-19 22:08:55.444514127 +0100
|
||||
@@ -45,6 +45,13 @@ gdb_test_no_output "set print sevenbit-s
|
||||
# See if the static multi-threaded program runs.
|
||||
|
||||
runto_main
|
||||
+
|
||||
+# See if we get excessive LWP there (patched glibc with unpatched GDB):
|
||||
+# * 2 Thread 135661664 (LWP 3856) main () at threadloop.c:41
|
||||
+# 1 process 3856 main () at threadloop.c:41
|
||||
+
|
||||
+gdb_test "info threads" "^info threads\r\n\[ \t\]*Id\[ \t\]+Target Id\[ \t\]+Frame\[ \t\]*\r\n\[^\r\n\]* Thread \[^\r\n\]*" "info threads on start"
|
||||
+
|
||||
gdb_test "break sem_post"
|
||||
set test "Continue to main's call of sem_post"
|
||||
gdb_test_multiple "continue" "$test" {
|
|
@ -1,703 +0,0 @@
|
|||
http://sourceware.org/ml/gdb-patches/2007-12/msg00397.html
|
||||
|
||||
2007-12-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.arch/i386-interface.S, gdb.arch/i386-interface.exp: New files.
|
||||
|
||||
2008-03-02 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.arch/i386-interface.exp: Fix a testcase race.
|
||||
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.arch/i386-interface.S 22 Dec 2007 19:07:28 -0000
|
||||
@@ -0,0 +1,628 @@
|
||||
+/* 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/>.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@gnu.org
|
||||
+
|
||||
+ This file is part of the gdb testsuite.
|
||||
+
|
||||
+ This file was produced by:
|
||||
+ $ gcj -S interface.java -ggdb2 -Wall -m32
|
||||
+ from the .java file:
|
||||
+ interface Interface
|
||||
+ {
|
||||
+ }
|
||||
+ class Class implements Interface
|
||||
+ {
|
||||
+ }
|
||||
+*/
|
||||
+
|
||||
+ .file "cc28Pp2B.jar"
|
||||
+ .section .debug_abbrev,"",@progbits
|
||||
+.Ldebug_abbrev0:
|
||||
+ .section .debug_info,"",@progbits
|
||||
+.Ldebug_info0:
|
||||
+ .section .debug_line,"",@progbits
|
||||
+.Ldebug_line0:
|
||||
+ .text
|
||||
+.Ltext0:
|
||||
+ .local _MT_Interface
|
||||
+ .comm _MT_Interface,0,4
|
||||
+ .data
|
||||
+ .align 4
|
||||
+ .type _catch_classes_Interface, @object
|
||||
+ .size _catch_classes_Interface, 24
|
||||
+_catch_classes_Interface:
|
||||
+ .zero 24
|
||||
+ .section .rodata
|
||||
+ .align 2
|
||||
+ .type _Utf1, @object
|
||||
+ .size _Utf1, 4
|
||||
+_Utf1:
|
||||
+ .value 36121
|
||||
+ .value 9
|
||||
+ .ascii "Interface"
|
||||
+ .zero 1
|
||||
+.globl _ZN9Interface6class$E
|
||||
+ .data
|
||||
+ .align 32
|
||||
+ .type _ZN9Interface6class$E, @object
|
||||
+ .size _ZN9Interface6class$E, 144
|
||||
+_ZN9Interface6class$E:
|
||||
+ .long _ZTVN4java4lang5ClassE+8
|
||||
+ .long 403000
|
||||
+ .long _Utf1
|
||||
+ .value 1536
|
||||
+ .zero 2
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long _MT_Interface
|
||||
+ .value 0
|
||||
+ .value 6
|
||||
+ .long 0
|
||||
+ .long 4
|
||||
+ .value 0
|
||||
+ .value 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long _catch_classes_Interface
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .value 0
|
||||
+ .byte 1
|
||||
+ .zero 1
|
||||
+ .long 0
|
||||
+ .value 0
|
||||
+ .zero 2
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .hidden _ZN9Interface7class$$E
|
||||
+.globl _ZN9Interface7class$$E
|
||||
+ .section .rodata
|
||||
+ .align 4
|
||||
+ .type _ZN9Interface7class$$E, @object
|
||||
+ .size _ZN9Interface7class$$E, 4
|
||||
+_ZN9Interface7class$$E:
|
||||
+ .long _ZN9Interface6class$E
|
||||
+ .text
|
||||
+ .align 2
|
||||
+.globl _ZN5ClassC1Ev
|
||||
+ .type _ZN5ClassC1Ev, @function
|
||||
+_ZN5ClassC1Ev:
|
||||
+.LFB2:
|
||||
+ pushl %ebp
|
||||
+.LCFI0:
|
||||
+ movl %esp, %ebp
|
||||
+.LCFI1:
|
||||
+ subl $24, %esp
|
||||
+.LCFI2:
|
||||
+.LBB2:
|
||||
+#if 0
|
||||
+ .file 1 "interface.java"
|
||||
+#else
|
||||
+ .file "interface.java"
|
||||
+#endif
|
||||
+ .loc 1 4 0
|
||||
+ movl 8(%ebp), %eax
|
||||
+ movl %eax, -4(%ebp)
|
||||
+ movl -4(%ebp), %eax
|
||||
+ movl %eax, (%esp)
|
||||
+ call _ZN4java4lang6ObjectC1Ev
|
||||
+.LBE2:
|
||||
+ leave
|
||||
+ ret
|
||||
+.LFE2:
|
||||
+ .size _ZN5ClassC1Ev, .-_ZN5ClassC1Ev
|
||||
+ .hidden _ZTVN5ClassE
|
||||
+.globl _ZTVN5ClassE
|
||||
+ .data
|
||||
+ .align 32
|
||||
+ .type _ZTVN5ClassE, @object
|
||||
+ .size _ZTVN5ClassE, 40
|
||||
+_ZTVN5ClassE:
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long _ZN5Class6class$E
|
||||
+ .long 4
|
||||
+ .long _ZN4java4lang6Object8finalizeEJvv
|
||||
+ .long _ZN4java4lang6Object8hashCodeEJiv
|
||||
+ .long _ZN4java4lang6Object6equalsEJbPS1_
|
||||
+ .long _ZN4java4lang6Object8toStringEJPNS0_6StringEv
|
||||
+ .long _ZN4java4lang6Object5cloneEJPS1_v
|
||||
+ .long _ZN4java4lang6Object22throwNoSuchMethodErrorEJvv
|
||||
+ .set .L_ZN5ClassC1Ev0,_ZN5ClassC1Ev
|
||||
+ .section .rodata
|
||||
+ .align 2
|
||||
+ .type _Utf2, @object
|
||||
+ .size _Utf2, 4
|
||||
+_Utf2:
|
||||
+ .value 626
|
||||
+ .value 6
|
||||
+ .ascii "<init>"
|
||||
+ .zero 1
|
||||
+ .align 2
|
||||
+ .type _Utf3, @object
|
||||
+ .size _Utf3, 4
|
||||
+_Utf3:
|
||||
+ .value 39797
|
||||
+ .value 3
|
||||
+ .ascii "()V"
|
||||
+ .zero 1
|
||||
+ .data
|
||||
+ .align 4
|
||||
+ .type _MT_Class, @object
|
||||
+ .size _MT_Class, 20
|
||||
+_MT_Class:
|
||||
+ .long _Utf2
|
||||
+ .long _Utf3
|
||||
+ .value 16384
|
||||
+ .value -1
|
||||
+ .long .L_ZN5ClassC1Ev0
|
||||
+ .long 0
|
||||
+ .align 4
|
||||
+ .type _IF_Class, @object
|
||||
+ .size _IF_Class, 4
|
||||
+_IF_Class:
|
||||
+ .long _ZN9Interface6class$E
|
||||
+ .align 4
|
||||
+ .type _catch_classes_Class, @object
|
||||
+ .size _catch_classes_Class, 24
|
||||
+_catch_classes_Class:
|
||||
+ .zero 24
|
||||
+ .section .rodata
|
||||
+ .align 2
|
||||
+ .type _Utf4, @object
|
||||
+ .size _Utf4, 4
|
||||
+_Utf4:
|
||||
+ .value 47448
|
||||
+ .value 5
|
||||
+ .ascii "Class"
|
||||
+ .zero 1
|
||||
+.globl _ZN5Class6class$E
|
||||
+ .data
|
||||
+ .align 32
|
||||
+ .type _ZN5Class6class$E, @object
|
||||
+ .size _ZN5Class6class$E, 144
|
||||
+_ZN5Class6class$E:
|
||||
+ .long _ZTVN4java4lang5ClassE+8
|
||||
+ .long 403000
|
||||
+ .long _Utf4
|
||||
+ .value 32
|
||||
+ .zero 2
|
||||
+ .long _ZN4java4lang6Object6class$E
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long _MT_Class
|
||||
+ .value 1
|
||||
+ .value 6
|
||||
+ .long 0
|
||||
+ .long 4
|
||||
+ .value 0
|
||||
+ .value 0
|
||||
+ .long _ZTVN5ClassE+8
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long _catch_classes_Class
|
||||
+ .long _IF_Class
|
||||
+ .long 0
|
||||
+ .value 1
|
||||
+ .byte 1
|
||||
+ .zero 1
|
||||
+ .long 0
|
||||
+ .value 0
|
||||
+ .zero 2
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .hidden _ZN5Class7class$$E
|
||||
+.globl _ZN5Class7class$$E
|
||||
+ .section .rodata
|
||||
+ .align 4
|
||||
+ .type _ZN5Class7class$$E, @object
|
||||
+ .size _ZN5Class7class$$E, 4
|
||||
+_ZN5Class7class$$E:
|
||||
+ .long _ZN5Class6class$E
|
||||
+ .section .jcr,"aw",@progbits
|
||||
+ .align 4
|
||||
+ .long _ZN9Interface6class$E
|
||||
+ .long _ZN5Class6class$E
|
||||
+ .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:
|
||||
+ .section .eh_frame,"a",@progbits
|
||||
+.Lframe1:
|
||||
+ .long .LECIE1-.LSCIE1
|
||||
+.LSCIE1:
|
||||
+ .long 0x0
|
||||
+ .byte 0x1
|
||||
+.globl __gcj_personality_v0
|
||||
+ .string "zP"
|
||||
+ .uleb128 0x1
|
||||
+ .sleb128 -4
|
||||
+ .byte 0x8
|
||||
+ .uleb128 0x5
|
||||
+ .byte 0x0
|
||||
+ .long __gcj_personality_v0
|
||||
+ .byte 0xc
|
||||
+ .uleb128 0x4
|
||||
+ .uleb128 0x4
|
||||
+ .byte 0x88
|
||||
+ .uleb128 0x1
|
||||
+ .align 4
|
||||
+.LECIE1:
|
||||
+.LSFDE1:
|
||||
+ .long .LEFDE1-.LASFDE1
|
||||
+.LASFDE1:
|
||||
+ .long .LASFDE1-.Lframe1
|
||||
+ .long .LFB2
|
||||
+ .long .LFE2-.LFB2
|
||||
+ .uleb128 0x0
|
||||
+ .byte 0x4
|
||||
+ .long .LCFI0-.LFB2
|
||||
+ .byte 0xe
|
||||
+ .uleb128 0x8
|
||||
+ .byte 0x85
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .long .LCFI1-.LCFI0
|
||||
+ .byte 0xd
|
||||
+ .uleb128 0x5
|
||||
+ .align 4
|
||||
+.LEFDE1:
|
||||
+ .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 0x117
|
||||
+ .value 0x2
|
||||
+ .long .Ldebug_abbrev0
|
||||
+ .byte 0x4
|
||||
+ .uleb128 0x1
|
||||
+ .string "GNU Java 4.3.0 20071221 (experimental)"
|
||||
+ .byte 0xb
|
||||
+ .string "interface.java"
|
||||
+ .string "/home/jkratoch/redhat/bz371831"
|
||||
+ .long .Ltext0
|
||||
+ .long .Letext0
|
||||
+ .long .Ldebug_line0
|
||||
+ .uleb128 0x2
|
||||
+ .string "Interface"
|
||||
+ .byte 0x4
|
||||
+ .byte 0x1
|
||||
+ .byte 0x0
|
||||
+ .long 0x8e
|
||||
+ .long 0x8e
|
||||
+ .uleb128 0x3
|
||||
+ .long 0x8e
|
||||
+ .byte 0x2
|
||||
+ .byte 0x23
|
||||
+ .uleb128 0x0
|
||||
+ .byte 0x1
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x4
|
||||
+ .string "java.lang.Object"
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x5
|
||||
+ .string "Class"
|
||||
+ .byte 0x4
|
||||
+ .byte 0x1
|
||||
+ .byte 0x0
|
||||
+ .long 0x8e
|
||||
+ .long 0xe8
|
||||
+ .uleb128 0x3
|
||||
+ .long 0x8e
|
||||
+ .byte 0x2
|
||||
+ .byte 0x23
|
||||
+ .uleb128 0x0
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x6
|
||||
+ .long 0x6e
|
||||
+ .byte 0x2
|
||||
+ .byte 0x23
|
||||
+ .uleb128 0x0
|
||||
+ .byte 0x1
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x7
|
||||
+ .byte 0x1
|
||||
+ .string "<init>"
|
||||
+ .byte 0x1
|
||||
+ .byte 0x0
|
||||
+ .string "_ZN5ClassC1Ev"
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x8
|
||||
+ .long 0xe8
|
||||
+ .byte 0x1
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x9
|
||||
+ .byte 0x4
|
||||
+ .long 0xa1
|
||||
+ .uleb128 0xa
|
||||
+ .long 0xc6
|
||||
+ .long .LFB2
|
||||
+ .long .LFE2
|
||||
+ .long .LLST0
|
||||
+ .long 0x114
|
||||
+ .uleb128 0xb
|
||||
+ .long 0xe8
|
||||
+ .byte 0x2
|
||||
+ .byte 0x91
|
||||
+ .sleb128 0
|
||||
+ .uleb128 0xc
|
||||
+ .long 0x114
|
||||
+ .byte 0x2
|
||||
+ .byte 0x91
|
||||
+ .sleb128 -12
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x9
|
||||
+ .byte 0x4
|
||||
+ .long 0x8e
|
||||
+ .byte 0x0
|
||||
+ .section .debug_abbrev
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x11
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x25
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x1b
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x11
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x12
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x10
|
||||
+ .uleb128 0x6
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0x38
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3a
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3b
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x1d
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x13
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x1c
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x38
|
||||
+ .uleb128 0xa
|
||||
+ .uleb128 0x32
|
||||
+ .uleb128 0xb
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x4
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x3c
|
||||
+ .uleb128 0xc
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x5
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3a
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3b
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x1d
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x13
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x6
|
||||
+ .uleb128 0x1c
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x38
|
||||
+ .uleb128 0xa
|
||||
+ .uleb128 0x4c
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x32
|
||||
+ .uleb128 0xb
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x7
|
||||
+ .uleb128 0x2e
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x3f
|
||||
+ .uleb128 0xc
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x3a
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3b
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x2007
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x3c
|
||||
+ .uleb128 0xc
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x5
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x34
|
||||
+ .uleb128 0xc
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x9
|
||||
+ .uleb128 0xf
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xa
|
||||
+ .uleb128 0x2e
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x47
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x11
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x12
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x40
|
||||
+ .uleb128 0x6
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x13
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x5
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0xa
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xc
|
||||
+ .uleb128 0x34
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0xa
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .section .debug_pubnames,"",@progbits
|
||||
+ .long 0x15
|
||||
+ .value 0x2
|
||||
+ .long .Ldebug_info0
|
||||
+ .long 0x11b
|
||||
+ .long 0xee
|
||||
+ .string "()"
|
||||
+ .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
|
||||
+ .ident "GCC: (GNU) 4.3.0 20071221 (experimental)"
|
||||
+ .section .note.GNU-stack,"",@progbits
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.arch/i386-interface.exp 22 Dec 2007 19:07:28 -0000
|
||||
@@ -0,0 +1,59 @@
|
||||
+# 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/>.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@gnu.org
|
||||
+
|
||||
+# This file is part of the gdb testsuite.
|
||||
+
|
||||
+# Test basis recognization of DW_TAG_interface_type.
|
||||
+# GCC java_classify_record() produces it if returns RECORD_IS_INTERFACE.
|
||||
+
|
||||
+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} then {
|
||||
+ verbose "Skipping i386 Java DW_TAG_interface_type test."
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "i386-interface"
|
||||
+set srcfile ${testfile}.S
|
||||
+set binfile ${objdir}/${subdir}/${testfile}.o
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug additional_flags=-m32}] != "" } {
|
||||
+ untested i386-gnu-cfi.exp
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+gdb_test "set language java"
|
||||
+
|
||||
+set test "ptype Interface"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "type = class Interface *extends java.lang.Object \{.*$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set test "ptype Class"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "type = class Class *extends java.lang.Object implements Interface \{.*$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
|
@ -1,3 +1,11 @@
|
|||
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>
|
||||
|
@ -10,8 +18,10 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
|
|||
Port to GDB-6.7 - only the testcase left, patch has been reverted,
|
||||
char-vectors restricted.
|
||||
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.base/charsign.c 26 Jan 2007 10:32:00 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -50,8 +60,10 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
|
|||
+char_n n_typed[]="A";
|
||||
+char_s s_typed[]="A";
|
||||
+char_u u_typed[]="A";
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.base/charsign.exp 26 Jan 2007 10:32:00 -0000
|
||||
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.
|
||||
+
|
||||
|
@ -71,7 +83,7 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
|
|||
+
|
||||
+set testfile charsign
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+proc do_test { cflags } {
|
||||
+ global srcdir
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
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
|
||||
|
@ -13,8 +21,10 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
|
|||
* (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as
|
||||
default dwarf2_frame_set_init_reg function.
|
||||
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c 3 Nov 2007 22:22:28 -0000
|
||||
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))
|
||||
|
@ -37,8 +47,10 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
|
|||
+ y = 14;
|
||||
+ return (int)gen_movsd (&x, &y);
|
||||
+}
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp 3 Nov 2007 22:22:28 -0000
|
||||
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.
|
||||
+#
|
||||
|
@ -68,7 +80,7 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
|
|||
+
|
||||
+set testfile "ppc-clobbered-registers-O2"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set compile_flags "debug additional_flags=-O2"
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${compile_flags}] != "" } {
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
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>
|
||||
|
@ -8,44 +16,22 @@ gdb/testsuite/gdb.base/fileio.exp:
|
|||
* 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.
|
||||
|
||||
Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120103.orig/gdb/testsuite/gdb.base/fileio.c 2009-10-01 17:39:13.000000000 +0200
|
||||
+++ gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.c 2012-01-03 15:21:28.122729249 +0100
|
||||
@@ -58,6 +58,8 @@ system (const char * string);
|
||||
1) Invalid string/command. - returns 127. */
|
||||
static const char *strerrno (int err);
|
||||
|
||||
+#define ROOTSUBDIR "fileio.dir"
|
||||
+
|
||||
#define FILENAME "foo.fileio.test"
|
||||
#define RENAMED "bar.fileio.test"
|
||||
#define NONEXISTANT "nofoo.fileio.test"
|
||||
@@ -542,6 +544,37 @@ strerrno (int err)
|
||||
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 ()
|
||||
{
|
||||
+ /* ROOTSUBDIR is already prepared by fileio.exp. We use it for easy cleanup
|
||||
+ (by fileio.exp) if we are run by multiple users in the same directory. */
|
||||
+
|
||||
+ if (chdir (ROOTSUBDIR) != 0)
|
||||
+ {
|
||||
+ printf ("chdir " ROOTSUBDIR ": %s\n", strerror (errno));
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ /* These tests
|
||||
+ Open for write but no write permission returns EACCES
|
||||
+ Unlinking a file in a directory w/o write access returns EACCES
|
||||
|
@ -55,10 +41,10 @@ Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.c
|
|||
+ {
|
||||
+ uid_t uid = 99;
|
||||
+
|
||||
+ if (chown (".", uid, uid) != 0)
|
||||
+ if (chown (OUTDIR, uid, uid) != 0)
|
||||
+ {
|
||||
+ printf ("chown %d.%d " ROOTSUBDIR ": %s\n", (int) uid, (int) uid,
|
||||
+ strerror (errno));
|
||||
+ printf ("chown %d.%d %s: %s\n", (int) uid, (int) uid,
|
||||
+ OUTDIR, strerror (errno));
|
||||
+ exit (1);
|
||||
+ }
|
||||
+ if (setuid (uid) || geteuid () == 0)
|
||||
|
@ -71,38 +57,48 @@ Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.c
|
|||
/* Don't change the order of the calls. They partly depend on each other */
|
||||
test_open ();
|
||||
test_write ();
|
||||
Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120103.orig/gdb/testsuite/gdb.base/fileio.exp 2011-12-26 12:24:55.000000000 +0100
|
||||
+++ gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.exp 2012-01-03 15:22:02.716601956 +0100
|
||||
@@ -42,8 +42,8 @@ if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
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"]
|
||||
}
|
||||
|
||||
-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
|
||||
-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
|
||||
+remote_exec build {sh -xc rm\ -rf\ fileio.dir}
|
||||
+remote_exec build {sh -xc mkdir\ -m777\ 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"]
|
||||
@@ -85,7 +85,7 @@ gdb_test continue \
|
||||
@@ -89,7 +90,7 @@ gdb_test continue \
|
||||
|
||||
gdb_test "continue" ".*" ""
|
||||
|
||||
-catch "system \"chmod -f -w nowrt.fileio.test\""
|
||||
+catch "system \"chmod -f -w fileio.dir/nowrt.fileio.test\""
|
||||
-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" \
|
||||
@@ -251,8 +251,8 @@ gdb_exit
|
||||
# Wait till GDB really exits.
|
||||
sleep 1
|
||||
@@ -276,9 +277,7 @@ gdb_test continue \
|
||||
gdb_exit
|
||||
|
||||
-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
|
||||
-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
|
||||
+remote_exec build {sh -xc test\ -r\ fileio.dir/dir2.fileio.test\ &&\ chmod\ -f\ +w\ fileio.dir/dir2.fileio.test}
|
||||
+remote_exec build {sh -xc rm\ -rf\ fileio.dir}
|
||||
# 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
|
||||
|
|
|
@ -1,152 +0,0 @@
|
|||
Index: gdb-7.4.50.20120703/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/linux-nat.c 2012-07-03 17:46:55.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/linux-nat.c 2012-07-03 17:57:29.608734933 +0200
|
||||
@@ -180,6 +180,9 @@ blocked. */
|
||||
static struct target_ops *linux_ops;
|
||||
static struct target_ops linux_ops_saved;
|
||||
|
||||
+/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */
|
||||
+static pid_t pid_was_stopped;
|
||||
+
|
||||
/* The method to call, if any, when a new thread is attached. */
|
||||
static void (*linux_nat_new_thread) (struct lwp_info *);
|
||||
|
||||
@@ -909,7 +912,14 @@ holding the child stopped. Try \"set de
|
||||
parent_inf->waiting_for_vfork_done = 0;
|
||||
}
|
||||
else if (detach_fork)
|
||||
- target_detach (NULL, 0);
|
||||
+ {
|
||||
+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
|
||||
+ In this point of code it cannot be 1 as we would not get FORK
|
||||
+ executed without CONTINUE first which resets PID_WAS_STOPPED.
|
||||
+ We would have to first TARGET_STOP and WAITPID it as with running
|
||||
+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
|
||||
+ target_detach (NULL, 0);
|
||||
+ }
|
||||
|
||||
/* Note that the detach above makes PARENT_INF dangling. */
|
||||
|
||||
@@ -1377,6 +1387,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
|
||||
if (debug_linux_nat)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"LNPAW: Attaching to a stopped process\n");
|
||||
+ pid_was_stopped = GET_PID (ptid);
|
||||
|
||||
/* The process is definitely stopped. It is in a job control
|
||||
stop, unless the kernel predates the TASK_STOPPED /
|
||||
@@ -1805,6 +1816,9 @@ get_pending_status (struct lwp_info *lp,
|
||||
gdb_signal_to_string (signo));
|
||||
}
|
||||
|
||||
+ if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped)
|
||||
+ *status = W_STOPCODE (SIGSTOP);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1918,6 +1932,8 @@ linux_nat_detach (struct target_ops *ops
|
||||
}
|
||||
else
|
||||
linux_ops->to_detach (ops, args, from_tty);
|
||||
+
|
||||
+ pid_was_stopped = 0;
|
||||
}
|
||||
|
||||
/* Resume LP. */
|
||||
@@ -2104,6 +2120,14 @@ linux_nat_resume (struct target_ops *ops
|
||||
linux_nat_resume_callback. */
|
||||
lp->stopped = 0;
|
||||
|
||||
+ /* At this point, we are going to resume the inferior and if we
|
||||
+ have attached to a stopped process, we no longer should leave
|
||||
+ it as stopped if the user detaches. PTID variable has PID set to LWP
|
||||
+ while we need to check the real PID here. */
|
||||
+
|
||||
+ if (!step && lp && pid_was_stopped == GET_PID (lp->ptid))
|
||||
+ pid_was_stopped = 0;
|
||||
+
|
||||
if (resume_many)
|
||||
iterate_over_lwps (ptid, linux_nat_resume_callback, NULL);
|
||||
|
||||
@@ -4129,6 +4153,8 @@ linux_nat_mourn_inferior (struct target_
|
||||
there are other viable forks to debug. Delete the exiting
|
||||
one and context-switch to the first available. */
|
||||
linux_fork_mourn_inferior ();
|
||||
+
|
||||
+ pid_was_stopped = 0;
|
||||
}
|
||||
|
||||
/* Convert a native/host siginfo object, into/from the siginfo in the
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/attach-stopped.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2012-06-26 21:23:20.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/attach-stopped.exp 2012-07-03 17:56:43.797790120 +0200
|
||||
@@ -61,7 +61,65 @@ proc corefunc { threadtype } {
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
- # Verify that we can attach to the stopped process.
|
||||
+ # Verify that we can attach to the process by first giving its
|
||||
+ # executable name via the file command, and using attach with the
|
||||
+ # process ID.
|
||||
+
|
||||
+ set test "$threadtype: set file, before attach1 to stopped process"
|
||||
+ gdb_test_multiple "file $binfile" "$test" {
|
||||
+ -re "Load new symbol table from.*y or n. $" {
|
||||
+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
|
||||
+ "$test (re-read)"
|
||||
+ }
|
||||
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ set test "$threadtype: attach1 to stopped, after setting file"
|
||||
+ gdb_test_multiple "attach $testpid" "$test" {
|
||||
+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there.
|
||||
+ if {[string equal $threadtype threaded]} {
|
||||
+ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt"
|
||||
+ } else {
|
||||
+ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt"
|
||||
+ }
|
||||
+
|
||||
+ # Exit and detach the process.
|
||||
+
|
||||
+ gdb_exit
|
||||
+
|
||||
+ # Avoid some race:
|
||||
+ sleep 2
|
||||
+
|
||||
+ if [catch {open /proc/${testpid}/status r} fileid] {
|
||||
+ set line2 "NOTFOUND"
|
||||
+ } else {
|
||||
+ gets $fileid line1;
|
||||
+ gets $fileid line2;
|
||||
+ close $fileid;
|
||||
+ }
|
||||
+
|
||||
+ set test "$threadtype: attach1, exit leaves process stopped"
|
||||
+ if {[string match "*(stopped)*" $line2]} {
|
||||
+ pass $test
|
||||
+ } else {
|
||||
+ fail $test
|
||||
+ }
|
||||
+
|
||||
+ # At this point, the process should still be stopped
|
||||
+
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ gdb_load ${binfile}
|
||||
+
|
||||
+ # Verify that we can attach to the process just by giving the
|
||||
+ # process ID.
|
||||
|
||||
set test "$threadtype: attach2 to stopped, after setting file"
|
||||
gdb_test_multiple "attach $testpid" "$test" {
|
|
@ -1,280 +0,0 @@
|
|||
Index: gdb-7.4.50.20120602/bfd/elf-bfd.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/bfd/elf-bfd.h 2012-06-02 21:26:09.928717069 +0200
|
||||
+++ gdb-7.4.50.20120602/bfd/elf-bfd.h 2012-06-02 21:27:21.727689625 +0200
|
||||
@@ -2221,8 +2221,10 @@ extern Elf_Internal_Phdr * _bfd_elf_find
|
||||
/* Exported interface for writing elf corefile notes. */
|
||||
extern char *elfcore_write_note
|
||||
(bfd *, char *, int *, const char *, int, const void *, int);
|
||||
+struct elf_prpsinfo;
|
||||
+typedef struct elf_prpsinfo prpsinfo_t;
|
||||
extern char *elfcore_write_prpsinfo
|
||||
- (bfd *, char *, int *, const char *, const char *);
|
||||
+ (bfd *, char *, int *, const prpsinfo_t *);
|
||||
extern char *elfcore_write_prstatus
|
||||
(bfd *, char *, int *, long, int, const void *);
|
||||
extern char * elfcore_write_pstatus
|
||||
Index: gdb-7.4.50.20120602/bfd/elf.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/bfd/elf.c 2012-06-02 21:26:09.928717069 +0200
|
||||
+++ gdb-7.4.50.20120602/bfd/elf.c 2012-06-02 21:27:21.732689623 +0200
|
||||
@@ -8917,56 +8917,61 @@ char *
|
||||
elfcore_write_prpsinfo (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
- const char *fname,
|
||||
- const char *psargs)
|
||||
+ const prpsinfo_t *input)
|
||||
{
|
||||
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
||||
|
||||
if (bed->elf_backend_write_core_note != NULL)
|
||||
{
|
||||
char *ret;
|
||||
+ char fname[sizeof (input->pr_fname) + 1];
|
||||
+ char psargs[sizeof (input->pr_psargs) + 1];
|
||||
+
|
||||
+ strncpy (fname, input->pr_fname, sizeof (input->pr_fname));
|
||||
+ fname[sizeof (input->pr_fname)] = 0;
|
||||
+ strncpy (psargs, input->pr_psargs, sizeof (input->pr_psargs));
|
||||
+ psargs[sizeof (input->pr_psargs)] = 0;
|
||||
+
|
||||
ret = (*bed->elf_backend_write_core_note) (abfd, buf, bufsiz,
|
||||
NT_PRPSINFO, fname, psargs);
|
||||
if (ret != NULL)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T)
|
||||
-#if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T)
|
||||
+#if defined (HAVE_PRPSINFO_T)
|
||||
+#if defined (HAVE_PRPSINFO32_T)
|
||||
if (bed->s->elfclass == ELFCLASS32)
|
||||
{
|
||||
-#if defined (HAVE_PSINFO32_T)
|
||||
- psinfo32_t data;
|
||||
- int note_type = NT_PSINFO;
|
||||
-#else
|
||||
prpsinfo32_t data;
|
||||
int note_type = NT_PRPSINFO;
|
||||
-#endif
|
||||
|
||||
- memset (&data, 0, sizeof (data));
|
||||
- strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
|
||||
- strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
|
||||
+ data.pr_state = input->pr_state;
|
||||
+ data.pr_sname = input->pr_sname;
|
||||
+ data.pr_zomb = input->pr_zomb;
|
||||
+ data.pr_nice = input->pr_nice;
|
||||
+ data.pr_flag = input->pr_flag;
|
||||
+ data.pr_uid = input->pr_uid;
|
||||
+ data.pr_gid = input->pr_gid;
|
||||
+ data.pr_pid = input->pr_pid;
|
||||
+ data.pr_ppid = input->pr_ppid;
|
||||
+ data.pr_pgrp = input->pr_pgrp;
|
||||
+ data.pr_sid = input->pr_sid;
|
||||
+ BFD_ASSERT (sizeof (data.pr_fname) == sizeof (input->pr_fname));
|
||||
+ memcpy (data.pr_fname, input->pr_fname, sizeof (data.pr_fname));
|
||||
+ BFD_ASSERT (sizeof (data.pr_psargs) == sizeof (input->pr_psargs));
|
||||
+ memcpy (data.pr_psargs, input->pr_psargs, sizeof (data.pr_psargs));
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
"CORE", note_type, &data, sizeof (data));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
-#if defined (HAVE_PSINFO_T)
|
||||
- psinfo_t data;
|
||||
- int note_type = NT_PSINFO;
|
||||
-#else
|
||||
- prpsinfo_t data;
|
||||
int note_type = NT_PRPSINFO;
|
||||
-#endif
|
||||
|
||||
- memset (&data, 0, sizeof (data));
|
||||
- strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
|
||||
- strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
- "CORE", note_type, &data, sizeof (data));
|
||||
+ "CORE", note_type, input, sizeof (*input));
|
||||
}
|
||||
-#endif /* PSINFO_T or PRPSINFO_T */
|
||||
+#endif /* PRPSINFO_T */
|
||||
|
||||
free (buf);
|
||||
return NULL;
|
||||
Index: gdb-7.4.50.20120602/gdb/procfs.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/procfs.c 2012-06-02 21:26:09.928717069 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/procfs.c 2012-06-02 21:27:21.745689618 +0200
|
||||
@@ -5541,6 +5541,7 @@ procfs_make_note_section (bfd *obfd, int
|
||||
note_data = (char *) elfcore_write_prpsinfo (obfd,
|
||||
note_data,
|
||||
note_size,
|
||||
+ NULL,
|
||||
fname,
|
||||
psargs);
|
||||
|
||||
Index: gdb-7.4.50.20120602/gdb/linux-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/linux-tdep.c 2012-06-02 21:26:09.928717069 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/linux-tdep.c 2012-06-02 21:31:12.051601510 +0200
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "elf-bfd.h" /* for elfcore_write_* */
|
||||
#include "inferior.h"
|
||||
#include "cli/cli-utils.h"
|
||||
+#include <sys/procfs.h>
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -769,6 +770,131 @@ linux_corefile_thread_callback (struct t
|
||||
return !args->note_data;
|
||||
}
|
||||
|
||||
+/* Should be always true for Linux */
|
||||
+#define HAVE_PRPSINFO_T 1
|
||||
+
|
||||
+#if defined (HAVE_PRPSINFO_T)
|
||||
+
|
||||
+/* Fills struct elf_prpsinfo{32,64} as much as possible, imitate Linux kernel
|
||||
+ binfmt_elf.c. Unknown values are filled with zeroes. The structure is
|
||||
+ malloced. */
|
||||
+
|
||||
+static const prpsinfo_t *
|
||||
+fill_prpsinfo (void)
|
||||
+{
|
||||
+ struct stat sb;
|
||||
+ char filename[sizeof ("/proc//cmdline") + sizeof (int) * 3 + 2];
|
||||
+ char buf[1024];
|
||||
+ char proc_state[5];
|
||||
+ char proc_cmdline[sizeof (((struct elf_prpsinfo*)0)->pr_psargs) + 1];
|
||||
+ unsigned flags;
|
||||
+ long proc_nice;
|
||||
+ unsigned proc_ppid;
|
||||
+ unsigned proc_pgid;
|
||||
+ unsigned proc_sid;
|
||||
+ pid_t pid;
|
||||
+ int fd, n;
|
||||
+ char *cp, *proc_comm, *state_s;
|
||||
+ /* String comes from Linux kernel binfmt_elf.c FILL_PSINFO but it is already
|
||||
+ obsolete there to <linux/sched.h> TASK_* constants. */
|
||||
+ const char state_string[] = "RSDTZW";
|
||||
+ int state_num;
|
||||
+ static prpsinfo_t retval;
|
||||
+
|
||||
+ /* Get /proc/$PID/stat. */
|
||||
+ pid = ptid_get_pid (inferior_ptid);
|
||||
+ sprintf (filename, "/proc/%u/stat", (unsigned)pid);
|
||||
+ fd = open (filename, O_RDONLY);
|
||||
+ if (fd < 0)
|
||||
+ return NULL;
|
||||
+ fstat (fd, &sb); /* No error checking (can it ever happen?). */
|
||||
+ n = read (fd, buf, sizeof (buf) - 1);
|
||||
+ close (fd);
|
||||
+ if (n < 0)
|
||||
+ return NULL;
|
||||
+ buf[n] = 0;
|
||||
+
|
||||
+ cp = strrchr (buf, ')'); /* Split into "PID (COMM" and "<rest>". */
|
||||
+ if (!cp)
|
||||
+ return NULL;
|
||||
+ *cp = 0;
|
||||
+
|
||||
+ /* Grab COMM. */
|
||||
+ proc_comm = strchr (buf, '(');
|
||||
+ if (!proc_comm)
|
||||
+ return NULL;
|
||||
+ proc_comm++;
|
||||
+
|
||||
+ /* Read /proc/$PID/cmdline. */
|
||||
+ proc_cmdline[0] = 0;
|
||||
+ strcpy (strrchr (filename, '/'), "/cmdline");
|
||||
+ fd = open (filename, O_RDONLY);
|
||||
+ if (fd >= 0)
|
||||
+ {
|
||||
+ int n;
|
||||
+
|
||||
+ n = read (fd, proc_cmdline, sizeof (proc_cmdline) - 1);
|
||||
+ if (n < 0)
|
||||
+ n = 0;
|
||||
+ proc_cmdline[n] = 0;
|
||||
+ while (n--) /* Replace NULs with spaces. */
|
||||
+ if (proc_cmdline[n] == 0)
|
||||
+ proc_cmdline[n] = ' ';
|
||||
+ close (fd);
|
||||
+ }
|
||||
+
|
||||
+ /* Parse /proc/$PID/stat. */
|
||||
+ n = sscanf (cp + 2, /* skip ") " */
|
||||
+ "%4s %u " /* state, ppid */
|
||||
+ "%u %u %*s %*s " /* pgid, sid, tty, tpgid */
|
||||
+ "%u %*s %*s %*s " /* flags, min_flt, cmin_flt, maj_flt */
|
||||
+ "%*s " /* cmaj_flt */
|
||||
+ "%*s %*s " /* utime, stime */
|
||||
+ "%*s %*s %*s " /* cutime, cstime, priority */
|
||||
+ "%ld " /* nice */
|
||||
+ /*"%*s %*s " timeout, it_real_value */
|
||||
+ /*"%lu " start_time */
|
||||
+ /*"%lu " vsize */
|
||||
+ /*"%lu " rss */
|
||||
+ /*"%lu %lu %lu " rss_rlim, start_code, end_code */
|
||||
+ /*"%lu %lu %lu " start_stack, kstk_esp, kstk_eip */
|
||||
+ /*"%u %u %u %u " signal, blocked, sigignore, sigcatch */
|
||||
+ /*"%lu %lu %lu" wchan, nswap, cnswap */
|
||||
+ , proc_state, &proc_ppid,
|
||||
+ &proc_pgid, &proc_sid,
|
||||
+ &flags,
|
||||
+ &proc_nice);
|
||||
+ if (n != 6)
|
||||
+ return NULL;
|
||||
+
|
||||
+ state_s = strchr (state_string, proc_state[0]);
|
||||
+ if (state_s != NULL)
|
||||
+ state_num = state_s - state_string;
|
||||
+ else
|
||||
+ {
|
||||
+ /* 0 means Running, some more unusal state would be better. */
|
||||
+ state_num = 0;
|
||||
+ }
|
||||
+
|
||||
+ memset (&retval, 0, sizeof (retval));
|
||||
+ retval.pr_state = state_num;
|
||||
+ retval.pr_sname = proc_state[0];
|
||||
+ retval.pr_zomb = (proc_state[0] == 'Z');
|
||||
+ retval.pr_nice = proc_nice;
|
||||
+ retval.pr_flag = flags;
|
||||
+ retval.pr_uid = sb.st_uid;
|
||||
+ retval.pr_gid = sb.st_gid;
|
||||
+ retval.pr_pid = pid;
|
||||
+ retval.pr_ppid = proc_ppid;
|
||||
+ retval.pr_pgrp = proc_pgid;
|
||||
+ retval.pr_sid = proc_sid;
|
||||
+ strncpy (retval.pr_fname, proc_comm, sizeof (retval.pr_fname));
|
||||
+ strncpy (retval.pr_psargs, proc_cmdline, sizeof (retval.pr_psargs));
|
||||
+
|
||||
+ return &retval;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/* Fills the "to_make_corefile_note" target vector. Builds the note
|
||||
section for a corefile, and returns it in a malloc buffer. */
|
||||
|
||||
@@ -784,16 +910,9 @@ linux_make_corefile_notes (struct gdbarc
|
||||
/* Process information. */
|
||||
if (get_exec_file (0))
|
||||
{
|
||||
- const char *fname = lbasename (get_exec_file (0));
|
||||
- char *psargs = xstrdup (fname);
|
||||
+ const prpsinfo_t *data = fill_prpsinfo ();
|
||||
|
||||
- if (get_inferior_args ())
|
||||
- psargs = reconcat (psargs, psargs, " ", get_inferior_args (),
|
||||
- (char *) NULL);
|
||||
-
|
||||
- note_data = elfcore_write_prpsinfo (obfd, note_data, note_size,
|
||||
- fname, psargs);
|
||||
- xfree (psargs);
|
||||
+ note_data = elfcore_write_prpsinfo (obfd, note_data, note_size, data);
|
||||
|
||||
if (!note_data)
|
||||
return NULL;
|
|
@ -1,25 +0,0 @@
|
|||
Index: gdb-6.8.50.20090803/gdb/valops.c
|
||||
===================================================================
|
||||
--- gdb-6.8.50.20090803.orig/gdb/valops.c 2009-08-04 06:30:45.000000000 +0200
|
||||
+++ gdb-6.8.50.20090803/gdb/valops.c 2009-08-04 06:33:05.000000000 +0200
|
||||
@@ -926,10 +926,18 @@ value_assign (struct value *toval, struc
|
||||
struct gdbarch *gdbarch;
|
||||
int value_reg;
|
||||
|
||||
- /* Figure out which frame this is in currently. */
|
||||
- frame = frame_find_by_id (VALUE_FRAME_ID (toval));
|
||||
value_reg = VALUE_REGNUM (toval);
|
||||
|
||||
+ /* Figure out which frame this is in currently. */
|
||||
+ frame = frame_find_by_id (VALUE_FRAME_ID (toval));
|
||||
+ /* "set $reg+=1" should work on programs with no debug info,
|
||||
+ but frame_find_by_id returns NULL here (RH bug 436037).
|
||||
+ Use current frame, it represents CPU state in this case.
|
||||
+ If frame_find_by_id is changed to do it internally
|
||||
+ (it is contemplated there), remove this. */
|
||||
+ if (!frame)
|
||||
+ frame = get_current_frame ();
|
||||
+ /* Probably never happens. */
|
||||
if (!frame)
|
||||
error (_("Value being assigned to is no longer active."));
|
||||
|
|
@ -1,8 +1,16 @@
|
|||
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 -up -u -X /root/jkratoch/.diffi.list -rup gdb-6.8/gdb/testsuite/gdb.threads/threaded-exec.c gdb-6.8-patched/gdb/testsuite/gdb.threads/threaded-exec.c
|
||||
--- gdb-6.8/gdb/testsuite/gdb.threads/threaded-exec.c 2008-04-16 17:05:19.000000000 -0400
|
||||
+++ gdb-6.8-patched/gdb/testsuite/gdb.threads/threaded-exec.c 2008-04-16 14:43:50.000000000 -0400
|
||||
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. */
|
||||
|
||||
|
@ -139,16 +147,16 @@ diff -up -u -X /root/jkratoch/.diffi.list -rup gdb-6.8/gdb/testsuite/gdb.threads
|
|||
+ execl (cmd, cmd, exec_nothreads, exec_threads, phase_s, NULL);
|
||||
+ assert (0);
|
||||
}
|
||||
diff -up -u -X /root/jkratoch/.diffi.list -rup gdb-6.8/gdb/testsuite/gdb.threads/threaded-exec.exp gdb-6.8-patched/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
--- gdb-6.8/gdb/testsuite/gdb.threads/threaded-exec.exp 2008-04-16 17:05:19.000000000 -0400
|
||||
+++ gdb-6.8-patched/gdb/testsuite/gdb.threads/threaded-exec.exp 2008-04-16 14:42:49.000000000 -0400
|
||||
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 ${objdir}/${subdir}/${testfile}
|
||||
+set binfile_nothreads ${objdir}/${subdir}/${testfile}N
|
||||
+set binfile_threads ${objdir}/${subdir}/${testfile}Y
|
||||
-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}] != "" } {
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
|
||||
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.exp 2009-04-19 16:30:12.000000000 +0200
|
||||
@@ -0,0 +1,61 @@
|
||||
+# This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+# Copyright 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 ability to load an elf64-i386 core file. The provided core file was
|
||||
+# elf64-x8664 one but it got binary patched to i386:
|
||||
+# Elf32_Ehdr.e_machine @0x12..0x13
|
||||
+# Elf64_Ehdr.e_machine @0x12..0x13
|
||||
+# #define EM_386 3 /* Intel 80386 */
|
||||
+# #define EM_X86_64 62 /* AMD x86-64 architecture */
|
||||
+# patch @0x12: 0x3E -> 0x03
|
||||
+
|
||||
+if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
|
||||
+ verbose "Skipping i386-biarch-core test."
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "i386-biarch-core"
|
||||
+set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
|
||||
+set corefile ${objdir}/${subdir}/${testfile}.core
|
||||
+# Entry point of the original executable.
|
||||
+set address 0x400078
|
||||
+
|
||||
+if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
|
||||
+ untested "failed uudecode or bzip2"
|
||||
+ return -1
|
||||
+}
|
||||
+file stat ${corefile} corestat
|
||||
+if {$corestat(size) != 102400} {
|
||||
+ untested "uudecode or bzip2 produce invalid result"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+# Wrongly built GDB complains by:
|
||||
+# "..." is not a core dump: File format not recognized
|
||||
+# As the provided test core has 64bit PRSTATUS i386 built GDB cannot parse it.
|
||||
+# This is just a problem of the test care, real-world elf64-i386 file will have
|
||||
+# 32bit PRSTATUS. One cannot prepare elf64-i386 core file from elf32-i386 by
|
||||
+# objcopy as it corrupts the core file beyond all recognition.
|
||||
+# "\r\nCore was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal 11, Segmentation fault\\.\r\n.*"
|
||||
+gdb_test "core-file ${corefile}"
|
||||
+
|
||||
+gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"
|
||||
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
|
||||
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.S 2009-04-19 14:52:28.000000000 +0200
|
||||
@@ -0,0 +1,22 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 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.
|
||||
+ */
|
||||
+
|
||||
+ .globl _start
|
||||
+_start:
|
||||
+ hlt
|
||||
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
|
||||
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2.uu 2009-04-19 15:02:12.000000000 +0200
|
||||
@@ -0,0 +1,13 @@
|
||||
+begin 600 i386-biarch-core.core.bz2
|
||||
+M0EIH.3%!629361`P1\P`!)?_____\9'@"8Q)6P380'9@'&#`0D@``"``%(``
|
||||
+M@`#`"!<(L`%F"(:$GH13::F-)M&D&U,AD:`--#)M0&FT0XR9--,)D9`P(Q-&
|
||||
+M",(-&F``02)%38HT]0T`&AH```'H@``T^>9T*(,("&)SE`>`9@+GP=[,N)KB
|
||||
+M'I8BL(L]N5TCY\%V]/?DB.BN*UZ'U@]TN7-]UJ5\_%0QTT<*086#%MHT7XVJ
|
||||
+M9D"+C!"2*L:8D1XPD!`--M@*XT1H5RFYN&)(!0P0#:`I:;2;$5M&\*9"0@%:
|
||||
+MK@X[T()M)9N7`D$VA!^63)%,;@8LT`(7\K&[7G;U:"B6'!GG+46ALOZF.2F-
|
||||
+M!@>C*%86X$-]C2`KE;HG)UL(913VR2G]0BD:J=Z_`G@S,`W%.8RMS-#5P:J0
|
||||
+MAJ2\8&X?@DE;UF68QHM<,D`('::J65/S:PAG*R-09["8DBI)'V]Y.[(/AM*L
|
||||
+M"X_O^V;%FY.S6Q]FM=D37>5F,%4-F1ZF#,CFJVU;H*^IT<(%<V`.32$`JU["
|
||||
+/G`68?\7<D4X4)`0,$?,`
|
||||
+`
|
||||
+end
|
|
@ -1,147 +1,17 @@
|
|||
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).
|
||||
|
||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp 2009-09-09 20:10:35.000000000 +0200
|
||||
@@ -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 ${objdir}/${subdir}/${testfile}.so
|
||||
+set srcmainfile ${testfile}-main.c
|
||||
+set binfile ${objdir}/${subdir}/${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()"
|
||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c 2009-09-09 20:10:35.000000000 +0200
|
||||
@@ -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;
|
||||
+}
|
||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S 2009-09-09 20:10:35.000000000 +0200
|
||||
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.
|
||||
+
|
||||
|
@ -471,3 +341,141 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
|
|||
+ .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()"
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
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.
|
||||
|
||||
|
@ -5,68 +13,66 @@ 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).
|
||||
|
||||
Index: gdb-7.2.50.20110117/gdb/defs.h
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20110117.orig/gdb/defs.h 2011-01-17 15:47:37.000000000 +0100
|
||||
+++ gdb-7.2.50.20110117/gdb/defs.h 2011-01-17 15:53:05.000000000 +0100
|
||||
@@ -165,6 +165,7 @@ extern char *python_libdir;
|
||||
extern char *debug_file_directory;
|
||||
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;
|
||||
|
||||
extern int quit_flag;
|
||||
+#ifdef NEED_DETACH_SIGSTOP
|
||||
+extern int quit_flag_cleanup;
|
||||
extern int immediate_quit;
|
||||
extern int sevenbit_strings;
|
||||
+#endif
|
||||
+
|
||||
extern void quit (void);
|
||||
|
||||
@@ -178,7 +179,7 @@ extern void quit (void);
|
||||
needed. */
|
||||
/* 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;
|
||||
|
||||
#define QUIT { \
|
||||
- if (quit_flag) quit (); \
|
||||
+ if (quit_flag && !quit_flag_cleanup) quit (); \
|
||||
if (deprecated_interactive_hook) deprecated_interactive_hook (); \
|
||||
}
|
||||
+#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;
|
||||
|
||||
Index: gdb-7.2.50.20110117/gdb/event-top.c
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20110117.orig/gdb/event-top.c 2011-01-17 15:52:39.000000000 +0100
|
||||
+++ gdb-7.2.50.20110117/gdb/event-top.c 2011-01-17 15:52:49.000000000 +0100
|
||||
@@ -904,7 +904,7 @@ async_request_quit (gdb_client_data arg)
|
||||
is no reason to call quit again here, unless immediate_quit is
|
||||
set. */
|
||||
|
||||
- if (quit_flag || immediate_quit)
|
||||
+ if ((quit_flag || immediate_quit) && !quit_flag_cleanup)
|
||||
quit ();
|
||||
}
|
||||
|
||||
Index: gdb-7.2.50.20110117/gdb/top.c
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20110117.orig/gdb/top.c 2011-01-17 15:47:37.000000000 +0100
|
||||
+++ gdb-7.2.50.20110117/gdb/top.c 2011-01-17 15:52:49.000000000 +0100
|
||||
@@ -1257,7 +1257,9 @@ quit_force (char *args, int from_tty)
|
||||
qt.args = args;
|
||||
qt.from_tty = from_tty;
|
||||
|
||||
- /* We want to handle any quit errors and exit regardless. */
|
||||
+#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;
|
||||
catch_errors (quit_target, &qt,
|
||||
"Quitting: ", RETURN_MASK_ALL);
|
||||
+#endif
|
||||
|
||||
Index: gdb-7.2.50.20110117/gdb/utils.c
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20110117.orig/gdb/utils.c 2011-01-17 15:47:37.000000000 +0100
|
||||
+++ gdb-7.2.50.20110117/gdb/utils.c 2011-01-17 15:52:49.000000000 +0100
|
||||
@@ -121,6 +121,11 @@ int job_control;
|
||||
/* 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;
|
||||
|
||||
int quit_flag;
|
||||
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
|
||||
+
|
||||
/* Nonzero means quit immediately if Control-C is typed now, rather
|
||||
than waiting until QUIT is executed. Be careful in setting this;
|
||||
code which executes with immediate_quit set has to be very careful
|
||||
/* 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.) */
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
Index: gdb-7.4.50.20111218/gdb/sparc-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20111218.orig/gdb/sparc-tdep.c 2011-09-28 19:59:42.000000000 +0200
|
||||
+++ gdb-7.4.50.20111218/gdb/sparc-tdep.c 2011-12-19 01:25:29.294046199 +0100
|
||||
@@ -1316,6 +1316,7 @@ sparc32_store_return_value (struct type
|
||||
if (sparc_floating_p (type) || sparc_complex_floating_p (type))
|
||||
{
|
||||
/* Floating return values. */
|
||||
+ len = (len <= 8) ? len : 8;
|
||||
memcpy (buf, valbuf, len);
|
||||
regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
|
||||
if (len > 4)
|
|
@ -1,78 +0,0 @@
|
|||
For:
|
||||
http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html
|
||||
http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html
|
||||
|
||||
--- /dev/null 2008-11-04 06:31:10.599601840 +0100
|
||||
+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint-cond.exp 2008-11-04 06:43:29.000000000 +0100
|
||||
@@ -0,0 +1,37 @@
|
||||
+# 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/>.
|
||||
+
|
||||
+set testfile watchpoint-cond
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile ${objdir}/${subdir}/${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}
|
||||
+
|
||||
+if { [runto_main] < 0 } {
|
||||
+ untested watchpoint-cond
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_test "watch i if i < 20" "atchpoint \[0-9\]+: i"
|
||||
+gdb_test "cont" "atchpoint \[0-9\]+: i.*Old value = 20.*New value = 19.*"
|
||||
--- /dev/null 2008-11-04 06:31:10.599601840 +0100
|
||||
+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint-cond.c 2008-11-04 06:42:48.000000000 +0100
|
||||
@@ -0,0 +1,31 @@
|
||||
+/* 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/>.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int
|
||||
+main (int argc, char **argv)
|
||||
+{
|
||||
+ static int i = 0; /* `static' to start initialized. */
|
||||
+ int j = 2;
|
||||
+
|
||||
+ for (j = 0; j < 30; j++)
|
||||
+ i = 30 - j;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
|
@ -1,51 +0,0 @@
|
|||
Index: gdb-7.4.50.20120703/gdb/gdb_bfd.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/gdb_bfd.c 2012-07-03 17:30:07.356754655 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/gdb_bfd.c 2012-07-03 17:43:52.565762454 +0200
|
||||
@@ -26,12 +26,14 @@
|
||||
#ifdef HAVE_ZLIB_H
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
+#ifndef __sparc__
|
||||
#ifdef HAVE_MMAP
|
||||
#include <sys/mman.h>
|
||||
#ifndef MAP_FAILED
|
||||
#define MAP_FAILED ((void *) -1)
|
||||
#endif
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/* An object of this type is stored in the section's user data when
|
||||
mapping a section. */
|
||||
@@ -181,6 +183,7 @@ free_one_bfd_section (bfd *abfd, asectio
|
||||
|
||||
if (sect != NULL && sect->data != NULL)
|
||||
{
|
||||
+#ifndef __sparc__
|
||||
#ifdef HAVE_MMAP
|
||||
if (sect->map_addr != NULL)
|
||||
{
|
||||
@@ -191,6 +194,7 @@ free_one_bfd_section (bfd *abfd, asectio
|
||||
}
|
||||
else
|
||||
#endif
|
||||
+#endif
|
||||
xfree (sect->data);
|
||||
}
|
||||
}
|
||||
@@ -425,6 +429,7 @@ gdb_bfd_map_section (asection *sectp, bf
|
||||
}
|
||||
}
|
||||
|
||||
+#ifndef __sparc__
|
||||
#ifdef HAVE_MMAP
|
||||
{
|
||||
/* The page size, used when mmapping. */
|
||||
@@ -458,6 +463,7 @@ gdb_bfd_map_section (asection *sectp, bf
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_MMAP */
|
||||
+#endif
|
||||
|
||||
/* If we get here, we are a normal, not-compressed section. */
|
||||
|
|
@ -1,8 +1,18 @@
|
|||
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
|
||||
|
||||
--- ./gdb/testsuite/gdb.cp/cxxexec.cc 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ ./gdb/testsuite/gdb.cp/cxxexec.cc 2010-05-29 01:18:56.000000000 +0200
|
||||
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.
|
||||
+
|
||||
|
@ -29,9 +39,11 @@ http://sourceware.org/ml/archer/2010-q2/msg00031.html
|
|||
+ execlp ("true", "true", NULL);
|
||||
+ return 1;
|
||||
+}
|
||||
--- ./gdb/testsuite/gdb.cp/cxxexec.exp 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ ./gdb/testsuite/gdb.cp/cxxexec.exp 2010-05-29 01:29:25.000000000 +0200
|
||||
@@ -0,0 +1,51 @@
|
||||
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
|
||||
|
@ -71,15 +83,6 @@ http://sourceware.org/ml/archer/2010-q2/msg00031.html
|
|||
+ }
|
||||
+}
|
||||
+
|
||||
+set test continue
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "Cannot access memory at address 0x\[0-9a-f\]+\r\n$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+ -re "\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# `info inferiors' can show <null> on older GDBs.
|
||||
+gdb_test "info threads" "info threads" "program finished"
|
||||
+# Run to end. The buggy GDB failed instead with:
|
||||
+# Cannot access memory at address ADDR.
|
||||
+gdb_continue_to_end "" "continue" 1
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
Index: gdb-7.4.50.20120602/gdb/breakpoint.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/breakpoint.c 2012-06-02 19:11:54.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/breakpoint.c 2012-06-02 19:52:58.161226506 +0200
|
||||
@@ -15495,6 +15495,50 @@ initialize_breakpoint_ops (void)
|
||||
}
|
||||
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;
|
||||
|
||||
void
|
||||
+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
|
||||
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;
|
||||
|
@ -25,7 +32,7 @@ Index: gdb-7.4.50.20120602/gdb/breakpoint.c
|
|||
+ CORE_ADDR relocated_address;
|
||||
+ CORE_ADDR delta_offset;
|
||||
+
|
||||
+ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
|
||||
+ delta_offset = delta[osect->the_bfd_section->index];
|
||||
+ if (delta_offset == 0)
|
||||
+ continue;
|
||||
+ relocated_address = bl->address + delta_offset;
|
||||
|
@ -34,7 +41,7 @@ Index: gdb-7.4.50.20120602/gdb/breakpoint.c
|
|||
+ && relocated_address < obj_section_endaddr (osect))
|
||||
+ {
|
||||
+ if (bl->inserted)
|
||||
+ remove_breakpoint (bl, mark_uninserted);
|
||||
+ remove_breakpoint (bl);
|
||||
+
|
||||
+ bl->address += delta_offset;
|
||||
+ bl->requested_address += delta_offset;
|
||||
|
@ -45,33 +52,32 @@ Index: gdb-7.4.50.20120602/gdb/breakpoint.c
|
|||
+ }
|
||||
+
|
||||
+ if (changed)
|
||||
+ qsort (bp_location, bp_location_count, sizeof (*bp_location),
|
||||
+ bp_location_compare);
|
||||
+ std::sort (bp_locations, bp_locations + bp_locations_count,
|
||||
+ bp_location_is_less_than);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
_initialize_breakpoint (void)
|
||||
{
|
||||
struct cmd_list_element *c;
|
||||
Index: gdb-7.4.50.20120602/gdb/breakpoint.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/breakpoint.h 2012-05-16 16:35:03.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/breakpoint.h 2012-06-02 19:53:09.268223263 +0200
|
||||
@@ -1503,4 +1503,7 @@ extern struct gdbarch *get_sal_arch (str
|
||||
|
||||
extern void handle_solib_event (void);
|
||||
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,
|
||||
+ struct section_offsets *delta);
|
||||
+ section_offsets &delta);
|
||||
+
|
||||
#endif /* !defined (BREAKPOINT_H) */
|
||||
Index: gdb-7.4.50.20120602/gdb/objfiles.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/objfiles.c 2012-05-10 21:50:08.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/objfiles.c 2012-06-02 19:52:58.202226502 +0200
|
||||
@@ -802,6 +802,11 @@ objfile_relocate1 (struct objfile *objfi
|
||||
objfile->sf->sym_probe_fns->sym_relocate_probe (objfile,
|
||||
new_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. */
|
||||
|
|
|
@ -1,135 +1,39 @@
|
|||
Index: gdb-7.4.50.20120602/gdb/dwarf2read.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/dwarf2read.c 2012-06-02 19:14:38.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/dwarf2read.c 2012-06-02 19:51:29.977252338 +0200
|
||||
@@ -9746,7 +9746,12 @@ read_common_block (struct die_info *die,
|
||||
{
|
||||
struct attribute *attr;
|
||||
struct symbol *sym;
|
||||
- CORE_ADDR base = (CORE_ADDR) 0;
|
||||
+ struct objfile *objfile = cu->objfile;
|
||||
+ CORE_ADDR baseaddr = ANOFFSET (objfile->section_offsets,
|
||||
+ SECT_OFF_TEXT (objfile));
|
||||
+ /* This is used only for DW_AT_data_member_location entries. */
|
||||
+ CORE_ADDR base = 0;
|
||||
+ int base_p = 0;
|
||||
|
||||
attr = dwarf2_attr (die, DW_AT_location, cu);
|
||||
if (attr)
|
||||
@@ -9755,6 +9760,7 @@ read_common_block (struct die_info *die,
|
||||
if (attr_form_is_block (attr))
|
||||
{
|
||||
base = decode_locdesc (DW_BLOCK (attr), cu);
|
||||
+ base_p = 1;
|
||||
}
|
||||
else if (attr_form_is_section_offset (attr))
|
||||
{
|
||||
@@ -9807,12 +9813,15 @@ read_common_block (struct die_info *die,
|
||||
if (sym != NULL
|
||||
&& handle_data_member_location (child_die, cu, &offset))
|
||||
{
|
||||
- SYMBOL_VALUE_ADDRESS (sym) = base + offset;
|
||||
+ if (!base_p)
|
||||
+ dwarf2_invalid_attrib_class_complaint
|
||||
+ ("DW_AT_data_member_location", "common block member");
|
||||
+ SYMBOL_VALUE_ADDRESS (sym) = base + offset + baseaddr;
|
||||
add_symbol_to_list (sym, &global_symbols);
|
||||
}
|
||||
|
||||
if (SYMBOL_CLASS (sym) == LOC_STATIC)
|
||||
- SET_FIELD_PHYSADDR (*field, SYMBOL_VALUE_ADDRESS (sym));
|
||||
+ SET_FIELD_PHYSADDR (*field, SYMBOL_VALUE_ADDRESS (sym) - baseaddr);
|
||||
else
|
||||
SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym));
|
||||
FIELD_TYPE (*field) = SYMBOL_TYPE (sym);
|
||||
@@ -9826,7 +9835,7 @@ read_common_block (struct die_info *die,
|
||||
|
||||
sym = new_symbol (die, type, cu);
|
||||
/* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */
|
||||
- SYMBOL_VALUE_ADDRESS (sym) = base;
|
||||
+ SYMBOL_VALUE_ADDRESS (sym) = base + baseaddr;
|
||||
|
||||
set_die_type (die, type, cu);
|
||||
}
|
||||
Index: gdb-7.4.50.20120602/gdb/gdbtypes.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/gdbtypes.h 2012-06-02 19:11:54.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/gdbtypes.h 2012-06-02 19:52:44.990230200 +0200
|
||||
@@ -401,6 +401,7 @@ enum field_loc_kind
|
||||
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.patch
|
||||
|
||||
;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
|
||||
|
||||
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
--- a/gdb/gdbtypes.h
|
||||
+++ b/gdb/gdbtypes.h
|
||||
@@ -649,6 +649,7 @@ enum field_loc_kind
|
||||
{
|
||||
FIELD_LOC_KIND_BITPOS, /* bitpos */
|
||||
FIELD_LOC_KIND_ENUMVAL, /* enumval */
|
||||
FIELD_LOC_KIND_BITPOS, /**< bitpos */
|
||||
FIELD_LOC_KIND_ENUMVAL, /**< enumval */
|
||||
+ /* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
FIELD_LOC_KIND_PHYSADDR, /* physaddr */
|
||||
FIELD_LOC_KIND_PHYSNAME, /* physname */
|
||||
FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */
|
||||
@@ -595,6 +596,7 @@ struct main_type
|
||||
is the location (in the target) of the static field.
|
||||
Otherwise, physname is the mangled label of the static field. */
|
||||
FIELD_LOC_KIND_PHYSADDR, /**< physaddr */
|
||||
FIELD_LOC_KIND_PHYSNAME, /**< physname */
|
||||
FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */
|
||||
@@ -699,6 +700,7 @@ union field_location
|
||||
field. Otherwise, physname is the mangled label of the
|
||||
static field. */
|
||||
|
||||
+ /* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
CORE_ADDR physaddr;
|
||||
const char *physname;
|
||||
+ /* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
CORE_ADDR physaddr;
|
||||
const char *physname;
|
||||
|
||||
@@ -1200,6 +1202,7 @@ extern void allocate_gnat_aux_type (stru
|
||||
#define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
|
||||
#define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
|
||||
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
|
||||
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
|
||||
#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
|
||||
#define SET_FIELD_BITPOS(thisfld, bitpos) \
|
||||
@@ -1211,6 +1214,7 @@ extern void allocate_gnat_aux_type (stru
|
||||
#define SET_FIELD_PHYSNAME(thisfld, name) \
|
||||
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
|
||||
FIELD_STATIC_PHYSNAME (thisfld) = (name))
|
||||
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
#define SET_FIELD_PHYSADDR(thisfld, addr) \
|
||||
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
|
||||
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
|
||||
@@ -1227,6 +1231,7 @@ extern void allocate_gnat_aux_type (stru
|
||||
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
|
||||
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
|
||||
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
|
||||
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
|
||||
#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
|
||||
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
|
||||
Index: gdb-7.4.50.20120602/gdb/jv-lang.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/jv-lang.c 2012-05-10 21:59:12.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/jv-lang.c 2012-06-02 19:51:53.286245280 +0200
|
||||
@@ -431,7 +431,8 @@ java_link_class_type (struct gdbarch *gd
|
||||
|
||||
fields = NULL;
|
||||
nfields--; /* First set up dummy "class" field. */
|
||||
- SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas));
|
||||
+ SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas)
|
||||
+ - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
|
||||
TYPE_FIELD_NAME (type, nfields) = "class";
|
||||
TYPE_FIELD_TYPE (type, nfields) = value_type (clas);
|
||||
SET_TYPE_FIELD_PRIVATE (type, nfields);
|
||||
@@ -479,7 +480,8 @@ java_link_class_type (struct gdbarch *gd
|
||||
SET_TYPE_FIELD_PROTECTED (type, i);
|
||||
}
|
||||
if (accflags & 0x0008) /* ACC_STATIC */
|
||||
- SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset);
|
||||
+ SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset
|
||||
+ - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
|
||||
else
|
||||
SET_FIELD_BITPOS (TYPE_FIELD (type, i), 8 * boffset);
|
||||
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
|
||||
Index: gdb-7.4.50.20120602/gdb/value.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/value.c 2012-06-02 19:11:55.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/value.c 2012-06-02 19:51:30.031252317 +0200
|
||||
@@ -2592,7 +2592,8 @@ value_static_field (struct type *type, i
|
||||
diff --git a/gdb/value.c b/gdb/value.c
|
||||
--- a/gdb/value.c
|
||||
+++ b/gdb/value.c
|
||||
@@ -2850,7 +2850,8 @@ value_static_field (struct type *type, int fieldno)
|
||||
{
|
||||
case FIELD_LOC_KIND_PHYSADDR:
|
||||
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
|
||||
retval = value_at_lazy (type->field (fieldno).type (),
|
||||
- TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
|
||||
+ TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)
|
||||
+ + (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
|
||||
+ + (TYPE_OBJFILE (type) == NULL ? 0 : TYPE_OBJFILE (type)->section_offsets[SECT_OFF_TEXT (TYPE_OBJFILE (type))]));
|
||||
break;
|
||||
case FIELD_LOC_KIND_PHYSNAME:
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
13888
gdb-archer.patch
13888
gdb-archer.patch
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,12 @@
|
|||
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-attach-fail-reasons-5of5.patch
|
||||
|
||||
;; Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878).
|
||||
;;=push+jan
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2012-03/msg00171.html
|
||||
Subject: [patch 3/3] attach-fail-reasons: SELinux deny_ptrace
|
||||
|
||||
Hi,
|
||||
|
||||
|
@ -9,11 +16,9 @@ and here is the last bit for new SELinux 'deny_ptrace':
|
|||
As even PTRACE_TRACEME fails in such case it needs to install hook for even
|
||||
that event.
|
||||
|
||||
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
|
||||
gdb/
|
||||
2012-03-06 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
|
@ -37,68 +42,103 @@ gdb/gdbserver/
|
|||
(linux_create_inferior, linux_tracefork_child): Call it instead of
|
||||
direct ptrace.
|
||||
|
||||
Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.c
|
||||
===================================================================
|
||||
--- gdb-7.5.0.20120926.orig/gdb/common/linux-ptrace.c 2012-09-17 20:28:14.000000000 +0200
|
||||
+++ gdb-7.5.0.20120926/gdb/common/linux-ptrace.c 2012-09-26 19:13:53.508780239 +0200
|
||||
@@ -28,6 +28,10 @@
|
||||
#include "buffer.h"
|
||||
#include "gdb_assert.h"
|
||||
diff --git a/gdb/config.in b/gdb/config.in
|
||||
--- a/gdb/config.in
|
||||
+++ b/gdb/config.in
|
||||
@@ -253,6 +253,9 @@
|
||||
/* Define if librpm library is being used. */
|
||||
#undef HAVE_LIBRPM
|
||||
|
||||
+#ifdef HAVE_SELINUX_SELINUX_H
|
||||
+# include <selinux/selinux.h>
|
||||
+#endif /* HAVE_SELINUX_SELINUX_H */
|
||||
+/* Define to 1 if you have the `selinux' library (-lselinux). */
|
||||
+#undef HAVE_LIBSELINUX
|
||||
+
|
||||
/* Find all possible reasons we could fail to attach PID and append these
|
||||
newline terminated reason strings to initialized BUFFER. '\0' termination
|
||||
of BUFFER must be done by the caller. */
|
||||
@@ -47,6 +51,8 @@ linux_ptrace_attach_warnings (pid_t pid,
|
||||
buffer_xml_printf (buffer, _("warning: process %d is a zombie "
|
||||
"- the process has already terminated\n"),
|
||||
(int) pid);
|
||||
+
|
||||
+ linux_ptrace_create_warnings (buffer);
|
||||
}
|
||||
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
|
||||
#undef HAVE_LIBUNWIND_IA64_H
|
||||
|
||||
#if defined __i386__ || defined __x86_64__
|
||||
@@ -242,3 +248,19 @@ linux_ptrace_init_warnings (void)
|
||||
@@ -388,6 +391,9 @@
|
||||
/* Define to 1 if you have the `scm_new_smob' function. */
|
||||
#undef HAVE_SCM_NEW_SMOB
|
||||
|
||||
linux_ptrace_test_ret_to_nx ();
|
||||
}
|
||||
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
|
||||
+#undef HAVE_SELINUX_SELINUX_H
|
||||
+
|
||||
+/* Print all possible reasons we could fail to create a traced process. */
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -16861,6 +16861,64 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
+for ac_header in selinux/selinux.h
|
||||
+do :
|
||||
+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
|
||||
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_SELINUX_SELINUX_H 1
|
||||
+_ACEOF
|
||||
+
|
||||
+void
|
||||
+linux_ptrace_create_warnings (struct buffer *buffer)
|
||||
+fi
|
||||
+
|
||||
+done
|
||||
+
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
|
||||
+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
|
||||
+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lselinux $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char security_get_boolean_active ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+#ifdef HAVE_LIBSELINUX
|
||||
+ /* -1 is returned for errors, 0 if it has no effect, 1 if PTRACE_ATTACH is
|
||||
+ forbidden. */
|
||||
+ if (security_get_boolean_active ("deny_ptrace") == 1)
|
||||
+ buffer_xml_printf (buffer,
|
||||
+ _("the SELinux boolean 'deny_ptrace' is enabled, "
|
||||
+ "you can disable this process attach protection by: "
|
||||
+ "(gdb) shell sudo setsebool deny_ptrace=0"));
|
||||
+#endif /* HAVE_LIBSELINUX */
|
||||
+return security_get_boolean_active ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.h
|
||||
===================================================================
|
||||
--- gdb-7.5.0.20120926.orig/gdb/common/linux-ptrace.h 2012-07-07 14:13:56.000000000 +0200
|
||||
+++ gdb-7.5.0.20120926/gdb/common/linux-ptrace.h 2012-09-26 19:13:28.358765406 +0200
|
||||
@@ -69,5 +69,6 @@ struct buffer;
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=yes
|
||||
+else
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
|
||||
+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
|
||||
+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBSELINUX 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-lselinux $LIBS"
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
|
||||
extern void linux_ptrace_attach_warnings (pid_t pid, struct buffer *buffer);
|
||||
extern void linux_ptrace_init_warnings (void);
|
||||
+extern void linux_ptrace_create_warnings (struct buffer *buffer);
|
||||
|
||||
#endif /* COMMON_LINUX_PTRACE_H */
|
||||
Index: gdb-7.5.0.20120926/gdb/configure.ac
|
||||
===================================================================
|
||||
--- gdb-7.5.0.20120926.orig/gdb/configure.ac 2012-09-26 19:13:24.000000000 +0200
|
||||
+++ gdb-7.5.0.20120926/gdb/configure.ac 2012-09-26 19:13:28.410765451 +0200
|
||||
@@ -2008,6 +2008,10 @@ then
|
||||
[Define if you support the personality syscall.])
|
||||
fi
|
||||
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
|
||||
# except that the argument to --with-sysroot is optional.
|
||||
diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
--- a/gdb/configure.ac
|
||||
+++ b/gdb/configure.ac
|
||||
@@ -1900,6 +1900,10 @@ case $host_os in
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
|
||||
|
||||
+dnl Check security_get_boolean_active availability.
|
||||
+AC_CHECK_HEADERS(selinux/selinux.h)
|
||||
|
@ -107,11 +147,182 @@ Index: gdb-7.5.0.20120926/gdb/configure.ac
|
|||
dnl Handle optional features that can be enabled.
|
||||
|
||||
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
|
||||
Index: gdb-7.5.0.20120926/gdb/gdbserver/configure.ac
|
||||
===================================================================
|
||||
--- gdb-7.5.0.20120926.orig/gdb/gdbserver/configure.ac 2012-04-19 21:34:51.000000000 +0200
|
||||
+++ gdb-7.5.0.20120926/gdb/gdbserver/configure.ac 2012-09-26 19:13:28.446765428 +0200
|
||||
@@ -438,6 +438,10 @@ if $want_ipa ; then
|
||||
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
--- a/gdb/linux-nat.c
|
||||
+++ b/gdb/linux-nat.c
|
||||
@@ -1103,7 +1103,16 @@ linux_nat_target::create_inferior (const char *exec_file,
|
||||
/* Make sure we report all signals during startup. */
|
||||
pass_signals ({});
|
||||
|
||||
- inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty);
|
||||
+ try
|
||||
+ {
|
||||
+ inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty);
|
||||
+ }
|
||||
+ catch (const gdb_exception_error &ex)
|
||||
+ {
|
||||
+ std::string result = linux_ptrace_create_warnings ();
|
||||
+
|
||||
+ throw_error (ex.error, "%s%s", result.c_str (), ex.message->c_str ());
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Callback for linux_proc_attach_tgid_threads. Attach to PTID if not
|
||||
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
|
||||
--- a/gdb/nat/linux-ptrace.c
|
||||
+++ b/gdb/nat/linux-ptrace.c
|
||||
@@ -25,6 +25,10 @@
|
||||
#include <sys/procfs.h>
|
||||
#endif
|
||||
|
||||
+#ifdef HAVE_SELINUX_SELINUX_H
|
||||
+# include <selinux/selinux.h>
|
||||
+#endif /* HAVE_SELINUX_SELINUX_H */
|
||||
+
|
||||
/* Stores the ptrace options supported by the running kernel.
|
||||
A value of -1 means we did not check for features yet. A value
|
||||
of 0 means there are no supported features. */
|
||||
@@ -50,6 +54,8 @@ linux_ptrace_attach_fail_reason (pid_t pid)
|
||||
"terminated"),
|
||||
(int) pid);
|
||||
|
||||
+ result += linux_ptrace_create_warnings ();
|
||||
+
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -586,6 +592,25 @@ linux_ptrace_init_warnings (void)
|
||||
linux_ptrace_test_ret_to_nx ();
|
||||
}
|
||||
|
||||
+/* Print all possible reasons we could fail to create a traced process. */
|
||||
+
|
||||
+std::string
|
||||
+linux_ptrace_create_warnings ()
|
||||
+{
|
||||
+ std::string result;
|
||||
+
|
||||
+#ifdef HAVE_LIBSELINUX
|
||||
+ /* -1 is returned for errors, 0 if it has no effect, 1 if PTRACE_ATTACH is
|
||||
+ forbidden. */
|
||||
+ if (security_get_boolean_active ("deny_ptrace") == 1)
|
||||
+ string_appendf (result,
|
||||
+ _("the SELinux boolean 'deny_ptrace' is enabled, "
|
||||
+ "you can disable this process attach protection by: "
|
||||
+ "(gdb) shell sudo setsebool deny_ptrace=0\n"));
|
||||
+#endif /* HAVE_LIBSELINUX */
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
/* Extract extended ptrace event from wait status. */
|
||||
|
||||
int
|
||||
diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
|
||||
--- a/gdb/nat/linux-ptrace.h
|
||||
+++ b/gdb/nat/linux-ptrace.h
|
||||
@@ -184,6 +184,7 @@ extern std::string linux_ptrace_attach_fail_reason (pid_t pid);
|
||||
extern std::string linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
|
||||
|
||||
extern void linux_ptrace_init_warnings (void);
|
||||
+extern std::string linux_ptrace_create_warnings ();
|
||||
extern void linux_check_ptrace_features (void);
|
||||
extern void linux_enable_event_reporting (pid_t pid, int attached);
|
||||
extern void linux_disable_event_reporting (pid_t pid);
|
||||
diff --git a/gdbserver/config.in b/gdbserver/config.in
|
||||
--- a/gdbserver/config.in
|
||||
+++ b/gdbserver/config.in
|
||||
@@ -143,6 +143,9 @@
|
||||
/* Define if you have the ipt library. */
|
||||
#undef HAVE_LIBIPT
|
||||
|
||||
+/* Define to 1 if you have the `selinux' library (-lselinux). */
|
||||
+#undef HAVE_LIBSELINUX
|
||||
+
|
||||
/* Define if the target supports branch tracing. */
|
||||
#undef HAVE_LINUX_BTRACE
|
||||
|
||||
@@ -249,6 +252,9 @@
|
||||
/* Define to 1 if you have the `sbrk' function. */
|
||||
#undef HAVE_SBRK
|
||||
|
||||
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
|
||||
+#undef HAVE_SELINUX_SELINUX_H
|
||||
+
|
||||
/* Define to 1 if you have the `setns' function. */
|
||||
#undef HAVE_SETNS
|
||||
|
||||
diff --git a/gdbserver/configure b/gdbserver/configure
|
||||
--- a/gdbserver/configure
|
||||
+++ b/gdbserver/configure
|
||||
@@ -10683,6 +10683,64 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
+for ac_header in selinux/selinux.h
|
||||
+do :
|
||||
+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
|
||||
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_SELINUX_SELINUX_H 1
|
||||
+_ACEOF
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+done
|
||||
+
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
|
||||
+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
|
||||
+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lselinux $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char security_get_boolean_active ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return security_get_boolean_active ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=yes
|
||||
+else
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
|
||||
+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
|
||||
+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBSELINUX 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-lselinux $LIBS"
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
|
||||
|
||||
|
||||
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
|
||||
--- a/gdbserver/configure.ac
|
||||
+++ b/gdbserver/configure.ac
|
||||
@@ -401,6 +401,10 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -121,124 +332,25 @@ Index: gdb-7.5.0.20120926/gdb/gdbserver/configure.ac
|
|||
+
|
||||
AC_SUBST(GDBSERVER_DEPFILES)
|
||||
AC_SUBST(GDBSERVER_LIBS)
|
||||
AC_SUBST(USE_THREAD_DB)
|
||||
Index: gdb-7.5.0.20120926/gdb/gdbserver/linux-low.c
|
||||
===================================================================
|
||||
--- gdb-7.5.0.20120926.orig/gdb/gdbserver/linux-low.c 2012-07-07 14:13:57.000000000 +0200
|
||||
+++ gdb-7.5.0.20120926/gdb/gdbserver/linux-low.c 2012-09-26 19:13:28.453765471 +0200
|
||||
@@ -601,6 +601,28 @@ add_lwp (ptid_t ptid)
|
||||
return lwp;
|
||||
}
|
||||
|
||||
+/* Execute PTRACE_TRACEME with error checking. */
|
||||
+
|
||||
+static void
|
||||
+linux_traceme (const char *program)
|
||||
+{
|
||||
+ int save_errno;
|
||||
+ struct buffer buffer;
|
||||
+
|
||||
+ errno = 0;
|
||||
+ if (ptrace (PTRACE_TRACEME, 0, NULL, NULL) == 0)
|
||||
+ return;
|
||||
+
|
||||
+ save_errno = errno;
|
||||
+ buffer_init (&buffer);
|
||||
+ linux_ptrace_create_warnings (&buffer);
|
||||
+ buffer_grow_str0 (&buffer, "");
|
||||
+ fprintf (stderr, _("%sCannot trace created process %s: %s.\n"),
|
||||
+ buffer_finish (&buffer), program, strerror (save_errno));
|
||||
+ fflush (stderr);
|
||||
+ _exit (0177);
|
||||
+}
|
||||
+
|
||||
/* Start an inferior process and returns its pid.
|
||||
ALLARGS is a vector of program-name and args. */
|
||||
|
||||
@@ -641,7 +663,7 @@ linux_create_inferior (char *program, ch
|
||||
|
||||
if (pid == 0)
|
||||
{
|
||||
- ptrace (PTRACE_TRACEME, 0, 0, 0);
|
||||
+ linux_traceme (program);
|
||||
|
||||
#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */
|
||||
signal (__SIGRTMIN + 1, SIG_DFL);
|
||||
@@ -4572,7 +4594,7 @@ linux_tracefork_grandchild (void *arg)
|
||||
static int
|
||||
linux_tracefork_child (void *arg)
|
||||
AC_SUBST(srv_xmlbuiltin)
|
||||
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
|
||||
--- a/gdbserver/linux-low.cc
|
||||
+++ b/gdbserver/linux-low.cc
|
||||
@@ -932,7 +932,16 @@ linux_ptrace_fun ()
|
||||
{
|
||||
- ptrace (PTRACE_TRACEME, 0, 0, 0);
|
||||
+ linux_traceme ("PTRACE_O_TRACEFORK test");
|
||||
kill (getpid (), SIGSTOP);
|
||||
|
||||
#if !(defined(__UCLIBC__) && defined(HAS_NOMMU))
|
||||
Index: gdb-7.5.0.20120926/gdb/inf-ptrace.c
|
||||
===================================================================
|
||||
--- gdb-7.5.0.20120926.orig/gdb/inf-ptrace.c 2012-05-24 18:51:34.000000000 +0200
|
||||
+++ gdb-7.5.0.20120926/gdb/inf-ptrace.c 2012-09-26 19:13:28.458765461 +0200
|
||||
@@ -105,7 +105,15 @@ static void
|
||||
inf_ptrace_me (void)
|
||||
{
|
||||
/* "Trace me, Dr. Memory!" */
|
||||
+ errno = 0;
|
||||
ptrace (PT_TRACE_ME, 0, (PTRACE_TYPE_ARG3)0, 0);
|
||||
+ if (errno != 0)
|
||||
if (ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0,
|
||||
(PTRACE_TYPE_ARG4) 0) < 0)
|
||||
- trace_start_error_with_name ("ptrace");
|
||||
+ {
|
||||
+ fprintf_unfiltered (gdb_stderr, _("Cannot create process: %s\n"),
|
||||
+ safe_strerror (errno));
|
||||
+ gdb_flush (gdb_stderr);
|
||||
+ _exit (0177);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Start a new inferior Unix child process. EXEC_FILE is the file to
|
||||
Index: gdb-7.5.0.20120926/gdb/linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-7.5.0.20120926.orig/gdb/linux-nat.c 2012-09-26 19:13:22.000000000 +0200
|
||||
+++ gdb-7.5.0.20120926/gdb/linux-nat.c 2012-09-26 19:13:28.468765469 +0200
|
||||
@@ -1574,6 +1574,7 @@ linux_nat_create_inferior (struct target
|
||||
#ifdef HAVE_PERSONALITY
|
||||
int personality_orig = 0, personality_set = 0;
|
||||
#endif /* HAVE_PERSONALITY */
|
||||
+ volatile struct gdb_exception ex;
|
||||
|
||||
/* The fork_child mechanism is synchronous and calls target_wait, so
|
||||
we have to mask the async mode. */
|
||||
@@ -1598,7 +1599,10 @@ linux_nat_create_inferior (struct target
|
||||
/* Make sure we report all signals during startup. */
|
||||
linux_nat_pass_signals (0, NULL);
|
||||
|
||||
- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
|
||||
+ TRY_CATCH (ex, RETURN_MASK_ERROR)
|
||||
+ {
|
||||
+ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
|
||||
+ int save_errno = errno;
|
||||
+
|
||||
+ std::string msg (linux_ptrace_create_warnings ());
|
||||
+
|
||||
+ msg += _("Cannot trace created process");
|
||||
+
|
||||
+ errno = save_errno;
|
||||
+ trace_start_error_with_name (msg.c_str ());
|
||||
+ }
|
||||
|
||||
#ifdef HAVE_PERSONALITY
|
||||
if (personality_set)
|
||||
@@ -1610,6 +1614,24 @@ linux_nat_create_inferior (struct target
|
||||
safe_strerror (errno));
|
||||
}
|
||||
#endif /* HAVE_PERSONALITY */
|
||||
+
|
||||
+ if (ex.reason < 0)
|
||||
+ {
|
||||
+ struct buffer buffer;
|
||||
+ char *message, *buffer_s;
|
||||
+
|
||||
+ message = xstrdup (ex.message);
|
||||
+ make_cleanup (xfree, message);
|
||||
+
|
||||
+ buffer_init (&buffer);
|
||||
+ linux_ptrace_create_warnings (&buffer);
|
||||
+
|
||||
+ buffer_grow_str0 (&buffer, "");
|
||||
+ buffer_s = buffer_finish (&buffer);
|
||||
+ make_cleanup (xfree, buffer_s);
|
||||
+
|
||||
+ throw_error (ex.error, "%s%s", buffer_s, message);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void
|
||||
if (setpgid (0, 0) < 0)
|
||||
trace_start_error_with_name ("setpgid");
|
||||
|
|
|
@ -1,186 +0,0 @@
|
|||
Index: gdb-7.4.50.20120602/gdb/config.in
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/config.in 2012-06-02 21:49:26.147399232 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/config.in 2012-06-02 21:49:27.206398845 +0200
|
||||
@@ -222,6 +222,9 @@
|
||||
/* Define if librpm library is being used. */
|
||||
#undef HAVE_LIBRPM
|
||||
|
||||
+/* Define to 1 if you have the `selinux' library (-lselinux). */
|
||||
+#undef HAVE_LIBSELINUX
|
||||
+
|
||||
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
|
||||
#undef HAVE_LIBUNWIND_IA64_H
|
||||
|
||||
@@ -363,6 +366,9 @@
|
||||
/* Define to 1 if you have the `sbrk' function. */
|
||||
#undef HAVE_SBRK
|
||||
|
||||
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
|
||||
+#undef HAVE_SELINUX_SELINUX_H
|
||||
+
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
Index: gdb-7.4.50.20120602/gdb/configure
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/configure 2012-06-02 21:49:27.139398869 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/configure 2012-06-02 21:49:50.890390179 +0200
|
||||
@@ -12745,6 +12745,64 @@ $as_echo "#define HAVE_PERSONALITY 1" >>
|
||||
|
||||
fi
|
||||
|
||||
+for ac_header in selinux/selinux.h
|
||||
+do :
|
||||
+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
|
||||
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_SELINUX_SELINUX_H 1
|
||||
+_ACEOF
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+done
|
||||
+
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
|
||||
+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
|
||||
+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lselinux $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char security_get_boolean_active ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return security_get_boolean_active ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=yes
|
||||
+else
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
|
||||
+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
|
||||
+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBSELINUX 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-lselinux $LIBS"
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
|
||||
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
|
||||
# except that the argument to --with-sysroot is optional.
|
||||
Index: gdb-7.4.50.20120602/gdb/gdbserver/config.in
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/gdbserver/config.in 2012-04-19 21:34:51.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/gdbserver/config.in 2012-06-02 21:49:55.945388329 +0200
|
||||
@@ -69,6 +69,9 @@
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
+/* Define to 1 if you have the `selinux' library (-lselinux). */
|
||||
+#undef HAVE_LIBSELINUX
|
||||
+
|
||||
/* Define to 1 if you have the <linux/elf.h> header file. */
|
||||
#undef HAVE_LINUX_ELF_H
|
||||
|
||||
@@ -130,6 +133,9 @@
|
||||
/* Define to 1 if you have the `readlink' function. */
|
||||
#undef HAVE_READLINK
|
||||
|
||||
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
|
||||
+#undef HAVE_SELINUX_SELINUX_H
|
||||
+
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
Index: gdb-7.4.50.20120602/gdb/gdbserver/configure
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/gdbserver/configure 2012-04-20 19:58:49.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/gdbserver/configure 2012-06-02 21:49:54.485388864 +0200
|
||||
@@ -5532,6 +5532,64 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
+for ac_header in selinux/selinux.h
|
||||
+do :
|
||||
+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
|
||||
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_SELINUX_SELINUX_H 1
|
||||
+_ACEOF
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+done
|
||||
+
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
|
||||
+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
|
||||
+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lselinux $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char security_get_boolean_active ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return security_get_boolean_active ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=yes
|
||||
+else
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
|
||||
+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
|
||||
+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBSELINUX 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-lselinux $LIBS"
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,196 @@
|
|||
http://sourceware.org/ml/binutils/2016-03/msg00119.html
|
||||
Subject: [patch] aout+coff: Fix strict-aliasing rules error
|
||||
|
||||
|
||||
--IJpNTDwzlM2Ie8A6
|
||||
Content-Type: text/plain; charset=us-ascii
|
||||
Content-Disposition: inline
|
||||
|
||||
Hi,
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1315191 by Dan Horak
|
||||
gcc (GCC) 6.0.0 20160308 (experimental)
|
||||
gcc-6.0.0-0.15.fc24
|
||||
gcc-6.0.0-0.15.fc25
|
||||
It did compile with:
|
||||
gcc-6.0.0-0.14.fc24
|
||||
|
||||
aoutx.h:2504:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
int type_code = aout_symbol (symbol)->type & 0xff;
|
||||
^~~
|
||||
coffcode.h:1817:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
coffsymbol (section->symbol)->native = native;
|
||||
^~~~~~~~~~
|
||||
|
||||
Full log attached.
|
||||
|
||||
This fix is probably wrong as it drops the type safety. But ({ statements as
|
||||
expressions }) are probably not allowed in GDB.
|
||||
|
||||
|
||||
Jan
|
||||
|
||||
--IJpNTDwzlM2Ie8A6
|
||||
Content-Type: text/plain; charset=us-ascii
|
||||
Content-Disposition: inline; filename=1
|
||||
|
||||
bfd/
|
||||
2016-03-08 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Fix strict-aliasing rules compilation error.
|
||||
* libaout.h (aout_symbol): Remove type safe indirection.
|
||||
* libcoff-in.h (coffsymbol): Likewise.
|
||||
* libcoff.h: Regenerate.
|
||||
|
||||
diff --git a/bfd/libaout.h b/bfd/libaout.h
|
||||
index 8b70a9f..b60c40c 100644
|
||||
--- a/bfd/libaout.h
|
||||
+++ b/bfd/libaout.h
|
||||
@@ -448,9 +448,7 @@ struct aout_data_struct
|
||||
#define obj_aout_sym_hashes(bfd) (adata (bfd).sym_hashes)
|
||||
#define obj_aout_dynamic_info(bfd) (adata (bfd).dynamic_info)
|
||||
|
||||
-/* We take the address of the first element of an asymbol to ensure that the
|
||||
- macro is only ever applied to an asymbol. */
|
||||
-#define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd))
|
||||
+#define aout_symbol(asymbol) ((aout_symbol_type *) (asymbol))
|
||||
|
||||
/* Information we keep for each a.out section. This is currently only
|
||||
used by the a.out backend linker. */
|
||||
diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h
|
||||
index 80f999d..fa1e9ac 100644
|
||||
--- a/bfd/libcoff-in.h
|
||||
+++ b/bfd/libcoff-in.h
|
||||
@@ -188,9 +188,7 @@ struct xcoff_tdata
|
||||
|
||||
#define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data)
|
||||
|
||||
-/* We take the address of the first element of an asymbol to ensure that the
|
||||
- macro is only ever applied to an asymbol. */
|
||||
-#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
|
||||
+#define coffsymbol(asymbol) ((coff_symbol_type *) (asymbol))
|
||||
|
||||
/* Tdata for sections in XCOFF files. This is used by the linker. */
|
||||
|
||||
diff --git a/bfd/libcoff.h b/bfd/libcoff.h
|
||||
index bbed3e0..8ce525b 100644
|
||||
--- a/bfd/libcoff.h
|
||||
+++ b/bfd/libcoff.h
|
||||
@@ -192,9 +192,7 @@ struct xcoff_tdata
|
||||
|
||||
#define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data)
|
||||
|
||||
-/* We take the address of the first element of an asymbol to ensure that the
|
||||
- macro is only ever applied to an asymbol. */
|
||||
-#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
|
||||
+#define coffsymbol(asymbol) ((coff_symbol_type *) (asymbol))
|
||||
|
||||
/* Tdata for sections in XCOFF files. This is used by the linker. */
|
||||
|
||||
|
||||
--IJpNTDwzlM2Ie8A6
|
||||
Content-Type: text/plain; charset=iso-2022-jp
|
||||
Content-Disposition: inline; filename=2
|
||||
|
||||
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DHAVE_x86_64_elf64_vec -DHAVE_i386_elf32_vec -DHAVE_iamcu_elf32_vec -DHAVE_x86_64_elf32_vec -DHAVE_i386_aout_linux_vec -DHAVE_i386_pei_vec -DHAVE_x86_64_pei_vec -DHAVE_l1om_elf64_vec -DHAVE_k1om_elf64_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I./../zlib -g -O2 -MT aout32.lo -MD -MP -MF .deps/aout32.Tpo -c aout32.c -o aout32.o
|
||||
In file included from aout32.c:24:0:
|
||||
aoutx.h: In function $B!F(Baout_32_write_syms$B!G(B:
|
||||
aoutx.h:1871:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
H_PUT_16 (abfd, aout_symbol (g)->desc, nsp.e_desc);
|
||||
^~~~~~~~
|
||||
aoutx.h:1872:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
H_PUT_8 (abfd, aout_symbol (g)->other, nsp.e_other);
|
||||
^~~~~~~
|
||||
aoutx.h:1873:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
H_PUT_8 (abfd, aout_symbol (g)->type, nsp.e_type);
|
||||
^~~~~~~
|
||||
aoutx.h: In function $B!F(Baout_32_get_symbol_info$B!G(B:
|
||||
aoutx.h:2504:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
int type_code = aout_symbol (symbol)->type & 0xff;
|
||||
^~~
|
||||
aoutx.h:2515:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
ret->stab_other = (unsigned) (aout_symbol (symbol)->other & 0xff);
|
||||
^~~
|
||||
aoutx.h:2516:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
ret->stab_desc = (unsigned) (aout_symbol (symbol)->desc & 0xffff);
|
||||
^~~
|
||||
aoutx.h: In function $B!F(Baout_32_print_symbol$B!G(B:
|
||||
aoutx.h:2537:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
(unsigned) (aout_symbol (symbol)->desc & 0xffff),
|
||||
^
|
||||
aoutx.h:2538:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
(unsigned) (aout_symbol (symbol)->other & 0xff),
|
||||
^
|
||||
aoutx.h:2539:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
(unsigned) (aout_symbol (symbol)->type));
|
||||
^
|
||||
aoutx.h:2549:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
(unsigned) (aout_symbol (symbol)->desc & 0xffff),
|
||||
^
|
||||
aoutx.h:2550:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
(unsigned) (aout_symbol (symbol)->other & 0xff),
|
||||
^
|
||||
aoutx.h:2551:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
(unsigned) (aout_symbol (symbol)->type & 0xff));
|
||||
^
|
||||
cc1: all warnings being treated as errors
|
||||
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DHAVE_x86_64_elf64_vec -DHAVE_i386_elf32_vec -DHAVE_iamcu_elf32_vec -DHAVE_x86_64_elf32_vec -DHAVE_i386_aout_linux_vec -DHAVE_i386_pei_vec -DHAVE_x86_64_pei_vec -DHAVE_l1om_elf64_vec -DHAVE_k1om_elf64_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I./../zlib -g -O2 -MT pei-i386.lo -MD -MP -MF .deps/pei-i386.Tpo -c pei-i386.c -o pei-i386.o
|
||||
In file included from coff-i386.c:614:0,
|
||||
from pei-i386.c:45:
|
||||
coffcode.h: In function $B!F(Bcoff_new_section_hook$B!G(B:
|
||||
coffcode.h:1817:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
coffsymbol (section->symbol)->native = native;
|
||||
^~~~~~~~~~
|
||||
cc1: all warnings being treated as errors
|
||||
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DHAVE_x86_64_elf64_vec -DHAVE_i386_elf32_vec -DHAVE_iamcu_elf32_vec -DHAVE_x86_64_elf32_vec -DHAVE_i386_aout_linux_vec -DHAVE_i386_pei_vec -DHAVE_x86_64_pei_vec -DHAVE_l1om_elf64_vec -DHAVE_k1om_elf64_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I./../zlib -g -O2 -MT coffgen.lo -MD -MP -MF .deps/coffgen.Tpo -c coffgen.c -o coffgen.o
|
||||
coffgen.c: In function $B!F(Bcoff_get_lineno$B!G(B:
|
||||
coffgen.c:1510:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
return coffsymbol (symbol)->lineno;
|
||||
^~~~~~
|
||||
coffgen.c: In function $B!F(Bcoff_get_symbol_info$B!G(B:
|
||||
coffgen.c:2034:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
if (coffsymbol (symbol)->native != NULL
|
||||
^~
|
||||
coffgen.c:2035:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
&& coffsymbol (symbol)->native->fix_value
|
||||
^~
|
||||
coffgen.c:2036:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
&& coffsymbol (symbol)->native->is_sym)
|
||||
^~
|
||||
coffgen.c:2037:5: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
ret->value = coffsymbol (symbol)->native->u.syment.n_value -
|
||||
^~~
|
||||
coffgen.c: In function $B!F(Bcoff_print_symbol$B!G(B:
|
||||
coffgen.c:2059:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
coffsymbol (symbol)->native ? "n" : "g",
|
||||
^~~~~~~~~~
|
||||
coffgen.c:2060:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
coffsymbol (symbol)->lineno ? "l" : " ");
|
||||
^~~~~~~~~~
|
||||
coffgen.c:2064:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
if (coffsymbol (symbol)->native)
|
||||
^~
|
||||
coffgen.c:2068:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
combined_entry_type *combined = coffsymbol (symbol)->native;
|
||||
^~~~~~~~~~~~~~~~~~~
|
||||
coffgen.c:2070:11: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
struct lineno_cache_entry *l = coffsymbol (symbol)->lineno;
|
||||
^~~~~~~~~~~~~~~~~~
|
||||
coffgen.c:2191:6: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
coffsymbol (symbol)->native ? "n" : "g",
|
||||
^~~~~~~~~~
|
||||
coffgen.c:2192:6: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
coffsymbol (symbol)->lineno ? "l" : " ",
|
||||
^~~~~~~~~~
|
||||
cc1: all warnings being treated as errors
|
||||
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DHAVE_x86_64_elf64_vec -DHAVE_i386_elf32_vec -DHAVE_iamcu_elf32_vec -DHAVE_x86_64_elf32_vec -DHAVE_i386_aout_linux_vec -DHAVE_i386_pei_vec -DHAVE_x86_64_pei_vec -DHAVE_l1om_elf64_vec -DHAVE_k1om_elf64_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I./../zlib -g -O2 -MT pei-x86_64.lo -MD -MP -MF .deps/pei-x86_64.Tpo -c pei-x86_64.c -o pei-x86_64.o
|
||||
In file included from coff-x86_64.c:741:0,
|
||||
from pei-x86_64.c:763:
|
||||
coffcode.h: In function $B!F(Bcoff_new_section_hook$B!G(B:
|
||||
coffcode.h:1817:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
coffsymbol (section->symbol)->native = native;
|
||||
^~~~~~~~~~
|
||||
cc1: all warnings being treated as errors
|
||||
|
||||
--IJpNTDwzlM2Ie8A6--
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
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-btrobust.patch
|
||||
|
||||
;; Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
|
||||
;;=push
|
||||
|
||||
This should fix the error with glib. An error message will still be
|
||||
printed, but a default backtrace will occur in this case.
|
||||
|
||||
--
|
||||
|
||||
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
|
||||
--- a/gdb/python/py-framefilter.c
|
||||
+++ b/gdb/python/py-framefilter.c
|
||||
@@ -1204,6 +1204,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
htab_eq_pointer,
|
||||
NULL));
|
||||
|
||||
+ int count_printed = 0;
|
||||
while (true)
|
||||
{
|
||||
gdbpy_ref<> item (PyIter_Next (iterable.get ()));
|
||||
@@ -1212,8 +1213,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
{
|
||||
if (PyErr_Occurred ())
|
||||
{
|
||||
- gdbpy_print_stack_or_quit ();
|
||||
- return EXT_LANG_BT_ERROR;
|
||||
+ gdbpy_print_stack ();
|
||||
+ return count_printed > 0 ? EXT_LANG_BT_ERROR : EXT_LANG_BT_NO_FILTERS;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1245,7 +1246,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
/* Do not exit on error printing a single frame. Print the
|
||||
error and continue with other frames. */
|
||||
if (success == EXT_LANG_BT_ERROR)
|
||||
- gdbpy_print_stack_or_quit ();
|
||||
+ gdbpy_print_stack ();
|
||||
+ count_printed++;
|
||||
}
|
||||
|
||||
return success;
|
|
@ -0,0 +1,178 @@
|
|||
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-bz1219747-attach-kills.patch
|
||||
|
||||
;; Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747).
|
||||
;;=push+jan
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2015-10/msg00301.html
|
||||
|
||||
Hi,
|
||||
|
||||
in some cases with deleted main executable GDB will want to kill the inferior.
|
||||
|
||||
$ cp /bin/sleep /tmp/sleep;/tmp/sleep 1h&p=$!
|
||||
$ rm /tmp/sleep
|
||||
$ gdb /tmp/sleep $p
|
||||
GNU gdb (GDB) 7.10.50.20151016-cvs
|
||||
/tmp/sleep: No such file or directory.
|
||||
Attaching to process 9694
|
||||
/tmp/sleep (deleted): No such file or directory.
|
||||
A program is being debugged already. Kill it? (y or n) _
|
||||
|
||||
The first attachment of "/tmp/sleep" commandline argument errors at:
|
||||
|
||||
267 if (scratch_chan < 0)
|
||||
268 perror_with_name (filename);
|
||||
1051 if (catch_command_errors_const (exec_file_attach, execarg,
|
||||
1052 !batch_flag))
|
||||
|
||||
Then GDB tries to attach to the process $p:
|
||||
|
||||
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
|
||||
1083 !batch_flag) == 0)
|
||||
|
||||
This succeeds and since this moment GDB has a valid inferior. But despite that
|
||||
the lines
|
||||
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
|
||||
1083 !batch_flag) == 0)
|
||||
still fail because consequently attach_command() fails to find the associated
|
||||
executable file:
|
||||
|
||||
267 if (scratch_chan < 0)
|
||||
268 perror_with_name (filename);
|
||||
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
|
||||
1083 !batch_flag) == 0)
|
||||
|
||||
and therefore GDB executes the following:
|
||||
|
||||
(gdb) bt
|
||||
2179 if (have_inferiors ())
|
||||
2180 {
|
||||
2181 if (!from_tty
|
||||
2182 || !have_live_inferiors ()
|
||||
2183 || query (_("A program is being debugged already. Kill it? ")))
|
||||
2184 iterate_over_inferiors (dispose_inferior, NULL);
|
||||
2185 else
|
||||
2186 error (_("Program not killed."));
|
||||
2187 }
|
||||
1084 catch_command_errors (core_file_command, pid_or_core_arg,
|
||||
1085 !batch_flag);
|
||||
|
||||
No regressions on {x86_64,x86_64-m32,i686}-fedora24pre-linux-gnu.
|
||||
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
gdb/ChangeLog
|
||||
2015-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* main.c (captured_main): Run core_file_command for pid_or_core_arg
|
||||
only if not have_inferiors ().
|
||||
|
||||
gdb/testsuite/ChangeLog
|
||||
2015-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.base/attach-kills.c: New.
|
||||
* gdb.base/attach-kills.exp: New.
|
||||
|
||||
diff --git a/gdb/main.c b/gdb/main.c
|
||||
--- a/gdb/main.c
|
||||
+++ b/gdb/main.c
|
||||
@@ -1199,7 +1199,10 @@ captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
ret = catch_command_errors (attach_command, pid_or_core_arg,
|
||||
!batch_flag);
|
||||
- if (ret == 0)
|
||||
+ if (ret == 0
|
||||
+ /* attach_command could succeed partially and core_file_command
|
||||
+ would try to kill it. */
|
||||
+ && !have_inferiors ())
|
||||
ret = catch_command_errors (core_file_command,
|
||||
pid_or_core_arg,
|
||||
!batch_flag);
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-kills.c b/gdb/testsuite/gdb.base/attach-kills.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-kills.c
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2015 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 (void)
|
||||
+{
|
||||
+ sleep (600);
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-kills.exp b/gdb/testsuite/gdb.base/attach-kills.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-kills.exp
|
||||
@@ -0,0 +1,49 @@
|
||||
+# Copyright (C) 2015 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 { ![can_spawn_for_attach] } {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+standard_testfile
|
||||
+
|
||||
+if { [build_executable ${testfile}.exp $testfile] == -1 } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Start the program running and then wait for a bit, to be sure
|
||||
+# that it can be attached to.
|
||||
+
|
||||
+set test_spawn_id [spawn_wait_for_attach $binfile]
|
||||
+set testpid [spawn_id_get_pid $test_spawn_id]
|
||||
+
|
||||
+remote_exec target "cp -pf -- $binfile $binfile-copy"
|
||||
+remote_exec target "rm -f -- $binfile"
|
||||
+
|
||||
+set test "start gdb"
|
||||
+set res [gdb_spawn_with_cmdline_opts \
|
||||
+ "-iex \"set height 0\" -iex \"set width 0\" /DoEsNoTeXySt $testpid"]
|
||||
+if { $res != 0} {
|
||||
+ fail "$test (spawn)"
|
||||
+ kill_wait_spawned_process $test_spawn_id
|
||||
+ return -1
|
||||
+}
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "\r\nAttaching to .*\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+kill_wait_spawned_process $test_spawn_id
|
|
@ -1,3 +1,11 @@
|
|||
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-bz533176-fortran-omp-step.patch
|
||||
|
||||
;; Fix stepping with OMP parallel Fortran sections (BZ 533176).
|
||||
;;=push+jan: It requires some better DWARF annotations.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=533176#c4
|
||||
|
||||
I find it a bug in DWARF and gdb behaves correctly according to it. From the
|
||||
|
@ -19,26 +27,27 @@ threads is inconvenient. Setting it to "on" will lockup the debugging as the
|
|||
threads need to get synchronized at some point. This is a more general
|
||||
debugging problem of GOMP outside of the scope of this Bug.
|
||||
|
||||
|
||||
|
||||
Index: gdb-7.2.50.20101231/gdb/infrun.c
|
||||
===================================================================
|
||||
--- gdb-7.2.50.20101231.orig/gdb/infrun.c 2011-01-01 01:02:45.000000000 +0100
|
||||
+++ gdb-7.2.50.20101231/gdb/infrun.c 2011-01-01 01:10:22.000000000 +0100
|
||||
@@ -4585,6 +4585,12 @@ infrun: not switching back to stepped th
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -6788,6 +6788,16 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
|
||||
if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
|
||||
{
|
||||
+ struct symbol *stop_fn = find_pc_function (stop_pc);
|
||||
+ struct minimal_symbol *stopf = lookup_minimal_symbol_by_pc (stop_pc).minsym;
|
||||
+
|
||||
+ if (stop_fn == NULL
|
||||
+ || strstr (SYMBOL_LINKAGE_NAME (stop_fn), ".omp_fn.") == NULL)
|
||||
+ if ((stop_fn == NULL
|
||||
+ || strstr (stop_fn->linkage_name (), ".omp_fn.") == NULL)
|
||||
+ /* gcc-4.7.2-9.fc19.x86_64 uses a new format. */
|
||||
+ && (stopf == NULL
|
||||
+ || strstr (stopf->linkage_name (), "._omp_fn.") == NULL))
|
||||
+{ /* ".omp_fn." */
|
||||
+
|
||||
/* We're doing a "next".
|
||||
|
||||
Normal (forward) execution: set a breakpoint at the
|
||||
@@ -4612,6 +4618,7 @@ infrun: not switching back to stepped th
|
||||
@@ -6821,6 +6831,7 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
|
||||
keep_going (ecs);
|
||||
return;
|
||||
|
@ -46,10 +55,10 @@ Index: gdb-7.2.50.20101231/gdb/infrun.c
|
|||
}
|
||||
|
||||
/* If we are in a function call trampoline (a stub between the
|
||||
Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp 2011-01-01 01:09:58.000000000 +0100
|
||||
diff --git a/gdb/testsuite/gdb.fortran/omp-step.exp b/gdb/testsuite/gdb.fortran/omp-step.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.fortran/omp-step.exp
|
||||
@@ -0,0 +1,31 @@
|
||||
+# Copyright 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
|
@ -82,10 +91,10 @@ Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp
|
|||
+
|
||||
+gdb_breakpoint [gdb_get_line_number "success"]
|
||||
+gdb_continue_to_breakpoint "success" ".*success.*"
|
||||
Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90 2011-01-01 01:09:58.000000000 +0100
|
||||
diff --git a/gdb/testsuite/gdb.fortran/omp-step.f90 b/gdb/testsuite/gdb.fortran/omp-step.f90
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.fortran/omp-step.f90
|
||||
@@ -0,0 +1,32 @@
|
||||
+! Copyright 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
|
|
|
@ -1,151 +0,0 @@
|
|||
Index: gdb-7.4.50.20120602/gdb/config/i386/linux64.mh
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/config/i386/linux64.mh 2012-03-13 16:00:34.000000000 +0100
|
||||
+++ gdb-7.4.50.20120602/gdb/config/i386/linux64.mh 2012-06-02 19:56:03.196172503 +0200
|
||||
@@ -4,7 +4,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
linux-nat.o linux-osdata.o \
|
||||
proc-service.o linux-thread-db.o linux-fork.o \
|
||||
linux-procfs.o linux-ptrace.o
|
||||
-NAT_FILE= config/nm-linux.h
|
||||
+NAT_FILE= nm-linux64.h
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
Index: gdb-7.4.50.20120602/gdb/config/i386/linux.mh
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/config/i386/linux.mh 2012-03-13 16:00:33.000000000 +0100
|
||||
+++ gdb-7.4.50.20120602/gdb/config/i386/linux.mh 2012-06-02 19:55:42.418178412 +0200
|
||||
@@ -1,6 +1,6 @@
|
||||
# Host: Intel 386 running GNU/Linux.
|
||||
|
||||
-NAT_FILE= config/nm-linux.h
|
||||
+NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
i386-nat.o i386-linux-nat.o \
|
||||
proc-service.o linux-thread-db.o \
|
||||
Index: gdb-7.4.50.20120602/gdb/config/i386/nm-linux.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20120602/gdb/config/i386/nm-linux.h 2012-06-02 19:55:42.433178408 +0200
|
||||
@@ -0,0 +1,28 @@
|
||||
+/* Native support for GNU/Linux i386.
|
||||
+
|
||||
+ 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/>. */
|
||||
+
|
||||
+#ifndef NM_LINUX_H
|
||||
+#define NM_LINUX_H
|
||||
+
|
||||
+#include "config/nm-linux.h"
|
||||
+
|
||||
+/* Red Hat backward compatibility with gdb-6.8. */
|
||||
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
|
||||
+
|
||||
+#endif /* NM_LINUX64_H */
|
||||
Index: gdb-7.4.50.20120602/gdb/config/i386/nm-linux64.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20120602/gdb/config/i386/nm-linux64.h 2012-06-02 19:55:42.434178407 +0200
|
||||
@@ -0,0 +1,28 @@
|
||||
+/* Native support for GNU/Linux amd64.
|
||||
+
|
||||
+ 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/>. */
|
||||
+
|
||||
+#ifndef NM_LINUX64_H
|
||||
+#define NM_LINUX64_H
|
||||
+
|
||||
+#include "config/nm-linux.h"
|
||||
+
|
||||
+/* Red Hat backward compatibility with gdb-6.8. */
|
||||
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
|
||||
+
|
||||
+#endif /* NM_LINUX64_H */
|
||||
Index: gdb-7.4.50.20120602/gdb/target.h
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120602.orig/gdb/target.h 2012-06-01 18:37:59.000000000 +0200
|
||||
+++ gdb-7.4.50.20120602/gdb/target.h 2012-06-02 19:55:42.436178407 +0200
|
||||
@@ -1470,8 +1470,10 @@ extern char *target_thread_name (struct
|
||||
bp_hardware_breakpoint. CNT is the number of such watchpoints used so far
|
||||
(including this one?). OTHERTYPE is who knows what... */
|
||||
|
||||
+#ifndef target_can_use_hardware_watchpoint
|
||||
#define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
|
||||
(*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
|
||||
+#endif
|
||||
|
||||
/* Returns the number of debug registers needed to watch the given
|
||||
memory region, or zero if not supported. */
|
||||
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2012-06-02 19:55:42.442178406 +0200
|
||||
@@ -0,0 +1,40 @@
|
||||
+# Copyright 2009, 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/>.
|
||||
+
|
||||
+# Arch not supporting hw watchpoints does not imply no_hardware_watchpoints set.
|
||||
+if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
|
||||
+ && ![istarget "ia64-*-*"])
|
||||
+ || [target_info exists gdb,no_hardware_watchpoints]} then {
|
||||
+ verbose "Skipping watchpoint-hw-before-run test."
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set test watchpoint-hw-before-run
|
||||
+set srcfile watchpoint-hw-hit-once.c
|
||||
+if { [prepare_for_testing ${test}.exp ${test} ${srcfile}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_test "rwatch watchee" "ardware read watchpoint 1: watchee"
|
||||
+
|
||||
+# `runto_main' or `runto main' would delete the watchpoint created above.
|
||||
+
|
||||
+if { [gdb_start_cmd] < 0 } {
|
||||
+ untested start
|
||||
+ return -1
|
||||
+}
|
||||
+gdb_test "" "main .* at .*" "start"
|
||||
+
|
||||
+gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
|
|
@ -1,68 +0,0 @@
|
|||
http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
|
||||
Subject: [rfc patch] nomem: internal_error -> error
|
||||
|
||||
Hi,
|
||||
|
||||
unfortunately I see this problem reproducible only with the
|
||||
archer-jankratochvil-vla branch (VLA = Variable Length Arrays - char[var]).
|
||||
OTOH this branch I hopefully submit in some form for FSF GDB later.
|
||||
|
||||
In this case (a general problem but tested for example on Fedora 13 i686):
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
char a[argc];
|
||||
return a[0];
|
||||
}
|
||||
|
||||
(gdb) start
|
||||
(gdb) print a
|
||||
../../gdb/utils.c:1251: internal-error: virtual memory exhausted: can't allocate 4294951689 bytes.
|
||||
|
||||
It is apparently because boundary for the variable `a' is not initialized
|
||||
there. Users notice it due to Eclipse-CDT trying to automatically display all
|
||||
the local variables on each step.
|
||||
|
||||
|
||||
Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
|
||||
But is anone aware of the reasons to use internal_error there?
|
||||
I find simple error as a perfectly reasonable there.
|
||||
(history only tracks it since the initial import)
|
||||
|
||||
IIRC this idea has been discussed with Tom Tromey, not sure of its origin.
|
||||
|
||||
I understand it may be offtopic for FSF GDB but from some GDB crashes I am not
|
||||
sure if it can happen only due to the VLA variables.
|
||||
|
||||
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
|
||||
gdb/
|
||||
2010-06-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* utils.c (nomem): Change internal_error to error.
|
||||
|
||||
Index: gdb-7.3.50.20110722/gdb/utils.c
|
||||
===================================================================
|
||||
--- gdb-7.3.50.20110722.orig/gdb/utils.c 2011-07-22 19:28:58.000000000 +0200
|
||||
+++ gdb-7.3.50.20110722/gdb/utils.c 2011-07-22 19:34:25.000000000 +0200
|
||||
@@ -1219,13 +1219,11 @@ malloc_failure (long size)
|
||||
{
|
||||
if (size > 0)
|
||||
{
|
||||
- internal_error (__FILE__, __LINE__,
|
||||
- _("virtual memory exhausted: can't allocate %ld bytes."),
|
||||
- size);
|
||||
+ error (_("virtual memory exhausted: can't allocate %ld bytes."), size);
|
||||
}
|
||||
else
|
||||
{
|
||||
- internal_error (__FILE__, __LINE__, _("virtual memory exhausted."));
|
||||
+ error (_("virtual memory exhausted."));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,15 @@
|
|||
--- /dev/null 2010-06-08 20:35:46.800278452 +0200
|
||||
+++ gdb-7.1/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S 2010-06-09 15:22:57.000000000 +0200
|
||||
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-bz601887-dwarf4-rh-test.patch
|
||||
|
||||
;; Backport DWARF-4 support (BZ 601887, Tom Tromey).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S
|
||||
@@ -0,0 +1,167 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
|
@ -168,8 +178,10 @@
|
|||
+ .string "main"
|
||||
+ .ident "GCC: (GNU) 4.4.4 20100503 (Red Hat 4.4.4-2)"
|
||||
+ .section .note.GNU-stack,"",@progbits
|
||||
--- /dev/null 2010-06-08 20:35:46.800278452 +0200
|
||||
+++ gdb-7.1/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c 2010-06-09 15:21:35.000000000 +0200
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c
|
||||
@@ -0,0 +1,22 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
|
@ -193,8 +205,10 @@
|
|||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
--- /dev/null 2010-06-08 20:35:46.800278452 +0200
|
||||
+++ gdb-7.1/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp 2010-06-09 15:26:21.000000000 +0200
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp
|
||||
@@ -0,0 +1,42 @@
|
||||
+# Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
|
@ -229,7 +243,7 @@
|
|||
+set testfile "rh-dwarf4-x86_64"
|
||||
+set srcfile ${testfile}.S
|
||||
+set executable ${testfile}.x
|
||||
+set binfile ${objdir}/${subdir}/${executable}
|
||||
+set binfile [standard_output_file ${executable}]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
|
||||
+ return -1
|
||||
|
|
|
@ -1,169 +0,0 @@
|
|||
gdb:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=623749
|
||||
kernel:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=636937
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2010-09/msg00395.html
|
||||
Subject: Re: [patch] Fix gcore writer for -Wl,-z,relro (PR corefiles/11804)
|
||||
|
||||
gdb/testsuite/
|
||||
2010-09-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Fix gcore writer for -Wl,-z,relro.
|
||||
* gdb.base/gcore-relro.exp: New file.
|
||||
* gdb.base/gcore-relro-main.c: New file.
|
||||
* gdb.base/gcore-relro-lib.c: New file.
|
||||
|
||||
--- ./gdb/gcore.c 2010-09-23 20:14:56.000000000 +0200
|
||||
+++ ./gdb/gcore.c 2010-09-23 20:37:56.000000000 +0200
|
||||
@@ -401,6 +401,7 @@ gcore_create_callback (CORE_ADDR vaddr,
|
||||
|
||||
if (write == 0 && !solib_keep_data_in_core (vaddr, size))
|
||||
{
|
||||
+#if 0 /* https://bugzilla.redhat.com/show_bug.cgi?id=636937 */
|
||||
/* See if this region of memory lies inside a known file on disk.
|
||||
If so, we can avoid copying its contents by clearing SEC_LOAD. */
|
||||
struct objfile *objfile;
|
||||
@@ -433,6 +434,7 @@ gcore_create_callback (CORE_ADDR vaddr,
|
||||
}
|
||||
|
||||
keep:
|
||||
+#endif
|
||||
flags |= SEC_READONLY;
|
||||
}
|
||||
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-relro-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)
|
||||
+{
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-relro-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;
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-relro.exp
|
||||
@@ -0,0 +1,80 @@
|
||||
+# 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_shlib_tests]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "gcore-relro"
|
||||
+set srcmainfile ${testfile}-main.c
|
||||
+set srclibfile ${testfile}-lib.c
|
||||
+set libfile ${objdir}/${subdir}/${testfile}-lib.so
|
||||
+set objfile ${objdir}/${subdir}/${testfile}-main.o
|
||||
+set executable ${testfile}-main
|
||||
+set binfile ${objdir}/${subdir}/${executable}
|
||||
+set gcorefile ${objdir}/${subdir}/${executable}.gcore
|
||||
+
|
||||
+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} {debug}] != ""
|
||||
+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
|
||||
+ untested ${testfile}.exp
|
||||
+ return -1
|
||||
+}
|
||||
+set opts [list debug shlib=${libfile} additional_flags=-Wl,-z,relro]
|
||||
+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
|
||||
+ unsupported "-Wl,-z,relro compilation failed"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+clean_restart $executable
|
||||
+gdb_load_shlibs $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_shlibs $libfile
|
||||
+
|
||||
+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
|
||||
+
|
||||
+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
|
|
@ -1,7 +1,17 @@
|
|||
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-bz634108-solib_address.patch
|
||||
|
||||
;; Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
|
||||
;;=fedoratest
|
||||
|
||||
Fix gdb.solib_address (fix by Phil Muldoon).
|
||||
|
||||
s/solib_address/solib_name/ during upstreaming.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
|
||||
@@ -0,0 +1,24 @@
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
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-ccache-workaround.patch
|
||||
|
||||
;; Workaround ccache making lineno non-zero for command-line definitions.
|
||||
;;=fedoratest: ccache is rarely used and it is even fixed now.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
|
||||
--- a/gdb/testsuite/gdb.base/macscp.exp
|
||||
+++ b/gdb/testsuite/gdb.base/macscp.exp
|
||||
@@ -33,6 +33,14 @@ if [test_compiler_info gcc*] {
|
||||
@@ -25,6 +25,14 @@ if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
|
||||
lappend options additional_flags=-g3
|
||||
}
|
||||
|
||||
|
|
1002
gdb-check-type.patch
1002
gdb-check-type.patch
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,56 @@
|
|||
diff -Nrup a/gnulib/import/m4/alloca.m4 b/gnulib/import/m4/alloca.m4
|
||||
--- a/gnulib/import/m4/alloca.m4 2019-11-18 18:49:20.000000000 -0700
|
||||
+++ b/gnulib/import/m4/alloca.m4 2020-01-11 01:07:36.200483085 -0700
|
||||
@@ -89,7 +89,7 @@ AC_CACHE_CHECK([stack direction for C al
|
||||
[ac_cv_c_stack_direction],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE(
|
||||
[AC_INCLUDES_DEFAULT
|
||||
-int
|
||||
+__attribute__ (noinline,noclone)) int
|
||||
find_stack_direction (int *addr, int depth)
|
||||
{
|
||||
int dir, dummy = 0;
|
||||
diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
|
||||
--- a/libiberty/aclocal.m4 2019-01-19 09:01:34.000000000 -0700
|
||||
+++ b/libiberty/aclocal.m4 2020-01-09 22:00:27.183312982 -0700
|
||||
@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
|
||||
-[AC_TRY_RUN([find_stack_direction ()
|
||||
+[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction ()
|
||||
{
|
||||
static char *addr = 0;
|
||||
auto char dummy;
|
||||
diff --git a/config/intdiv0.m4 b/config/intdiv0.m4
|
||||
index 55dddcf1..ba906efc 100644
|
||||
--- a/config/intdiv0.m4
|
||||
+++ b/config/intdiv0.m4
|
||||
@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig;
|
||||
exit (sig != SIGFPE);
|
||||
}
|
||||
|
||||
-int x = 1;
|
||||
-int y = 0;
|
||||
-int z;
|
||||
-int nan;
|
||||
+volatile int x = 1;
|
||||
+volatile int y = 0;
|
||||
+volatile int z;
|
||||
+volatile int nan;
|
||||
|
||||
int main ()
|
||||
{
|
||||
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
|
||||
index f1ce7601..fc20d228 100644
|
||||
--- a/libiberty/configure.ac
|
||||
+++ b/libiberty/configure.ac
|
||||
@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then
|
||||
for v in $vars; do
|
||||
AC_MSG_CHECKING([for $v])
|
||||
AC_CACHE_VAL(libiberty_cv_var_$v,
|
||||
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
|
||||
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])],
|
||||
[eval "libiberty_cv_var_$v=yes"],
|
||||
[eval "libiberty_cv_var_$v=no"])])
|
||||
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
|
|
@ -0,0 +1,30 @@
|
|||
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-container-rh-pkg.patch
|
||||
|
||||
;; Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
|
||||
;;=fedora
|
||||
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -14031,7 +14031,17 @@ remote_target::pid_to_exec_file (int pid)
|
||||
char *annex = NULL;
|
||||
|
||||
if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE)
|
||||
- return NULL;
|
||||
+ {
|
||||
+ warning (_("Remote gdbserver does not support determining executable "
|
||||
+ "automatically.\n"
|
||||
+"RHEL <=6.8 and <=7.2 versions of gdbserver do not support such automatic executable detection.\n"
|
||||
+"The following versions of gdbserver support it:\n"
|
||||
+"- Upstream version of gdbserver (unsupported) 7.10 or later\n"
|
||||
+"- Red Hat Developer Toolset (DTS) version of gdbserver from DTS 4.0 or later (only on x86_64)\n"
|
||||
+"- RHEL-7.3 versions of gdbserver (on any architecture)"
|
||||
+));
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
inferior *inf = find_inferior_pid (this, pid);
|
||||
if (inf == NULL)
|
|
@ -1,106 +1,33 @@
|
|||
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-core-open-vdso-warning.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@.*>
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
|
||||
Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
||||
|
||||
[ New patch variant. ]
|
||||
|
||||
Index: gdb-7.4.50.20120703/gdb/solib-svr4.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/solib-svr4.c 2012-07-06 15:39:57.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/solib-svr4.c 2012-07-06 15:40:01.124816148 +0200
|
||||
@@ -1221,8 +1221,17 @@ svr4_read_so_list (CORE_ADDR lm, struct
|
||||
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
|
||||
if (errcode != 0)
|
||||
{
|
||||
- warning (_("Can't read pathname for load map: %s."),
|
||||
- safe_strerror (errcode));
|
||||
+ /* During the first ever DSO list reading some strings may be
|
||||
+ unreadable as residing in the ld.so readonly memory not being
|
||||
+ present in a dumped core file. Delay the error check after
|
||||
+ the first pass of DSO list scanning when ld.so should be
|
||||
+ already mapped in and all the DSO list l_name memory gets
|
||||
+ readable. */
|
||||
+
|
||||
+ if (master_so_list () != NULL)
|
||||
+ warning (_("Can't read pathname for load map: %s."),
|
||||
+ safe_strerror (errcode));
|
||||
+
|
||||
do_cleanups (old_chain);
|
||||
continue;
|
||||
}
|
||||
Index: gdb-7.4.50.20120703/gdb/solib.c
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/solib.c 2012-07-06 15:38:39.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/solib.c 2012-07-06 15:40:01.125816147 +0200
|
||||
@@ -672,7 +672,7 @@ solib_used (const struct so_list *const
|
||||
processes we've just attached to, so that's okay. */
|
||||
|
||||
static void
|
||||
-update_solib_list (int from_tty, struct target_ops *target)
|
||||
+update_solib_list_1 (int from_tty, struct target_ops *target)
|
||||
{
|
||||
struct target_so_ops *ops = solib_ops (target_gdbarch);
|
||||
struct so_list *inferior = ops->current_sos();
|
||||
@@ -843,6 +843,21 @@ Do you need \"set solib-search-path\" or
|
||||
}
|
||||
}
|
||||
|
||||
+/* Wrapper for Fedora: gdb-core-open-vdso-warning.patch */
|
||||
+
|
||||
+static void
|
||||
+update_solib_list (int from_tty, struct target_ops *target)
|
||||
+{
|
||||
+ struct so_list *saved_so_list_head = so_list_head;
|
||||
+
|
||||
+ update_solib_list_1 (from_tty, target);
|
||||
+
|
||||
+ /* If this was the very first DSO list scan and we possibly read in ld.so
|
||||
+ recheck all the formerly unreadable DSO names strings. */
|
||||
+
|
||||
+ if (saved_so_list_head == NULL && so_list_head != NULL)
|
||||
+ update_solib_list_1 (from_tty, target);
|
||||
+}
|
||||
|
||||
/* Return non-zero if NAME is the libpthread shared library.
|
||||
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/corefile.exp 2012-07-06 15:39:41.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp 2012-07-06 15:40:10.322805539 +0200
|
||||
@@ -286,3 +286,19 @@ if {$buildid == ""} {
|
||||
gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
|
||||
pass $wholetest
|
||||
}
|
||||
+
|
||||
+
|
||||
+# Test Linux specific vDSO warning:
|
||||
+# warning: Can't read pathname for load map: Input/output error.
|
||||
+
|
||||
+clean_restart ${testfile}
|
||||
+
|
||||
+set test "core-file vdso warning"
|
||||
+gdb_test_multiple "core-file $corefile" $test {
|
||||
+ -re "warning: Can't read pathname for load map: Input/output error\\.\r\n.*\r\n$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+ -re "\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/solib-symbol.exp
|
||||
===================================================================
|
||||
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2012-07-06 15:38:39.000000000 +0200
|
||||
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/solib-symbol.exp 2012-07-06 15:40:01.127816145 +0200
|
||||
@@ -27,7 +27,8 @@ set lib_flags [list debug ldflags=-Wl,-B
|
||||
# Binary file.
|
||||
set testfile "solib-symbol-main"
|
||||
commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f
|
||||
Author: Ulrich Weigand <uweigand@de.ibm.com>
|
||||
Date: Wed Sep 25 11:52:50 2013 +0000
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp
|
||||
--- a/gdb/testsuite/gdb.base/solib-symbol.exp
|
||||
+++ b/gdb/testsuite/gdb.base/solib-symbol.exp
|
||||
@@ -29,6 +29,7 @@ set testfile "solib-symbol-main"
|
||||
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
-set binfile ${objdir}/${subdir}/${testfile}
|
||||
+set executable ${testfile}
|
||||
+set binfile ${objdir}/${subdir}/${executable}
|
||||
set binfile [standard_output_file ${testfile}]
|
||||
set bin_flags [list debug shlib=${binfile_lib}]
|
||||
+set executable ${testfile}
|
||||
|
||||
if [get_compiler_info] {
|
||||
@@ -72,8 +73,26 @@ gdb_test "br foo2" \
|
||||
return -1
|
||||
@@ -71,8 +72,26 @@ gdb_test "br foo2" \
|
||||
"Breakpoint.*: foo2. .2 locations..*" \
|
||||
"foo2 in mdlib"
|
||||
|
||||
|
|
|
@ -1,795 +0,0 @@
|
|||
http://sourceware.org/ml/gdb-cvs/2012-07/msg00123.html
|
||||
|
||||
### src/gdb/ChangeLog 2012/07/18 04:36:15 1.14473
|
||||
### src/gdb/ChangeLog 2012/07/18 16:12:15 1.14474
|
||||
## -1,3 +1,37 @@
|
||||
+2012-07-18 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||
+
|
||||
+ * elfread.c (elf_get_probe_argument_count): Remove `objfile' argument.
|
||||
+ (elf_compile_to_ax): Likewise.
|
||||
+ * infrun.c (insert_exception_resume_from_probe): Likewise.
|
||||
+ (check_exception_resume): Remove `objfile' variable.
|
||||
+ * probe.c (find_probe_by_pc): Remove `objfile' argument.
|
||||
+ (struct probe_and_objfile, probe_and_objfile_s): Delete.
|
||||
+ (collect_probes): Adjust return value to `VEC (probe_p) *'.
|
||||
+ (compare_entries): Rename to...
|
||||
+ (compare_probes): ...this. Adjust function to work with
|
||||
+ `struct probe *'. Rename variables `ea' and `eb' to `pa' and `pb'
|
||||
+ respectively.
|
||||
+ (gen_ui_out_table_header_info): Adjust `probes' argument to be
|
||||
+ `VEC (probe_p) *'.
|
||||
+ (print_ui_out_info): Adjust argument to be `struct probe *'.
|
||||
+ (info_probes_for_ops): Adjust internal computations to use
|
||||
+ `VEC (probe_p) *'.
|
||||
+ (probe_safe_evaluate_at_pc): Refactor to not pass `objfile' anymore.
|
||||
+ * probe.h (struct probe_ops) <get_probe_argument_count, compile_to_ax,
|
||||
+ gen_info_probes_table_values>: Remove `objfile' argument.
|
||||
+ (struct probe) <objfile>: New field.
|
||||
+ (find_probe_by_pc): Remove `objfile' argument.
|
||||
+ * stap-probe.c (stap_parse_probe_arguments): Likewise.
|
||||
+ (stap_get_probe_argument_count): Likewise.
|
||||
+ (stap_get_arg): Likewise.
|
||||
+ (stap_evaluate_probe_argument): Likewise.
|
||||
+ (stap_compile_to_ax): Likewise.
|
||||
+ (compile_probe_arg): Refactor not to pass `objfile' anymore.
|
||||
+ (handle_stap_probe): Fill `objfile' field from `struct probe'.
|
||||
+ (stap_gen_info_probes_table_header): Remove `objfile' argument.
|
||||
+ * symfile.h (struct sym_probe_fns) <sym_evaluate_probe_argument,
|
||||
+ sym_compile_to_ax>: Likewise.
|
||||
+
|
||||
2012-07-18 Terry Guo <terry.guo@arm.com>
|
||||
|
||||
PR 14329
|
||||
--- src/gdb/elfread.c 2012/06/26 20:14:01 1.133
|
||||
+++ src/gdb/elfread.c 2012/07/18 16:12:15 1.134
|
||||
@@ -1635,33 +1635,29 @@
|
||||
symfile.h. */
|
||||
|
||||
static unsigned
|
||||
-elf_get_probe_argument_count (struct objfile *objfile,
|
||||
- struct probe *probe)
|
||||
+elf_get_probe_argument_count (struct probe *probe)
|
||||
{
|
||||
- return probe->pops->get_probe_argument_count (probe, objfile);
|
||||
+ return probe->pops->get_probe_argument_count (probe);
|
||||
}
|
||||
|
||||
/* Implementation of `sym_evaluate_probe_argument', as documented in
|
||||
symfile.h. */
|
||||
|
||||
static struct value *
|
||||
-elf_evaluate_probe_argument (struct objfile *objfile,
|
||||
- struct probe *probe,
|
||||
- unsigned n)
|
||||
+elf_evaluate_probe_argument (struct probe *probe, unsigned n)
|
||||
{
|
||||
- return probe->pops->evaluate_probe_argument (probe, objfile, n);
|
||||
+ return probe->pops->evaluate_probe_argument (probe, n);
|
||||
}
|
||||
|
||||
/* Implementation of `sym_compile_to_ax', as documented in symfile.h. */
|
||||
|
||||
static void
|
||||
-elf_compile_to_ax (struct objfile *objfile,
|
||||
- struct probe *probe,
|
||||
+elf_compile_to_ax (struct probe *probe,
|
||||
struct agent_expr *expr,
|
||||
struct axs_value *value,
|
||||
unsigned n)
|
||||
{
|
||||
- probe->pops->compile_to_ax (probe, objfile, expr, value, n);
|
||||
+ probe->pops->compile_to_ax (probe, expr, value, n);
|
||||
}
|
||||
|
||||
/* Implementation of `sym_relocate_probe', as documented in symfile.h. */
|
||||
--- src/gdb/infrun.c 2012/07/01 10:37:04 1.549
|
||||
+++ src/gdb/infrun.c 2012/07/18 16:12:16 1.550
|
||||
@@ -5518,7 +5518,6 @@
|
||||
static void
|
||||
insert_exception_resume_from_probe (struct thread_info *tp,
|
||||
const struct probe *probe,
|
||||
- struct objfile *objfile,
|
||||
struct frame_info *frame)
|
||||
{
|
||||
struct value *arg_value;
|
||||
@@ -5534,7 +5533,7 @@
|
||||
if (debug_infrun)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"infrun: exception resume at %s\n",
|
||||
- paddress (get_objfile_arch (objfile),
|
||||
+ paddress (get_objfile_arch (probe->objfile),
|
||||
handler));
|
||||
|
||||
bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame),
|
||||
@@ -5552,7 +5551,6 @@
|
||||
struct frame_info *frame)
|
||||
{
|
||||
volatile struct gdb_exception e;
|
||||
- struct objfile *objfile;
|
||||
const struct probe *probe;
|
||||
struct symbol *func;
|
||||
|
||||
@@ -5560,11 +5558,10 @@
|
||||
SystemTap probe point. If so, the probe has two arguments: the
|
||||
CFA and the HANDLER. We ignore the CFA, extract the handler, and
|
||||
set a breakpoint there. */
|
||||
- probe = find_probe_by_pc (get_frame_pc (frame), &objfile);
|
||||
+ probe = find_probe_by_pc (get_frame_pc (frame));
|
||||
if (probe)
|
||||
{
|
||||
- insert_exception_resume_from_probe (ecs->event_thread, probe,
|
||||
- objfile, frame);
|
||||
+ insert_exception_resume_from_probe (ecs->event_thread, probe, frame);
|
||||
return;
|
||||
}
|
||||
|
||||
--- src/gdb/probe.c 2012/05/08 01:35:34 1.3
|
||||
+++ src/gdb/probe.c 2012/07/18 16:12:17 1.4
|
||||
@@ -204,7 +204,7 @@
|
||||
/* See definition in probe.h. */
|
||||
|
||||
struct probe *
|
||||
-find_probe_by_pc (CORE_ADDR pc, struct objfile **objfile_out)
|
||||
+find_probe_by_pc (CORE_ADDR pc)
|
||||
{
|
||||
struct objfile *objfile;
|
||||
|
||||
@@ -221,10 +221,7 @@
|
||||
probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
|
||||
for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++)
|
||||
if (probe->address == pc)
|
||||
- {
|
||||
- *objfile_out = objfile;
|
||||
- return probe;
|
||||
- }
|
||||
+ return probe;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -232,21 +229,6 @@
|
||||
|
||||
|
||||
|
||||
-/* A utility structure. A VEC of these is built when handling "info
|
||||
- probes". */
|
||||
-
|
||||
-struct probe_and_objfile
|
||||
-{
|
||||
- /* The probe. */
|
||||
- struct probe *probe;
|
||||
-
|
||||
- /* The probe's objfile. */
|
||||
- struct objfile *objfile;
|
||||
-};
|
||||
-
|
||||
-typedef struct probe_and_objfile probe_and_objfile_s;
|
||||
-DEF_VEC_O (probe_and_objfile_s);
|
||||
-
|
||||
/* A helper function for collect_probes that compiles a regexp and
|
||||
throws an exception on error. This installs a cleanup to free the
|
||||
resulting pattern on success. If RX is NULL, this does nothing. */
|
||||
@@ -275,16 +257,16 @@
|
||||
If POPS is not NULL, only probes of this certain probe_ops will match.
|
||||
Each argument is a regexp, or NULL, which matches anything. */
|
||||
|
||||
-static VEC (probe_and_objfile_s) *
|
||||
+static VEC (probe_p) *
|
||||
collect_probes (char *objname, char *provider, char *probe_name,
|
||||
const struct probe_ops *pops)
|
||||
{
|
||||
struct objfile *objfile;
|
||||
- VEC (probe_and_objfile_s) *result = NULL;
|
||||
+ VEC (probe_p) *result = NULL;
|
||||
struct cleanup *cleanup, *cleanup_temps;
|
||||
regex_t obj_pat, prov_pat, probe_pat;
|
||||
|
||||
- cleanup = make_cleanup (VEC_cleanup (probe_and_objfile_s), &result);
|
||||
+ cleanup = make_cleanup (VEC_cleanup (probe_p), &result);
|
||||
|
||||
cleanup_temps = make_cleanup (null_cleanup, NULL);
|
||||
compile_rx_or_error (&prov_pat, provider, _("Invalid provider regexp"));
|
||||
@@ -310,8 +292,6 @@
|
||||
|
||||
for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++)
|
||||
{
|
||||
- probe_and_objfile_s entry;
|
||||
-
|
||||
if (pops != NULL && probe->pops != pops)
|
||||
continue;
|
||||
|
||||
@@ -323,9 +303,7 @@
|
||||
&& regexec (&probe_pat, probe->name, 0, NULL, 0) != 0)
|
||||
continue;
|
||||
|
||||
- entry.probe = probe;
|
||||
- entry.objfile = objfile;
|
||||
- VEC_safe_push (probe_and_objfile_s, result, &entry);
|
||||
+ VEC_safe_push (probe_p, result, probe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,36 +312,36 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
-/* A qsort comparison function for probe_and_objfile_s objects. */
|
||||
+/* A qsort comparison function for probe_p objects. */
|
||||
|
||||
static int
|
||||
-compare_entries (const void *a, const void *b)
|
||||
+compare_probes (const void *a, const void *b)
|
||||
{
|
||||
- const probe_and_objfile_s *ea = a;
|
||||
- const probe_and_objfile_s *eb = b;
|
||||
+ const struct probe *pa = *((const struct probe **) a);
|
||||
+ const struct probe *pb = *((const struct probe **) b);
|
||||
int v;
|
||||
|
||||
- v = strcmp (ea->probe->provider, eb->probe->provider);
|
||||
+ v = strcmp (pa->provider, pb->provider);
|
||||
if (v)
|
||||
return v;
|
||||
|
||||
- v = strcmp (ea->probe->name, eb->probe->name);
|
||||
+ v = strcmp (pa->name, pb->name);
|
||||
if (v)
|
||||
return v;
|
||||
|
||||
- if (ea->probe->address < eb->probe->address)
|
||||
+ if (pa->address < pb->address)
|
||||
return -1;
|
||||
- if (ea->probe->address > eb->probe->address)
|
||||
+ if (pa->address > pb->address)
|
||||
return 1;
|
||||
|
||||
- return strcmp (ea->objfile->name, eb->objfile->name);
|
||||
+ return strcmp (pa->objfile->name, pb->objfile->name);
|
||||
}
|
||||
|
||||
/* Helper function that generate entries in the ui_out table being
|
||||
crafted by `info_probes_for_ops'. */
|
||||
|
||||
static void
|
||||
-gen_ui_out_table_header_info (VEC (probe_and_objfile_s) *probes,
|
||||
+gen_ui_out_table_header_info (VEC (probe_p) *probes,
|
||||
const struct probe_ops *p)
|
||||
{
|
||||
/* `headings' refers to the names of the columns when printing `info
|
||||
@@ -392,11 +370,11 @@
|
||||
VEC_iterate (info_probe_column_s, headings, ix, column);
|
||||
++ix)
|
||||
{
|
||||
- probe_and_objfile_s *entry;
|
||||
+ struct probe *probe;
|
||||
int jx;
|
||||
size_t size_max = strlen (column->print_name);
|
||||
|
||||
- for (jx = 0; VEC_iterate (probe_and_objfile_s, probes, jx, entry); ++jx)
|
||||
+ for (jx = 0; VEC_iterate (probe_p, probes, jx, probe); ++jx)
|
||||
{
|
||||
/* `probe_fields' refers to the values of each new field that this
|
||||
probe will display. */
|
||||
@@ -405,12 +383,11 @@
|
||||
const char *val;
|
||||
int kx;
|
||||
|
||||
- if (entry->probe->pops != p)
|
||||
+ if (probe->pops != p)
|
||||
continue;
|
||||
|
||||
c2 = make_cleanup (VEC_cleanup (const_char_ptr), &probe_fields);
|
||||
- p->gen_info_probes_table_values (entry->probe, entry->objfile,
|
||||
- &probe_fields);
|
||||
+ p->gen_info_probes_table_values (probe, &probe_fields);
|
||||
|
||||
gdb_assert (VEC_length (const_char_ptr, probe_fields)
|
||||
== headings_size);
|
||||
@@ -437,10 +414,10 @@
|
||||
}
|
||||
|
||||
/* Helper function to print extra information about a probe and an objfile
|
||||
- represented by ENTRY. */
|
||||
+ represented by PROBE. */
|
||||
|
||||
static void
|
||||
-print_ui_out_info (probe_and_objfile_s *entry)
|
||||
+print_ui_out_info (struct probe *probe)
|
||||
{
|
||||
int ix;
|
||||
int j = 0;
|
||||
@@ -451,23 +428,21 @@
|
||||
info_probe_column_s *column;
|
||||
struct cleanup *c;
|
||||
|
||||
- gdb_assert (entry != NULL);
|
||||
- gdb_assert (entry->probe != NULL);
|
||||
- gdb_assert (entry->probe->pops != NULL);
|
||||
+ gdb_assert (probe != NULL);
|
||||
+ gdb_assert (probe->pops != NULL);
|
||||
|
||||
- if (entry->probe->pops->gen_info_probes_table_header == NULL
|
||||
- && entry->probe->pops->gen_info_probes_table_values == NULL)
|
||||
+ if (probe->pops->gen_info_probes_table_header == NULL
|
||||
+ && probe->pops->gen_info_probes_table_values == NULL)
|
||||
return;
|
||||
|
||||
- gdb_assert (entry->probe->pops->gen_info_probes_table_header != NULL
|
||||
- && entry->probe->pops->gen_info_probes_table_values != NULL);
|
||||
+ gdb_assert (probe->pops->gen_info_probes_table_header != NULL
|
||||
+ && probe->pops->gen_info_probes_table_values != NULL);
|
||||
|
||||
c = make_cleanup (VEC_cleanup (info_probe_column_s), &headings);
|
||||
make_cleanup (VEC_cleanup (const_char_ptr), &values);
|
||||
|
||||
- entry->probe->pops->gen_info_probes_table_header (&headings);
|
||||
- entry->probe->pops->gen_info_probes_table_values (entry->probe,
|
||||
- entry->objfile, &values);
|
||||
+ probe->pops->gen_info_probes_table_header (&headings);
|
||||
+ probe->pops->gen_info_probes_table_values (probe, &values);
|
||||
|
||||
gdb_assert (VEC_length (info_probe_column_s, headings)
|
||||
== VEC_length (const_char_ptr, values));
|
||||
@@ -515,16 +490,16 @@
|
||||
void
|
||||
info_probes_for_ops (char *arg, int from_tty, const struct probe_ops *pops)
|
||||
{
|
||||
- char *provider, *probe = NULL, *objname = NULL;
|
||||
+ char *provider, *probe_name = NULL, *objname = NULL;
|
||||
struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
|
||||
- VEC (probe_and_objfile_s) *items;
|
||||
+ VEC (probe_p) *probes;
|
||||
int i, any_found;
|
||||
int ui_out_extra_fields = 0;
|
||||
size_t size_addr;
|
||||
size_t size_name = strlen ("Name");
|
||||
size_t size_objname = strlen ("Object");
|
||||
size_t size_provider = strlen ("Provider");
|
||||
- probe_and_objfile_s *entry;
|
||||
+ struct probe *probe;
|
||||
struct gdbarch *gdbarch = get_current_arch ();
|
||||
|
||||
/* Do we have a `provider:probe:objfile' style of linespec? */
|
||||
@@ -533,10 +508,10 @@
|
||||
{
|
||||
make_cleanup (xfree, provider);
|
||||
|
||||
- probe = extract_arg (&arg);
|
||||
- if (probe)
|
||||
+ probe_name = extract_arg (&arg);
|
||||
+ if (probe_name)
|
||||
{
|
||||
- make_cleanup (xfree, probe);
|
||||
+ make_cleanup (xfree, probe_name);
|
||||
|
||||
objname = extract_arg (&arg);
|
||||
if (objname)
|
||||
@@ -564,28 +539,27 @@
|
||||
else
|
||||
ui_out_extra_fields = get_number_extra_fields (pops);
|
||||
|
||||
- items = collect_probes (objname, provider, probe, pops);
|
||||
- make_cleanup (VEC_cleanup (probe_and_objfile_s), &items);
|
||||
+ probes = collect_probes (objname, provider, probe_name, pops);
|
||||
+ make_cleanup (VEC_cleanup (probe_p), &probes);
|
||||
make_cleanup_ui_out_table_begin_end (current_uiout,
|
||||
4 + ui_out_extra_fields,
|
||||
- VEC_length (probe_and_objfile_s, items),
|
||||
+ VEC_length (probe_p, probes),
|
||||
"StaticProbes");
|
||||
|
||||
- if (!VEC_empty (probe_and_objfile_s, items))
|
||||
- qsort (VEC_address (probe_and_objfile_s, items),
|
||||
- VEC_length (probe_and_objfile_s, items),
|
||||
- sizeof (probe_and_objfile_s), compare_entries);
|
||||
+ if (!VEC_empty (probe_p, probes))
|
||||
+ qsort (VEC_address (probe_p, probes), VEC_length (probe_p, probes),
|
||||
+ sizeof (probe_p), compare_probes);
|
||||
|
||||
/* What's the size of an address in our architecture? */
|
||||
size_addr = gdbarch_addr_bit (gdbarch) == 64 ? 18 : 10;
|
||||
|
||||
/* Determining the maximum size of each field (`provider', `name' and
|
||||
`objname'). */
|
||||
- for (i = 0; VEC_iterate (probe_and_objfile_s, items, i, entry); ++i)
|
||||
+ for (i = 0; VEC_iterate (probe_p, probes, i, probe); ++i)
|
||||
{
|
||||
- size_name = max (strlen (entry->probe->name), size_name);
|
||||
- size_provider = max (strlen (entry->probe->provider), size_provider);
|
||||
- size_objname = max (strlen (entry->objfile->name), size_objname);
|
||||
+ size_name = max (strlen (probe->name), size_name);
|
||||
+ size_provider = max (strlen (probe->provider), size_provider);
|
||||
+ size_objname = max (strlen (probe->objfile->name), size_objname);
|
||||
}
|
||||
|
||||
ui_out_table_header (current_uiout, size_provider, ui_left, "provider",
|
||||
@@ -601,26 +575,26 @@
|
||||
/* We have to generate the table header for each new probe type that we
|
||||
will print. */
|
||||
for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po); ++ix)
|
||||
- gen_ui_out_table_header_info (items, po);
|
||||
+ gen_ui_out_table_header_info (probes, po);
|
||||
}
|
||||
else
|
||||
- gen_ui_out_table_header_info (items, pops);
|
||||
+ gen_ui_out_table_header_info (probes, pops);
|
||||
|
||||
ui_out_table_header (current_uiout, size_objname, ui_left, "object",
|
||||
_("Object"));
|
||||
ui_out_table_body (current_uiout);
|
||||
|
||||
- for (i = 0; VEC_iterate (probe_and_objfile_s, items, i, entry); ++i)
|
||||
+ for (i = 0; VEC_iterate (probe_p, probes, i, probe); ++i)
|
||||
{
|
||||
struct cleanup *inner;
|
||||
|
||||
inner = make_cleanup_ui_out_tuple_begin_end (current_uiout, "probe");
|
||||
|
||||
- ui_out_field_string (current_uiout, "provider", entry->probe->provider);
|
||||
- ui_out_field_string (current_uiout, "name", entry->probe->name);
|
||||
+ ui_out_field_string (current_uiout, "provider", probe->provider);
|
||||
+ ui_out_field_string (current_uiout, "name", probe->name);
|
||||
ui_out_field_core_addr (current_uiout, "addr",
|
||||
- get_objfile_arch (entry->objfile),
|
||||
- entry->probe->address);
|
||||
+ get_objfile_arch (probe->objfile),
|
||||
+ probe->address);
|
||||
|
||||
if (pops == NULL)
|
||||
{
|
||||
@@ -629,19 +603,19 @@
|
||||
|
||||
for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po);
|
||||
++ix)
|
||||
- if (entry->probe->pops == po)
|
||||
- print_ui_out_info (entry);
|
||||
+ if (probe->pops == po)
|
||||
+ print_ui_out_info (probe);
|
||||
}
|
||||
else
|
||||
- print_ui_out_info (entry);
|
||||
+ print_ui_out_info (probe);
|
||||
|
||||
- ui_out_field_string (current_uiout, "object", entry->objfile->name);
|
||||
+ ui_out_field_string (current_uiout, "object", probe->objfile->name);
|
||||
ui_out_text (current_uiout, "\n");
|
||||
|
||||
do_cleanups (inner);
|
||||
}
|
||||
|
||||
- any_found = !VEC_empty (probe_and_objfile_s, items);
|
||||
+ any_found = !VEC_empty (probe_p, probes);
|
||||
do_cleanups (cleanup);
|
||||
|
||||
if (!any_found)
|
||||
@@ -662,23 +636,24 @@
|
||||
probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n)
|
||||
{
|
||||
struct probe *probe;
|
||||
- struct objfile *objfile;
|
||||
+ const struct sym_probe_fns *probe_fns;
|
||||
unsigned n_probes;
|
||||
|
||||
- probe = find_probe_by_pc (get_frame_pc (frame), &objfile);
|
||||
+ probe = find_probe_by_pc (get_frame_pc (frame));
|
||||
if (!probe)
|
||||
return NULL;
|
||||
- gdb_assert (objfile->sf && objfile->sf->sym_probe_fns);
|
||||
|
||||
- n_probes
|
||||
- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
|
||||
- probe);
|
||||
+ gdb_assert (probe->objfile != NULL);
|
||||
+ gdb_assert (probe->objfile->sf != NULL);
|
||||
+ gdb_assert (probe->objfile->sf->sym_probe_fns != NULL);
|
||||
+
|
||||
+ probe_fns = probe->objfile->sf->sym_probe_fns;
|
||||
+ n_probes = probe_fns->sym_get_probe_argument_count (probe);
|
||||
+
|
||||
if (n >= n_probes)
|
||||
return NULL;
|
||||
|
||||
- return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile,
|
||||
- probe,
|
||||
- n);
|
||||
+ return probe_fns->sym_evaluate_probe_argument (probe, n);
|
||||
}
|
||||
|
||||
/* See comment in probe.h. */
|
||||
--- src/gdb/probe.h 2012/04/27 20:47:55 1.1
|
||||
+++ src/gdb/probe.h 2012/07/18 16:12:17 1.2
|
||||
@@ -66,21 +66,18 @@
|
||||
|
||||
/* Return the number of arguments of PROBE. */
|
||||
|
||||
- unsigned (*get_probe_argument_count) (struct probe *probe,
|
||||
- struct objfile *objfile);
|
||||
+ unsigned (*get_probe_argument_count) (struct probe *probe);
|
||||
|
||||
/* Evaluate the Nth argument from the PROBE, returning a value
|
||||
corresponding to it. The argument number is represented N. */
|
||||
|
||||
struct value *(*evaluate_probe_argument) (struct probe *probe,
|
||||
- struct objfile *objfile,
|
||||
unsigned n);
|
||||
|
||||
/* Compile the Nth argument of the PROBE to an agent expression.
|
||||
The argument number is represented by N. */
|
||||
|
||||
- void (*compile_to_ax) (struct probe *probe, struct objfile *objfile,
|
||||
- struct agent_expr *aexpr,
|
||||
+ void (*compile_to_ax) (struct probe *probe, struct agent_expr *aexpr,
|
||||
struct axs_value *axs_value, unsigned n);
|
||||
|
||||
/* Set the semaphore associated with the PROBE. This function only makes
|
||||
@@ -108,8 +105,8 @@
|
||||
void (*gen_info_probes_table_header) (VEC (info_probe_column_s) **heads);
|
||||
|
||||
/* Function that will fill VALUES with the values of the extra fields
|
||||
- to be printed for PROBE and OBJFILE. If the backend implements
|
||||
- the `gen_ui_out_table_header' method, then it should implement
|
||||
+ to be printed for PROBE. If the backend implements the
|
||||
+ `gen_ui_out_table_header' method, then it should implement
|
||||
this method as well. The backend should also guarantee that the
|
||||
order and the number of values in the vector is exactly the same
|
||||
as the order of the extra fields provided in the method
|
||||
@@ -118,7 +115,6 @@
|
||||
position in the vector. */
|
||||
|
||||
void (*gen_info_probes_table_values) (struct probe *probe,
|
||||
- struct objfile *objfile,
|
||||
VEC (const_char_ptr) **values);
|
||||
};
|
||||
|
||||
@@ -157,6 +153,11 @@
|
||||
/* The operations associated with this probe. */
|
||||
const struct probe_ops *pops;
|
||||
|
||||
+ /* The objfile which contains this probe. Even if the probe is also
|
||||
+ present in a separate debug objfile, this variable always points to
|
||||
+ the non-separate debug objfile. */
|
||||
+ struct objfile *objfile;
|
||||
+
|
||||
/* The name of the probe. */
|
||||
const char *name;
|
||||
|
||||
@@ -181,11 +182,9 @@
|
||||
extern void register_probe_ops (struct probe *probe);
|
||||
|
||||
/* Given a PC, find an associated probe with type PTYPE. If a probe is
|
||||
- found, set *OBJFILE_OUT to the probe's objfile, and return the
|
||||
- probe. If no probe is found, return NULL. */
|
||||
+ found, return it. If no probe is found, return NULL. */
|
||||
|
||||
-extern struct probe *find_probe_by_pc (CORE_ADDR pc,
|
||||
- struct objfile **objfile_out);
|
||||
+extern struct probe *find_probe_by_pc (CORE_ADDR pc);
|
||||
|
||||
/* Search OBJFILE for a probe with the given PROVIDER, NAME and PTYPE.
|
||||
Return a VEC of all probes that were found. If no matching probe
|
||||
--- src/gdb/stap-probe.c 2012/05/08 01:35:35 1.4
|
||||
+++ src/gdb/stap-probe.c 2012/07/18 16:12:17 1.5
|
||||
@@ -903,10 +903,10 @@
|
||||
this information. */
|
||||
|
||||
static void
|
||||
-stap_parse_probe_arguments (struct stap_probe *probe, struct objfile *objfile)
|
||||
+stap_parse_probe_arguments (struct stap_probe *probe)
|
||||
{
|
||||
const char *cur;
|
||||
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
||||
+ struct gdbarch *gdbarch = get_objfile_arch (probe->p.objfile);
|
||||
|
||||
gdb_assert (!probe->args_parsed);
|
||||
cur = probe->args_u.text;
|
||||
@@ -991,15 +991,14 @@
|
||||
argument string. */
|
||||
|
||||
static unsigned
|
||||
-stap_get_probe_argument_count (struct probe *probe_generic,
|
||||
- struct objfile *objfile)
|
||||
+stap_get_probe_argument_count (struct probe *probe_generic)
|
||||
{
|
||||
struct stap_probe *probe = (struct stap_probe *) probe_generic;
|
||||
|
||||
gdb_assert (probe_generic->pops == &stap_probe_ops);
|
||||
|
||||
if (!probe->args_parsed)
|
||||
- stap_parse_probe_arguments (probe, objfile);
|
||||
+ stap_parse_probe_arguments (probe);
|
||||
|
||||
gdb_assert (probe->args_parsed);
|
||||
return VEC_length (stap_probe_arg_s, probe->args_u.vec);
|
||||
@@ -1042,10 +1041,10 @@
|
||||
}
|
||||
|
||||
static struct stap_probe_arg *
|
||||
-stap_get_arg (struct stap_probe *probe, struct objfile *objfile, unsigned n)
|
||||
+stap_get_arg (struct stap_probe *probe, unsigned n)
|
||||
{
|
||||
if (!probe->args_parsed)
|
||||
- stap_parse_probe_arguments (probe, objfile);
|
||||
+ stap_parse_probe_arguments (probe);
|
||||
|
||||
return VEC_index (stap_probe_arg_s, probe->args_u.vec, n);
|
||||
}
|
||||
@@ -1054,8 +1053,7 @@
|
||||
corresponding to it. Assertion is thrown if N does not exist. */
|
||||
|
||||
static struct value *
|
||||
-stap_evaluate_probe_argument (struct probe *probe_generic,
|
||||
- struct objfile *objfile, unsigned n)
|
||||
+stap_evaluate_probe_argument (struct probe *probe_generic, unsigned n)
|
||||
{
|
||||
struct stap_probe *stap_probe = (struct stap_probe *) probe_generic;
|
||||
struct stap_probe_arg *arg;
|
||||
@@ -1063,7 +1061,7 @@
|
||||
|
||||
gdb_assert (probe_generic->pops == &stap_probe_ops);
|
||||
|
||||
- arg = stap_get_arg (stap_probe, objfile, n);
|
||||
+ arg = stap_get_arg (stap_probe, n);
|
||||
return evaluate_subexp_standard (arg->atype, arg->aexpr, &pos, EVAL_NORMAL);
|
||||
}
|
||||
|
||||
@@ -1071,9 +1069,8 @@
|
||||
Assertion is thrown if N does not exist. */
|
||||
|
||||
static void
|
||||
-stap_compile_to_ax (struct probe *probe_generic, struct objfile *objfile,
|
||||
- struct agent_expr *expr, struct axs_value *value,
|
||||
- unsigned n)
|
||||
+stap_compile_to_ax (struct probe *probe_generic, struct agent_expr *expr,
|
||||
+ struct axs_value *value, unsigned n)
|
||||
{
|
||||
struct stap_probe *stap_probe = (struct stap_probe *) probe_generic;
|
||||
struct stap_probe_arg *arg;
|
||||
@@ -1081,7 +1078,7 @@
|
||||
|
||||
gdb_assert (probe_generic->pops == &stap_probe_ops);
|
||||
|
||||
- arg = stap_get_arg (stap_probe, objfile, n);
|
||||
+ arg = stap_get_arg (stap_probe, n);
|
||||
|
||||
pc = arg->aexpr->elts;
|
||||
gen_expr (arg->aexpr, &pc, expr, value);
|
||||
@@ -1124,20 +1121,24 @@
|
||||
struct frame_info *frame = get_selected_frame (_("No frame selected"));
|
||||
CORE_ADDR pc = get_frame_pc (frame);
|
||||
int sel = (int) (uintptr_t) data;
|
||||
- struct objfile *objfile;
|
||||
struct probe *pc_probe;
|
||||
+ const struct sym_probe_fns *pc_probe_fns;
|
||||
unsigned n_args;
|
||||
|
||||
/* SEL == -1 means "_probe_argc". */
|
||||
gdb_assert (sel >= -1);
|
||||
|
||||
- pc_probe = find_probe_by_pc (pc, &objfile);
|
||||
+ pc_probe = find_probe_by_pc (pc);
|
||||
if (pc_probe == NULL)
|
||||
error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc));
|
||||
|
||||
- n_args
|
||||
- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
|
||||
- pc_probe);
|
||||
+ gdb_assert (pc_probe->objfile != NULL);
|
||||
+ gdb_assert (pc_probe->objfile->sf != NULL);
|
||||
+ gdb_assert (pc_probe->objfile->sf->sym_probe_fns != NULL);
|
||||
+
|
||||
+ pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns;
|
||||
+
|
||||
+ n_args = pc_probe_fns->sym_get_probe_argument_count (pc_probe);
|
||||
if (sel == -1)
|
||||
return value_from_longest (builtin_type (arch)->builtin_int, n_args);
|
||||
|
||||
@@ -1145,9 +1146,7 @@
|
||||
error (_("Invalid probe argument %d -- probe has %u arguments available"),
|
||||
sel, n_args);
|
||||
|
||||
- return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile,
|
||||
- pc_probe,
|
||||
- sel);
|
||||
+ return pc_probe_fns->sym_evaluate_probe_argument (pc_probe, sel);
|
||||
}
|
||||
|
||||
/* This is called to compile one of the $_probe_arg* convenience
|
||||
@@ -1159,20 +1158,25 @@
|
||||
{
|
||||
CORE_ADDR pc = expr->scope;
|
||||
int sel = (int) (uintptr_t) data;
|
||||
- struct objfile *objfile;
|
||||
struct probe *pc_probe;
|
||||
+ const struct sym_probe_fns *pc_probe_fns;
|
||||
int n_probes;
|
||||
|
||||
/* SEL == -1 means "_probe_argc". */
|
||||
gdb_assert (sel >= -1);
|
||||
|
||||
- pc_probe = find_probe_by_pc (pc, &objfile);
|
||||
+ pc_probe = find_probe_by_pc (pc);
|
||||
if (pc_probe == NULL)
|
||||
error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc));
|
||||
|
||||
- n_probes
|
||||
- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
|
||||
- pc_probe);
|
||||
+ gdb_assert (pc_probe->objfile != NULL);
|
||||
+ gdb_assert (pc_probe->objfile->sf != NULL);
|
||||
+ gdb_assert (pc_probe->objfile->sf->sym_probe_fns != NULL);
|
||||
+
|
||||
+ pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns;
|
||||
+
|
||||
+ n_probes = pc_probe_fns->sym_get_probe_argument_count (pc_probe);
|
||||
+
|
||||
if (sel == -1)
|
||||
{
|
||||
value->kind = axs_rvalue;
|
||||
@@ -1186,8 +1190,7 @@
|
||||
error (_("Invalid probe argument %d -- probe has %d arguments available"),
|
||||
sel, n_probes);
|
||||
|
||||
- objfile->sf->sym_probe_fns->sym_compile_to_ax (objfile, pc_probe,
|
||||
- expr, value, sel);
|
||||
+ pc_probe_fns->sym_compile_to_ax (pc_probe, expr, value, sel);
|
||||
}
|
||||
|
||||
|
||||
@@ -1297,6 +1300,7 @@
|
||||
|
||||
ret = obstack_alloc (&objfile->objfile_obstack, sizeof (*ret));
|
||||
ret->p.pops = &stap_probe_ops;
|
||||
+ ret->p.objfile = objfile;
|
||||
|
||||
/* Provider and the name of the probe. */
|
||||
ret->p.provider = &el->data[3 * size];
|
||||
@@ -1481,15 +1485,16 @@
|
||||
|
||||
static void
|
||||
stap_gen_info_probes_table_values (struct probe *probe_generic,
|
||||
- struct objfile *objfile,
|
||||
VEC (const_char_ptr) **ret)
|
||||
{
|
||||
struct stap_probe *probe = (struct stap_probe *) probe_generic;
|
||||
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
||||
+ struct gdbarch *gdbarch;
|
||||
const char *val = NULL;
|
||||
|
||||
gdb_assert (probe_generic->pops == &stap_probe_ops);
|
||||
|
||||
+ gdbarch = get_objfile_arch (probe->p.objfile);
|
||||
+
|
||||
if (probe->sem_addr)
|
||||
val = print_core_address (gdbarch, probe->sem_addr);
|
||||
|
||||
--- src/gdb/symfile.h 2012/05/24 22:14:35 1.109
|
||||
+++ src/gdb/symfile.h 2012/07/18 16:12:17 1.110
|
||||
@@ -320,8 +320,7 @@
|
||||
have come from a call to this objfile's sym_get_probes method.
|
||||
If you provide an implementation of sym_get_probes, you must
|
||||
implement this method as well. */
|
||||
- unsigned (*sym_get_probe_argument_count) (struct objfile *objfile,
|
||||
- struct probe *probe);
|
||||
+ unsigned (*sym_get_probe_argument_count) (struct probe *probe);
|
||||
|
||||
/* Evaluate the Nth argument available to PROBE. PROBE will have
|
||||
come from a call to this objfile's sym_get_probes method. N will
|
||||
@@ -330,8 +329,7 @@
|
||||
PC will match the address of the probe. If you provide an
|
||||
implementation of sym_get_probes, you must implement this method
|
||||
as well. */
|
||||
- struct value *(*sym_evaluate_probe_argument) (struct objfile *objfile,
|
||||
- struct probe *probe,
|
||||
+ struct value *(*sym_evaluate_probe_argument) (struct probe *probe,
|
||||
unsigned n);
|
||||
|
||||
/* Compile the Nth probe argument to an agent expression. PROBE
|
||||
@@ -339,8 +337,7 @@
|
||||
method. N will be between 0 and the number of arguments
|
||||
available to this probe. EXPR and VALUE are the agent expression
|
||||
that is being updated. */
|
||||
- void (*sym_compile_to_ax) (struct objfile *objfile,
|
||||
- struct probe *probe,
|
||||
+ void (*sym_compile_to_ax) (struct probe *probe,
|
||||
struct agent_expr *expr,
|
||||
struct axs_value *value,
|
||||
unsigned n);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue