]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
5 years agoRemove unused ps_lgetLDT etc. on Solaris/x86 [PR25981]
Rainer Orth [Tue, 19 May 2020 08:03:14 +0000 (10:03 +0200)] 
Remove unused ps_lgetLDT etc. on Solaris/x86 [PR25981]

As reported in PR build/25981, a future Solaris 11.4 update will soon
remove the short i386 register names like SS etc. from <sys/regset.h>.
They could leak into user code (e.g. via <signal.h> -> <sys/signal.h> ->
<sys/ucontext.h>) and pollute the user namespace.  Affected code would
have a hard time avoiding the issue: LLVM is one of those.

While the short names are required to be present by the i386 psABI, that
document only demands that they exist in <ucontext.h>, which is what the
upcoming update assures.

With this change, in a 64-bit-default configuration, procfs.c fails to
compile on Solaris/x86:

/vol/src/gnu/gdb/hg/master/git/gdb/procfs.c: In function 'ssd* procfs_find_LDT_entry(ptid_t)':
/vol/src/gnu/gdb/hg/master/git/gdb/procfs.c:1643:18: error: 'GS' was not declared in this scope
 1643 |   key = (*gregs)[GS] & 0xffff;
      |                  ^~
make[2]: *** [Makefile:1607: procfs.o] Error 1

Initially I meant to provide a definition using the planned replacement
macro, but closer inspection revealed a better way.  procfs_find_LDT_entry
and its helper proc_get_LDT_entry are only used to implement ps_lgetLDT,
one of the callback functions required by libthread_db.so.1
(cf. <proc_service.h>).  While that function is still documented as being
required even in Solaris 11.4, I found that calls to it had been removed
long ago in Solaris 9, so just removing the three functions above is the
easiest fix.

The following patch does just that.  It compiled successfully on
amd64-pc-solaris2.11, however, as reported in PR gdb/25939, master is
completely broken on Solaris since the multi-target patch.  The patch
applies cleanly to the gdb-9 branch and there I could test it
successfully.

PR build/25981
* procfs.c [(__i386__ || __x86_64__) && sun] (proc_get_LDT_entry,
procfs_find_LDT_entry): Remove.
* procfs.h [(__i386__ || __x86_64__) && sun] (struct ssd,
procfs_find_LDT_entry): Remove.
* sol-thread.c [(__i386__ || __x86_64__) && sun] (ps_lgetLDT):
Remove.

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 19 May 2020 00:01:04 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 18 May 2020 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agogdb/ChangeLog: Add PR number to the latest entry
Joel Brobecker [Sun, 17 May 2020 15:57:06 +0000 (08:57 -0700)] 
gdb/ChangeLog: Add PR number to the latest entry

This adds the PR number to the following gdb/ChangeLog  entry:

2020-05-17  Tom Tromey  <tromey@adacore.com>

    Pushed by Joel Brobecker  <brobecker@adacore.com>
    PR symtab/26003
    * symfile.c (symbol_file_add_separate): Preserve OBJF_MAINLINE.

5 years agoAvoid infinite recursion in get_msymbol_address
Tom Tromey [Fri, 10 Apr 2020 13:18:49 +0000 (07:18 -0600)] 
Avoid infinite recursion in get_msymbol_address

Sometimes, get_msymbol_address can cause infinite recursion, leading
to a crash.  This was reported previously here:

https://sourceware.org/pipermail/gdb-patches/2019-November/162154.html

A user on irc reported this as well, and with his help and the help of
a friend of his, we found that the problem occurred because, when
reloading a separate debug objfile, the objfile would lose the
OBJF_MAINLINE flag.  This would cause some symbols from this separate
debug objfile to be marked "maybe_copied" -- but then
get_msymbol_address could find the same symbol and fail as reported.

This patch fixes the bug by preserving OBJF_MAINLINE.

No test case, unfortunately, because I could not successfully make
one.

gdb/ChangeLog
2020-04-10  Tom Tromey  <tromey@adacore.com>

* symfile.c (symbol_file_add_separate): Preserve OBJF_MAINLINE.

(cherry picked from commit 0c4311ab90e46d2ae0cc29160641b92220d10299)

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 17 May 2020 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 16 May 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 15 May 2020 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 14 May 2020 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 13 May 2020 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 12 May 2020 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 11 May 2020 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 10 May 2020 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 9 May 2020 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 8 May 2020 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 7 May 2020 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 6 May 2020 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 5 May 2020 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 4 May 2020 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 3 May 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 2 May 2020 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 1 May 2020 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 30 Apr 2020 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 29 Apr 2020 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 28 Apr 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 27 Apr 2020 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 26 Apr 2020 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 25 Apr 2020 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Apr 2020 00:01:14 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 23 Apr 2020 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 22 Apr 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 21 Apr 2020 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 20 Apr 2020 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 19 Apr 2020 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 18 Apr 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 17 Apr 2020 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 16 Apr 2020 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 15 Apr 2020 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 14 Apr 2020 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 13 Apr 2020 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 12 Apr 2020 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 11 Apr 2020 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 10 Apr 2020 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 9 Apr 2020 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 8 Apr 2020 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 7 Apr 2020 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 6 Apr 2020 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 5 Apr 2020 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 4 Apr 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 3 Apr 2020 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 2 Apr 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 1 Apr 2020 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 31 Mar 2020 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 30 Mar 2020 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 29 Mar 2020 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 28 Mar 2020 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 27 Mar 2020 00:01:07 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 26 Mar 2020 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 Mar 2020 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 24 Mar 2020 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 Mar 2020 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 Mar 2020 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 Mar 2020 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 Mar 2020 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 Mar 2020 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 18 Mar 2020 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 Mar 2020 13:46:21 +0000 (13:46 +0000)] 
Automatic date update in version.in

