Commit Graph

118870 Commits

Author SHA1 Message Date
GDB Administrator
fa08fd1d77 Automatic date update in version.in 2024-09-11 00:00:37 +00:00
GDB Administrator
9ade3065a1 Automatic date update in version.in 2024-09-10 00:00:39 +00:00
GDB Administrator
846d33f338 Automatic date update in version.in 2024-09-09 00:00:26 +00:00
H.J. Lu
68163a5c4f gdb-15-branch: Clear the X86_XSTATE_MPX bit in XCRO for x32
commit 868883583e
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Sat Mar 23 16:17:36 2024 +0000

    gdb/arch: assert that X86_XSTATE_MPX is not set for x32

added

  if (xcr0 & X86_XSTATE_MPX)
    {
      /* MPX is not available on x32.  */
      gdb_assert (!is_x32);
      regnum = create_feature_i386_64bit_mpx (tdesc.get (), regnum);
    }

But x32 is a software convention.  There is no x32 mode in hardware and
CPU always returns the 64-bit mode XCR0 value for x32 processes.  This
regression was fixed on master branch by

commit bf616be991 (HEAD)
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Thu Jan 25 14:25:57 2024 +0000

    gdb/gdbserver: share some code relating to target description creation

which used the gdbserver code to clear the X86_XSTATE_MPX bit in XCR0 for
x32.  Fix this regression on gdb-15-branch by clearing the X86_XSTATE_MPX
bit in XCR0 for x32 in gdb.

	PR gdb/32143
	* x86-linux-nat.c (x86_linux_nat_target::read_description): Clear
	the X86_XSTATE_MPX bit in XCR0 for x32.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-09-08 16:03:09 -07:00
GDB Administrator
897204a988 Automatic date update in version.in 2024-09-08 00:00:53 +00:00
GDB Administrator
c331455027 Automatic date update in version.in 2024-09-07 00:00:52 +00:00
GDB Administrator
fdcd19f594 Automatic date update in version.in 2024-09-06 00:00:32 +00:00
GDB Administrator
1f7b8cce76 Automatic date update in version.in 2024-09-05 00:00:46 +00:00
Dmitry Neverov
9542d1b3a0 Recognize -2 as a tombstone value in .debug_line
Commit a8caed5d7f handled the tombstone
value -1 used by lld (https://reviews.llvm.org/D81784).  The
referenced lld commit also uses the tombstone value -2 for
pre-DWARF-v5
(e618ccbf43).

If not handled, -2 breaks the pc step range calculation and triggers
the assertion:

  gdb/infrun.c:2794: internal-error: resume_1: Assertion
  `pc_in_thread_step_range (pc, tp)' failed.

This commit adds -2 tombstone value and handles it in the same way as -1.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31727
Cherry-picked from e814012b2b
Approved-By: Tom Tromey <tom@tromey.com>
2024-09-04 20:38:12 +02:00
GDB Administrator
4210743723 Automatic date update in version.in 2024-09-04 00:00:33 +00:00
GDB Administrator
2daf900f61 Automatic date update in version.in 2024-09-03 00:00:43 +00:00
GDB Administrator
f74feca10c Automatic date update in version.in 2024-09-02 00:00:37 +00:00
GDB Administrator
9c8ee57a0f Automatic date update in version.in 2024-09-01 00:00:32 +00:00
GDB Administrator
865b7d5d83 Automatic date update in version.in 2024-08-31 00:00:37 +00:00
GDB Administrator
3831f9d6f1 Automatic date update in version.in 2024-08-30 00:00:36 +00:00
GDB Administrator
5b1b2884ce Automatic date update in version.in 2024-08-29 00:00:37 +00:00
GDB Administrator
1210b9b0ed Automatic date update in version.in 2024-08-28 00:00:30 +00:00
GDB Administrator
05d5112c10 Automatic date update in version.in 2024-08-27 00:00:39 +00:00
GDB Administrator
f086ab70d5 Automatic date update in version.in 2024-08-26 00:00:39 +00:00
GDB Administrator
524b5ad7db Automatic date update in version.in 2024-08-25 00:00:22 +00:00
GDB Administrator
5a8e6d7e78 Automatic date update in version.in 2024-08-24 00:00:21 +00:00
GDB Administrator
867d8e09d7 Automatic date update in version.in 2024-08-23 00:00:48 +00:00
Tom de Vries
de553d417e [gdb] Handle ^C during disassembly
In PR gdb/32025, a fatal error was reported when sending a SIGINT to gdb while
disassembling.

I managed to reproduce this on aarch64-linux in a Leap 15.5 container using
this trigger patch:
...
 gdb_disassembler_memory_reader::dis_asm_read_memory
   (bfd_vma memaddr, gdb_byte *myaddr, unsigned int len,
    struct disassemble_info *info) noexcept
 {
+  set_quit_flag ();
   return target_read_code (memaddr, myaddr, len);
 }
...
and a simple gdb command line calling the disassemble command:
...
$ gdb -q -batch a.out -ex "disassemble main"
...

The following scenario leads to the fatal error:
- the disassemble command is executed,
- set_quit_flag is called in
  gdb_disassembler_memory_reader::dis_asm_read_memory, pretending that a
  user pressed ^C,
- target_read_code calls QUIT, which throws a
  gdb_exception_quit,
- the exception propagation mechanism reaches c code in libopcodes and a fatal
  error triggers because the c code is not compiled with -fexception.

Fix this by:
- wrapping the body of gdb_disassembler_memory_reader::dis_asm_read_memory in
  catch_exceptions (which consequently needs moving to a header file), and
- reraising the caught exception in default_print_insn using QUIT.

Tested on aarch64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32025
(cherry picked from commit c45c3b4162)
2024-08-22 11:43:32 +02:00
GDB Administrator
731a801b1e Automatic date update in version.in 2024-08-22 00:01:41 +00:00
GDB Administrator
2c9e05f3a6 Automatic date update in version.in 2024-08-21 00:01:36 +00:00
GDB Administrator
fa0424d0e3 Automatic date update in version.in 2024-08-20 00:00:42 +00:00
GDB Administrator
67196cabf5 Automatic date update in version.in 2024-08-19 00:00:55 +00:00
GDB Administrator
98032324bc Automatic date update in version.in 2024-08-18 00:00:33 +00:00
GDB Administrator
3aa3fd0c2e Automatic date update in version.in 2024-08-17 00:01:47 +00:00
GDB Administrator
771c98e80e Automatic date update in version.in 2024-08-16 00:00:30 +00:00
GDB Administrator
f171f7e8df Automatic date update in version.in 2024-08-15 00:01:44 +00:00
GDB Administrator
2ed13e3b58 Automatic date update in version.in 2024-08-14 00:01:01 +00:00
GDB Administrator
9e58138c75 Automatic date update in version.in 2024-08-13 00:01:12 +00:00
GDB Administrator
7b14ea4637 Automatic date update in version.in 2024-08-12 00:01:21 +00:00
GDB Administrator
a0ac39eba6 Automatic date update in version.in 2024-08-11 00:01:26 +00:00
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 8fdd2b2bcd)
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