Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
The documentation says that ThreadExitedEvent is derived from
ThreadEvent, but the code does not actually implement this.
This patch fixes the problem. I propose applying this to gdb 17 as
well.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33444
Approved-By: Simon Marchi <simon.marchi@efficios.com>
(cherry picked from commit 3a9f5df6ea8adcae7769f271cccbc2da8553c08d)
|
|
|
|
Luis noticed that when adding the gcs and gcs_linux members to struct
aarch64_features in my Guarded Control Stack patch series, I neglected to
modify struct hash<aarch64_features>::operator() to take them into account
when computing its hash.
This can cause GDB to use the wrong aarch64_features object during a
debugging session.
Regression tested on aarch64-linux-gnu.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33440
Suggested-by: Luis Machado <luis.machado.foss@gmail.com>
Approved-By: Luis Machado <luis.machado.foss@gmail.com>
(cherry picked from commit 86e6907244c89bde0d1584dbcbd617b53319d0f9)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gdb currently crashes if you try to get the dynamic_type from a
gdb.Value of a POD struct:
(gdb) py print(gdb.parse_and_eval('pod').dynamic_type)
Fatal signal: Segmentation fault
It happens because value_rtti_type() returns NULL for them, and this is
not handled correctly.
Fixed by using val->type() as a fallback in this case.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
|
|
When starting GDB on Hurd amd64, one will currently see the following
warning:
# gdb -q
gdb: warning: A handler for the OS ABI "GNU/Hurd" is not built into this configuration
of GDB. Attempting to continue with the default i386 settings.
(gdb)
This happens because, in gdb/configure.tgt, the "x86_64-*-gnu*" target
is not pulling in the i386-gnu-tdep.o object, which means that only
64-bit debugging is currently supported.
The fix here is to add i386-gnu-tdep.o to the gdb_target_obs for Hurd
amd64.
Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
Suggested-by: Andrew Burgess <aburgess@redhat.com>
Reported-by: Mark Wielaard <mark@klomp.org>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33377
Approved-by: Kevin Buettner <kevinb@redhat.com>
(cherry picked from commit 3d22a6cee4b27866c544d67a82e2272ae4201f9e)
|
|
|
|
GDB currently fails to build from source on i386 if compiled with
--enable-64-bit-bfd. This is happening because svr4-tls-tdep.o is
missing from the gdb_target_obs variable, while amd64-linux-tdep.o is
obviously there.
Fix the problem by adding svr4-tls-tdep.o to the object list, but only
when --enable-64-bit-bfd is provided.
Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33399
(cherry picked from commit b318480f27322c15c6b10c1bab4418e81d44b77e)
|
|
I noticed I was sometimes getting this failure:
FAIL: gdb.arch/amd64-extended-prologue-analysis.exp: offset \
initialization: ASM source: gdb_breakpoint: set breakpoint \
at *0x0000000000401151
The problem was introduced in commit:
commit f9aa48dc545ef511e19f4dfab88a196b820fd2da
Date: Thu Aug 28 11:50:13 2025 +0000
gdb, amd64: extend the amd64 prologue analyzer to skip register pushes
A gdb_test_multiple exits early when processing the results of a
'disassemble' command, without waiting for the prompt to be seen.
This can leave unhandled output in expect's input buffer, which will
then throw off the next test.
Update the gdb_test_multiple to wait for the prompt before declaring
the test passed.
After this I'm no longer seeing the above failure.
There should be no change in what is tested after this commit.
|
|
|
|
|
|
This commit changes gdb/version.in to 17.0.90.DATE-git.
|
|
This commit changes gdb/version.in to 17.0.90.
|
|
Now that the major release version number is confirmed, we can adjust
the title of the corresponding section in the gdb/NEWS file.
|
|
This is done by setting the "development" variable to "false"
in bfd/development.sh.
|
|
Now that the GDB 17 branch has been created,
this commit bumps the version number in gdb/version.in to
17.0.90.DATE-git
For the record, the GDB 17 branch was created
from commit 46ada32fc979550ad4f46792b74c182bb7232aeb.
|
|
commit 0d1e88f8bfb0e62f37bf8a89172cd91373ace5e6
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jul 4 08:39:03 2025 +0800
x86: Add GLIBC_ABI_GNU2_TLS version dependency
added solaris2-x86-64.em to accommodate moving x86-64 specific extra
emulation bits to elf-x86-64.em. Update emulparams/elf_x86_64_sol2.sh
to use it.
* emulparams/elf_x86_64_sol2.sh (EXTRA_EM_FILE): Set to
"solaris2-x86-64".
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
* testsuite/binutils-all/objcopy.exp (objcopy_tek2bin): Correct
isremote to is_remote.
|
|
|
|
It was changed back in 1994. Fixing because it misled me into using the
wrong flag in a build.
|
|
Currently, trying to convert a 128-bit integer from a gdb.Value to a
Python integer will fail. This is surprising because Python uses
bigints internally.
The bug here is that valpy_long uses value_as_long, which fails for
anything wider than LONGEST. This patch fixes the problem by using
the recommended Python API.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33366
Approved-By: Simon Marchi <simon.marchi@efficios.com>
|
|
Fix fallout in gdb.base from erroring out on clean_restart
<absolute filename>.
Tested on x86_64-linux.
|
|
Manually fix the test-cases found by:
...
$ find gdb/testsuite/gdb.base -name *.exp* \
| xargs grep -l 'clean_restart[^;]*binfile'
$ find gdb/testsuite/gdb.base -name *.exp* \
| xargs grep -l 'prepare_for_testing.*bin'
...
except for gdb.base/foll-vfork.exp and gdb.base/solib-overlap.exp.
Tested on x86_64-linux.
|
|
Run:
...
$ find gdb/testsuite/gdb.base/ -name *.exp* \
| xargs sed -i 's/^\([ \t]*\)clean_restart $binfile$/\1clean_restart\n\1gdb_load $binfile/'
$ find gdb/testsuite/gdb.base/ -name *.exp* \
| xargs sed -i 's/^\([ \t]*\)clean_restart ${binfile}$/\1clean_restart\n\1gdb_load $binfile/'
$ find gdb/testsuite/gdb.base/ -name *.exp* \
| xargs sed -i 's/^\([ \t]*\)clean_restart $::binfile$/\1clean_restart\n\1gdb_load $::binfile/'
$ find gdb/testsuite/gdb.base/ -name *.exp* \
| xargs sed -i 's/^\([ \t]*\)clean_restart ${::binfile}$/\1clean_restart\n\1gdb_load $::binfile/'
...
Revert the change in test-case gdb.base/foll-vfork.exp, which does
'set binfile $testfile'.
Tested on x86_64-linux.
The only modified test-case I was not able to test is
gdb.base/dtrace-probe.exp (filed PR testsuite/33379 about this). The change
in the test-case is trivial though.
|
|
Gold, lld and mold set sh_entsize to 0 on .got and .got.plt sections.
If sh_entsize of GOT sections is 0, assume 8 for ELFCLASS64 and 4 for
ELFCLASS32, except for x32 which uses 8.
PR binutils/33368
* readelf.c (process_got_section_contents): Handle 0 sh_entsize
of GOT sections.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
This reverts commit c6df5d79aac5c4a77c06314fd26c837470360f70.
Causes buildbot failure. Bug 33381
|
|
While reviewing and testing another patch I set a breakpoint on an
gnu ifunc function, then restarted the inferior, and this assert
triggered:
../../src/gdb/breakpoint.c:14747: internal-error: breakpoint_free_objfile: Assertion `loc->symtab == nullptr' failed.
The backtrace at the time of the assert is:
#6 0x00000000005ffee0 in breakpoint_free_objfile (objfile=0x4064b30) at ../../src/gdb/breakpoint.c:14747
#7 0x0000000000c33ff2 in objfile::~objfile (this=0x4064b30, __in_chrg=<optimized out>) at ../../src/gdb/objfiles.c:478
#8 0x0000000000c38da6 in std::default_delete<objfile>::operator() (this=0x7ffc1a49d538, __ptr=0x4064b30) at /usr/include/c++/9/bits/unique_ptr.h:81
#9 0x0000000000c3782a in std::unique_ptr<objfile, std::default_delete<objfile> >::~unique_ptr (this=0x7ffc1a49d538, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/unique_ptr.h:292
#10 0x0000000000caf1bd in owning_intrusive_list<objfile, intrusive_base_node<objfile> >::erase (this=0x3790d68, i=...) at ../../src/gdb/../gdbsupport/owning_intrusive_list.h:111
#11 0x0000000000cacd0c in program_space::remove_objfile (this=0x3790c80, objfile=0x4064b30) at ../../src/gdb/progspace.c:192
#12 0x0000000000c33e1c in objfile::unlink (this=0x4064b30) at ../../src/gdb/objfiles.c:408
#13 0x0000000000c34fb9 in objfile_purge_solibs (pspace=0x3790c80) at ../../src/gdb/objfiles.c:729
#14 0x0000000000edf6f7 in no_shared_libraries (pspace=0x3790c80) at ../../src/gdb/solib.c:1359
#15 0x0000000000fb3f6c in target_pre_inferior () at ../../src/gdb/target.c:2466
#16 0x0000000000a724d7 in run_command_1 (args=0x0, from_tty=0, run_how=RUN_NORMAL) at ../../src/gdb/infcmd.c:390
#17 0x0000000000a72a97 in run_command (args=0x0, from_tty=0) at ../../src/gdb/infcmd.c:514
#18 0x00000000006bbb3d in do_simple_func (args=0x0, from_tty=0, c=0x39124b0) at ../../src/gdb/cli/cli-decode.c:95
#19 0x00000000006c1021 in cmd_func (cmd=0x39124b0, args=0x0, from_tty=0) at ../../src/gdb/cli/cli-decode.c:2827
The function breakpoint_free_objfile is being called when an objfile
representing a shared library is being unloaded ahead of the inferior
being restarted, the function is trying to remove references to
anything that could itself reference the objfile that is being
deleted.
The assert is making the claim that, for a bp_location, which has a
single address, the objfile of the symtab associated with the location
will be the same as the objfile associated with the section of the
location.
This seems reasonable to me now, as it did when I added the assert in
commit:
commit 5066f3680667ec0f2d1745847a2372d85973a1e7
Date: Mon Nov 11 21:45:17 2024 +0000
gdb: do better in breakpoint_free_objfile
The bp_location::section is maintained, according to the comments in
breakpoint.h, to aid overlay debugging (is that even used any more),
and looking at the code, this does appear to be the case.
The problem in the above case arises when we are dealing with an ifunc
function. What happens is that we end up with a section from one
objfile, but a symtab from a different objfile.
This problem originates from minsym_found (in linespec.c). The user
asked for 'break gnu_ifunc' where 'gnu_ifunc' is an ifunc function.
What this means is that gnu_ifunc is actually a resolver function that
returns the address of the actual function to use.
In this particular test case, the resolver function is in a shared
library, and the actual function to use is in the main executable.
So, when GDB looks for 'gnu_ifunc' is finds the minimal_symbol with
that name, and spots that this has type mst_text_gnu_ifunc. GDB then
uses this to figure out the actual address of the function that will
be run.
GDB then creates the symtab_and_line using the _real_ address and the
symtab in which that address lies, in our case this will all be
related to the main executable objfile.
But, finally, in minsym_found, GDB fills in the symtab_and_line's
section field, and this is done using the section containing the
original minimal_symbol, which is from the shared library objfile.
The minimal symbol and section are then use to initialise the
bp_location object, and this is how we end up in, what I think, is an
unexpected state.
So what to do about this?
The symtab_and_line::msymbol field is _only_ set within minsym_found,
and is then _only_ used to initialise the bp_location::msymbol field.
The bp_location::msymbol field is _only_ used in the function
set_breakpoint_location_function, and we only really care about the
msymbol type, we check to see if it's an ifunc symbol or not. This
allows us to set the name of the function correctly.
The bp_location::section is used, as far as I can tell, extensively
for overlay handling. It would seem to me, that this section should
be the section containing the actual breakpoint address. If the
question we're asking is, is this breakpoint mapped in or not? Then
surely we need to ask about the section holding the breakpoint's
address, and not the section holding some other code (e.g. the
resolver function). In fact, in a memory constrained environment,
you'd expect the resolver functions to get mapped out pretty early on,
but while the actual functions might still be mapped in.
Finally, symtab_and_line::section. This is mostly set using calls to
find_pc_overlay. The minsym_found function is one of the few places
where we do things differently. In the places where the section is
used, it is (almost?) always used in conjunction with the
symtab_and_line::pc to lookup information, e.g. calls to
block_for_pc_sect, or find_pc_sect_containing_function. In all these
cases, it appears to me that the assumption is that the section will
be the section that contains the address.
So, where does this leave us?
I think what we need to do is update minsym_found to just use
find_pc_overlay, which is how the symtab_and_line::section is set in
most other cases. What this actually means in practise is that the
section field will be set to NULL (see find_pc_overlay in symfile.c).
But given that this is how the section is computed in most other
cases, I don't see why it should be especially problematic for this
case. In reality, I think this just means that the section is
calculated via a call to find_pc_section when it's needed, as an
example, see lookup_minimal_symbol_by_pc_section (minsyms.c).
I do wonder if we should be doing better when creating the
symtab_and_line, and insist that the section be calculated correctly
at that point, but I really don't want to open that can of worms right
now, so I think just changing minsym_found to "do it just like
everyone else" should be good enough.
I've extended the existing ifunc test to expose this issue, the
updated test fails without this patch, and passes with.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
|
|
Continuing the removal of 'current_program_space->core_bfd ()' from
GDB, this commit updates the gdbarch method
'gdbarch_core_read_x86_xsave_layout' to take the core file BFD as a
reference parameter. For now this just moves the
'current_program_space->core_bfd ()' calls up the program stack into
core_target::fetch_x86_xsave_layout. In the future I plan to move the
core file BFD object out of the program_space and into the
core_target, at which point these new global accesses can also be
removed.
There should be no user visible changes after this commit.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
|
|
Continuing the removal of 'current_program_space->core_bfd ()' from
GDB, this commit updates the gdbarch method 'gdbarch_core_thread_name'
to take the core file BFD as a reference parameter. For now this just
moves the 'current_program_space->core_bfd ()' calls up the program
stack into core_target::thread_name. In the future I plan to move the
core file BFD object out of the program_space and into the
core_target, at which point these new global accesses can also be
removed.
There should be no user visible changes after this commit.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
|
|
Continuing the removal of 'current_program_space->core_bfd ()' from
GDB, this commit updates two gdbarch methods:
gdbarch_core_xfer_shared_libraries
gdbarch_core_xfer_shared_libraries_aix
to take the core file BFD as a reference parameter. For now this just
moves the 'current_program_space->core_bfd ()' calls up the program
stack into core_target::xfer_partial. In the future I plan to move
the core file BFD object out of the program_space and into the
core_target, at which point these new global accesses can also be
removed.
There should be no user visible changes after this commit.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
|
|
When running test-case gdb.base/fileio.exp with host/target board
local-remote-host-native I run into:
...
gdb compile failed, fileio.c: In function 'test_open':
<command-line>:0:8: error: expected expression before '.' token
fileio.c:89:15: note: in expansion of macro 'OUTDIR'
ret = open (OUTDIR FILENAME, O_CREAT | O_TRUNC | O_RDWR, S_IWUSR | S_IRUSR);
^~~~~~
...
Fix this by using:
- quote_for_host to pass -DOUTDIR to the compilation, and
- STRINGIFY to stringify OUTDIR in fileio.c.
Tested on x86_64-linux, with target board unix and host/target board
local-remote-host-native.
|
|
This patch enables software single stepping for gdbserver target
* gdb/microblaze-tdep.c: Add microblaze_get_next_pcs
Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
Signed-off-by: Gopi Kumar Bulusu <gopi@sankhya.com>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
|
|
Fix fallout on aarch64-linux with test-case
gdb.testsuite/gdb-caching-proc-consistency.exp from erroring out on
clean_restart <absolute filename>.
|
|
I noticed on M1 aarch64-linux that test-case
gdb.testsuite/gdb-caching-proc-consistency.exp took a long time.
I saw lack of progress in gdb.log for proc allow_aarch64_gcs_tests.
This gdb_expect only handles the case that gcs support is detected:
...
gdb_expect {
-re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
verbose -log "\n$me: gcs support detected"
set allow_gcs_tests 1
}
}
...
but in my case, I get:
...
(gdb) run ^M
Starting program: allow_aarch64_gcs_tests.x ^M
[Thread debugging using libthread_db enabled]^M
Using host libthread_db library "/lib64/libthread_db.so.1".^M
[Inferior 1 (process 3336556) exited with code 01]^M
(gdb)
...
so the gdb_expect times out quietly, taking 10 seconds.
In the test-case, it does so 11 times.
Fix this by adding a gdb_expect clause handling the "with code 01" case.
Tested on aarch64-linux.
PR testsuite/33378
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33378
|
|
Bypassing _reloc() isn't a good idea, as there are various errors
checked for there. For example 16-bit JMP or Jcc may not use the @plt
form (resulting in a 32-bit relocation to be emitted for a 16-bit
field), which so far we only reject for 16-bit CALL. In exchange this
allows simplifying the setting up of the "reloc_type" local variable.
|
|
Introduce a clone with extra parameters, to allow subsequent use from
md_estimate_size_before_relax() (or elsewhere, should that turn out
necessary). There flag_code cannot be used and location information
needs to be provided for diagnostics.
|
|
Change-Id: Ifcf80faa240c7c235bfea4ddc79f0d6c39858c5e
|
|
|
|
On platforms where long is 32 bits, this change fixes a build failure:
/home/linux/arm/gdb/src/gdb/aarch64-linux-tdep.c: In function ‘const target_desc* aarch64_linux_core_read_description(gdbarch*, target_ops*, bfd*)’:
/home/linux/arm/gdb/src/gdb/arch/aarch64-gcs-linux.h:27:24: error: left shift count >= width of type [-Werror=shift-count-overflow]
27 | #define HWCAP_GCS (1UL << 32)
| ~~~~^~~~~
/home/linux/arm/gdb/src/gdb/aarch64-linux-tdep.c:1714:47: note: in expansion of macro ‘HWCAP_GCS’
1714 | features.gcs = features.gcs_linux = hwcap & HWCAP_GCS;
| ^~~~~~~~~
Suggested-by: Tom de Vries <tdevries@suse.de>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33372
|
|
After the previous commit, the changes to gdb.dap/scopes.exp from the
commit:
commit 63b862be762e1e6e7ce667c6b4a1a3dd79939bf4
Date: Fri Mar 29 16:38:50 2019 +0100
gdb, gdbserver: Add support of Intel shadow stack pointer register.
Are no longer needed, the test will now happily handle the shadow
stack pointer being unavailable.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33345
Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
|
|
In VariableReference.to_object, we try to convert a gdb.Value to an
int without checking if the value is actually available. This came to
light in PR gdb/33345, after the x86 CET shadow stack patches were
merged.
If the x86 CET shadow stack register is available on the machine,
but the shadow stack feature is not enabled at run time, then the
register will show as "<unavailable>".
As the register is of type 'void *', then in the DAP code we try to
add a 'memoryReference' attribute with the value of the register
formatted as hex. This will fail if the register is unavailable.
To test this change you'll need:
(a) a machine which support the shadow stack feature, and
(b) to revert the changes from commit 63b862be762e1e6e7 in the file
gdb.dap/scopes.exp.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33345
Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
|
|
Add a new gdb.Value.is_unavailable attribute. This is similar to the
existing Value.is_optimized_out attribute, but returns True if any
part of the value is <unavailable>.
The existing Value.is_optimized_out attribute returns true if any part
of the value is optimized out, so I thought that Value.is_unavailable
should work the same way.
There's also a test.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33345
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
|