118985 Commits

Author SHA1 Message Date
GDB Administrator
056d54b711 Automatic date update in version.in 2024-08-10 00:01:22 +00:00
GDB Administrator
7aa46e36e1 Automatic date update in version.in 2024-08-09 00:01:32 +00:00
GDB Administrator
07f7e1c042 Automatic date update in version.in 2024-08-08 00:01:34 +00:00
Hannes Domani
b822630603 Mark unavailable bytes of limited-length arrays when allocating contents
Using 'output' to print arrays larger than max-value-size, with only
repeating elements, can cause gdb to crash:
```
$ cat a.c:
char a[1000000];

int main()
{
  return a[0];
}
$ gdb -q a
(gdb) print a
$1 = {0 '\000' <repeats 65536 times>, <unavailable> <repeats 934464 times>}
(gdb) output a

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
```

Using 'print' works, because value::record_latest sets the unavailable
bytes of the value when it's added to the value history.
But 'outout' doesn't do that, so the printing tries to access more bytes
than are available.

The original problem in PR32015 was about using 'print' of a dynamic
array in a D program.
Here the crash happens because for 'print' the value was a struct with
length/ptr fields, which is converted in d-valprint.c into an array.
So value::record_latest didn't have a chance to mark the unavailable
bytes in this case.

To make sure the unavailable bytes always match the contents, this fixes
it by marking the unavailable bytes immediately after the contents are
allocated.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32015
Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
(cherry picked from commit 8fdd2b2bcd8117cafcc6ef976e45f0d9f95fb528)
2024-08-07 15:05:06 +02:00
GDB Administrator
f3fed29a2c Automatic date update in version.in 2024-08-07 00:00:40 +00:00
GDB Administrator
74b18e3538 Automatic date update in version.in 2024-08-06 00:00:57 +00:00
GDB Administrator
7ae383fd7a Automatic date update in version.in 2024-08-05 00:01:04 +00:00
GDB Administrator
a443ee2422 Automatic date update in version.in 2024-08-04 00:01:12 +00:00
GDB Administrator
1260e51a7f Automatic date update in version.in 2024-08-03 00:00:40 +00:00
GDB Administrator
87984f7698 Automatic date update in version.in 2024-08-02 00:00:52 +00:00
GDB Administrator
23b8eaaff0 Automatic date update in version.in 2024-08-01 00:01:15 +00:00
GDB Administrator
416907555e Automatic date update in version.in 2024-07-31 00:00:52 +00:00
GDB Administrator
a363b89f09 Automatic date update in version.in 2024-07-30 00:01:13 +00:00
GDB Administrator
0770a377d1 Automatic date update in version.in 2024-07-29 00:00:37 +00:00
GDB Administrator
afc5aff69f Automatic date update in version.in 2024-07-28 00:01:23 +00:00
GDB Administrator
dc36238f1d Automatic date update in version.in 2024-07-27 00:01:25 +00:00
GDB Administrator
79cc1a2d92 Automatic date update in version.in 2024-07-26 00:00:59 +00:00
GDB Administrator
278329cf8f Automatic date update in version.in 2024-07-25 00:00:57 +00:00
GDB Administrator
46042a600e Automatic date update in version.in 2024-07-24 00:01:12 +00:00
Simon Marchi
760242224f gdb/solib-frv: move lm_info object to solib
I noticed that the lm_info_frv objects created in frv_current_sos are
never moved to the solib object.  This bug was introduced in 8971d2788e
("gdb: link so_list using intrusive_list"), which mistakenly removed the
line

    sop->lm_info = std::move (li);

... probably due so a bad merge conflict resolution.

Re-add this line.

If merged in master, I would cherry-pick this to gdb-15-branch.