5 years agoFix printf of a convenience variable holding an inferior address
Sergio Durigan Junior [Mon, 9 Mar 2020 22:47:47 +0000 (18:47 -0400)] 
Fix printf of a convenience variable holding an inferior address

Back at:

commit 1f6f6e21fa86dc3411a6498608f32e9eb24b7851
Author: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Date:   Mon Jun 10 21:41:51 2019 +0200

    Ensure GDB printf command can print convenience var strings without a target.

GDB was extended in order to allow the printing of convenience
variables that are strings without a target.  However, this introduced
a regression that hasn't been caught by our testsuite (because there
were no tests for it).

The problem happens when we try to print a convenience variable that
holds the address of a string in the inferior.  The following
two-liners can reproduce the issue:

$ echo -e 'int main(){const char a[]="test";return 0;}' | gcc -x c - -O0-g3
$ ./gdb/gdb --data-directory ./gdb/data-directory -q ./a.out -ex 'start' -ex 'set $x = (const char *) (&a[0] + 2)' -ex 'printf "%s\n", $x'

After some investigation, I found that the problem happens on
printcmd.c:printf_c_string.  In the case above, we're taking the first
branch of the 'if' condition, which assumes that there will be a value
to be printed at "value_contents (value)".  There isn't.  We actually
need to obtain the address that the variable points to, and read the
contents from memory.

It seems to me that we should avoid this branch if the TYPE_CODE of
"value_type (value)" is TYPE_CODE_PTR (i.e., a pointer to the
inferior's memory).  This is what this patch does.

I took the liberty to extend the current testcase under
gdb.base/printcmds.exp and create a test that exercises this scenario.

No regressions have been found on Buildbot.

gdb/ChangeLog:
2020-03-03  Sergio Durigan Junior  <sergiodj@redhat.com>

PR gdb/25650
* printcmd.c (print_c_string): Check also for TYPE_CODE_PTR
when verifying if dealing with a convenience variable.

gdb/testsuite/ChangeLog:
2020-03-03  Sergio Durigan Junior  <sergiodj@redhat.com>

PR gdb/25650
* gdb.base/printcmds.exp: Add test to verify printf of a
variable holding an address.

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 7 Mar 2020 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 Mar 2020 00:01:48 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 Mar 2020 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 4 Mar 2020 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 3 Mar 2020 00:01:17 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 2 Mar 2020 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 1 Mar 2020 00:01:34 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 29 Feb 2020 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 28 Feb 2020 00:02:24 +0000 (00:02 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 27 Feb 2020 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 26 Feb 2020 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 25 Feb 2020 00:01:45 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 24 Feb 2020 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 23 Feb 2020 00:02:14 +0000 (00:02 +0000)] 
Automatic date update in version.in

5 years agoFix resizing of GDB TUI windows via 'winheight'.
Eli Zaretskii [Sat, 22 Feb 2020 20:10:29 +0000 (22:10 +0200)] 
Fix resizing of GDB TUI windows via 'winheight'.

gdb/ChangeLog:
2020-02-22  Eli Zaretskii  <eliz@gnu.org>

PRE gdb/25586:
* tui/tui-win.c (new_height_ok, tui_adjust_win_heights): Rename
'locator' to 'status_line', to better match terminology in the
manual.
(tui_adjust_win_heights): Resize the status_line window to match
the new dimensions of the command and source/disassembly windows.
Reported by Aleksey Midenkov <midenok@gmail.com>.

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 22 Feb 2020 00:01:04 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 21 Feb 2020 00:02:24 +0000 (00:02 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 20 Feb 2020 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 19 Feb 2020 00:01:22 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 18 Feb 2020 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 17 Feb 2020 00:01:17 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 16 Feb 2020 00:02:15 +0000 (00:02 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 15 Feb 2020 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 14 Feb 2020 00:01:43 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 13 Feb 2020 00:01:14 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 12 Feb 2020 00:01:28 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 11 Feb 2020 00:01:32 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 10 Feb 2020 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 9 Feb 2020 00:02:07 +0000 (00:02 +0000)] 
Automatic date update in version.in

5 years agoBump GDB version number to 9.1.90.DATE-git.
Joel Brobecker [Sat, 8 Feb 2020 13:14:10 +0000 (17:14 +0400)] 
Bump GDB version number to 9.1.90.DATE-git.

gdb/ChangeLog:

* version.in: Set GDB version number to 9.1.90.DATE-git.

5 years agoDocument the GDB 9.1 release in gdb/ChangeLog
Joel Brobecker [Sat, 8 Feb 2020 13:02:09 +0000 (17:02 +0400)] 
Document the GDB 9.1 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 9.1 released.

5 years agoSet GDB version number to 9.1. gdb-9.1-release
Joel Brobecker [Sat, 8 Feb 2020 12:50:15 +0000 (16:50 +0400)] 
Set GDB version number to 9.1.

gdb/ChangeLog:

* version.in: Set GDB version number to 9.1.