Change-Id: I609a1a5ad39e93f70a95ea5ebe3f8ff4ab6a8db2
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32005
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-07-23 10:34:47 -04:00
GDB Administrator
ef812cfbf2 Automatic date update in version.in 2024-07-23 00:00:44 +00:00
GDB Administrator
42fcd11a89 Automatic date update in version.in 2024-07-22 00:00:27 +00:00
GDB Administrator
bb49d104a5 Automatic date update in version.in 2024-07-21 00:01:09 +00:00
GDB Administrator
7ff33e182c Automatic date update in version.in 2024-07-20 00:00:36 +00:00
GDB Administrator
2d25abcf7d Automatic date update in version.in 2024-07-19 00:00:33 +00:00
GDB Administrator
ef1b80e913 Automatic date update in version.in 2024-07-18 00:00:35 +00:00
GDB Administrator
e9d2651cb2 Automatic date update in version.in 2024-07-17 00:00:34 +00:00
GDB Administrator
de136936c7 Automatic date update in version.in 2024-07-16 00:00:43 +00:00
Hannes Domani
e7c91a1ff9 Fix loading a saved recording
Currently you get this assertion failure if you try to execute the
inferior after loading a saved recording, when no recording was done
earlier in the same gdb session:
```
$ gdb -q c -ex "record restore test.rec"
Reading symbols from c...
[New LWP 26428]
Core was generated by `/tmp/c'.
Restored records from core file /tmp/test.rec.
(gdb) c
Continuing.
../../gdb/inferior.c:293: internal-error: inferior* find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
```

The change in step-precsave.exp triggers this bug, since now the
recording is loaded in a new gdb session, where
record_full_resume_ptid was never set.

The fix is to simply set record_full_resume_ptid when resuming a loaded
recording.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31971
Approved-By: Guinevere Larsen <blarsen@redhat.com>
2024-07-15 18:24:57 +02:00
GDB Administrator
4a8ff36655 Automatic date update in version.in 2024-07-15 00:00:21 +00:00
GDB Administrator
b178b3d8d0 Automatic date update in version.in 2024-07-14 00:00:43 +00:00
GDB Administrator
ea91792f47 Automatic date update in version.in 2024-07-13 00:00:24 +00:00
GDB Administrator
76604451b4 Automatic date update in version.in 2024-07-12 00:00:43 +00:00
GDB Administrator
8d3ad0528d Automatic date update in version.in 2024-07-11 00:00:30 +00:00
GDB Administrator
2b04f85455 Automatic date update in version.in 2024-07-10 00:01:18 +00:00
GDB Administrator
60c75436e4 Automatic date update in version.in 2024-07-09 00:00:35 +00:00
GDB Administrator
e885320150 Automatic date update in version.in 2024-07-08 00:00:25 +00:00
Joel Brobecker
f6535ad6bf Bump GDB's version number to 15.1.90.DATE-git.
This commit changes gdb/version.in to 15.1.90.DATE-git.

This commit also makes the following changes in gdb/testsuite:

	* gdb.base/default.exp: Change $_gdb_minor to 2.
2024-07-07 09:49:14 -07:00
Joel Brobecker
7b20890ad6 Set GDB version number to 15.1.
This commit changes gdb/version.in to 15.1.
gdb-15.1-release
2024-07-07 09:31:12 -07:00
GDB Administrator
35ad5708a7 Automatic date update in version.in 2024-07-07 00:00:22 +00:00
GDB Administrator
ef5930bd0f Automatic date update in version.in 2024-07-06 00:00:34 +00:00
Hannes Domani
f7e429d581 Fix cast types for opencl
The bitshift tests for opencl have these failures:

print /x (signed char) 0x0f << 8
No type named signed char.
(gdb) FAIL: gdb.base/bitshift.exp: lang=opencl: 8-bit, promoted: print /x (signed char) 0x0f << 8
print (signed char) 0x0f << 8
No type named signed char.
(gdb) FAIL: gdb.base/bitshift.exp: lang=opencl: 8-bit, promoted: print (signed char) 0x0f << 8

Apparently opencl doesn't have the 'signed' modifier for types, only
the 'unsigned' modifier.
Even 'char' is guaranteed to be signed if no modifier is used, so
this changes the casts to match this logic.

Approved-By: Tom Tromey <tom@tromey.com>
2024-07-05 21:43:08 +02:00
Hannes Domani
2de28d2f45 Fix 64-bit shifts where long only has 32-bit size
On systems where long has 32-bit size you get these failures:

print 1 << (unsigned long long) 0xffffffffffffffff
Cannot export value 18446744073709551615 as 32-bits unsigned integer (must be between 0 and 4294967295)
(gdb) FAIL: gdb.base/bitshift.exp: lang=c: max-uint64: print 1 << (unsigned long long) 0xffffffffffffffff
print 1 >> (unsigned long long) 0xffffffffffffffff
Cannot export value 18446744073709551615 as 32-bits unsigned integer (must be between 0 and 4294967295)
(gdb) FAIL: gdb.base/bitshift.exp: lang=c: max-uint64: print 1 >> (unsigned long long) 0xffffffffffffffff
print -1 << (unsigned long long) 0xffffffffffffffff
Cannot export value 18446744073709551615 as 32-bits unsigned integer (must be between 0 and 4294967295)
(gdb) FAIL: gdb.base/bitshift.exp: lang=c: max-uint64: print -1 << (unsigned long long) 0xffffffffffffffff
print -1 >> (unsigned long long) 0xffffffffffffffff
Cannot export value 18446744073709551615 as 32-bits unsigned integer (must be between 0 and 4294967295)
(gdb) FAIL: gdb.base/bitshift.exp: lang=c: max-uint64: print -1 >> (unsigned long long) 0xffffffffffffffff

Fixed by changing the number-of-bits variable to ULONGEST.

Approved-By: Tom Tromey <tom@tromey.com>
2024-07-05 21:43:03 +02:00
Hannes Domani
cec2e207d0 Fix too-large or negative right shift of negative numbers
As seen in these test failures:

print -1 >> -1
warning: right shift count is negative
$N = 0
(gdb) FAIL: gdb.base/bitshift.exp: lang=c: neg lhs/rhs: print -1 >> -1
print -4 >> -2
warning: right shift count is negative
$N = 0
(gdb) FAIL: gdb.base/bitshift.exp: lang=c: neg lhs/rhs: print -4 >> -2

Fixed by restoring the logic from before the switch to gmp.

Approved-By: Tom Tromey <tom@tromey.com>
2024-07-05 21:42:58 +02:00
Hannes Domani
edd3f7be25 Fix right shift of negative numbers
PR31590 shows that right shift of negative numbers doesn't work
correctly since GDB 14:

(gdb) p (-3) >> 1
$1 = -1

GDB 13 and earlier returned the correct value -2.
And there actually is one test that shows the failure:

print -1 >> 1
$84 = 0
(gdb) FAIL: gdb.base/bitshift.exp: lang=asm: rsh neg lhs: print -1 >> 1

The problem was introduced with the change to gmp functions in
commit 303a881f87.
It's wrong because gdb_mpz::operator>> uses mpz_tdif_q_2exp, which
always rounds toward zero, and the gmp docu says this:

For positive n both mpz_fdiv_q_2exp and mpz_tdiv_q_2exp are simple
bitwise right shifts.
For negative n, mpz_fdiv_q_2exp is effectively an arithmetic right shift
treating n as two's complement the same as the bitwise logical functions
do, whereas mpz_tdiv_q_2exp effectively treats n as sign and magnitude.

So this changes mpz_tdiv_q_2exp to mpz_fdiv_q_2exp, since it
does right shifts for both positive and negative numbers.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31590
Approved-By: Tom Tromey <tom@tromey.com>
2024-07-05 21:42:53 +02:00
Hannes Domani
041fb9da7d Restore bitshift.exp tests
Commit cdd4206647 unintentionally disabled all tests of bitshift.exp,
so it actually just does this:

Running /c/src/repos/binutils-gdb.git/gdb/testsuite/gdb.base/bitshift.exp ...
PASS: gdb.base/bitshift.exp: complete set language

		=== gdb Summary ===

 # of expected passes		1

It changed the 'continue' of unsupported languages to 'return', and
since ada is the first language and is unsupported, no tests were run.

This changes it back to 'continue', and the following patches fix
the regressions that were introduced since then unnoticed.

Approved-By: Tom Tromey <tom@tromey.com>
2024-07-05 21:42:49 +02:00
GDB Administrator
b1f7227b7e Automatic date update in version.in 2024-07-05 00:00:40 +00:00
GDB Administrator
0c7862ac50 Automatic date update in version.in 2024-07-04 00:01:05 +00:00
GDB Administrator
f6c0e1bad2 Automatic date update in version.in 2024-07-03 00:00:42 +00:00
GDB Administrator
d36933683a Automatic date update in version.in 2024-07-02 00:01:11 +00:00