forked from Imagelibrary/binutils-gdb
Compare commits
29 Commits
users/palv
...
gdb-12.1-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e53a8e8685 | ||
|
|
4324e94471 | ||
|
|
e312dfbe95 | ||
|
|
3ab22dba1b | ||
|
|
f0072f79e1 | ||
|
|
04f521a6ef | ||
|
|
d063203192 | ||
|
|
db7127461e | ||
|
|
7b5e70a921 | ||
|
|
74f8cb8887 | ||
|
|
013dbf15db | ||
|
|
f48fc32448 | ||
|
|
d4c9e8f583 | ||
|
|
4f538bcbb7 | ||
|
|
1ab8f3967d | ||
|
|
0349d33f1d | ||
|
|
81f81faa8f | ||
|
|
aba6eff2e0 | ||
|
|
4393855615 | ||
|
|
810db22c7f | ||
|
|
b86dbc4c45 | ||
|
|
09ab0d2eec | ||
|
|
95c82cbf7e | ||
|
|
7685884a38 | ||
|
|
eb3ec1b698 | ||
|
|
9d7105d14c | ||
|
|
fc8b2d4b5d | ||
|
|
5dd959bace | ||
|
|
5e8b7e78b6 |
@@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Controls whether to enable development-mode features by default.
|
||||
development=true
|
||||
development=false
|
||||
|
||||
# Indicate whether this is a release branch.
|
||||
experimental=true
|
||||
|
||||
2
gdb/NEWS
2
gdb/NEWS
@@ -1,7 +1,7 @@
|
||||
What has changed in GDB?
|
||||
(Organized release by release)
|
||||
|
||||
*** Changes since GDB 11
|
||||
*** Changes in GDB 12
|
||||
|
||||
* DBX mode is deprecated, and will be removed in GDB 13
|
||||
|
||||
|
||||
@@ -434,11 +434,11 @@ processInt (struct parser_state *par_state, const char *base0,
|
||||
return FLOAT;
|
||||
}
|
||||
|
||||
gdb_mpz maxval (ULONGEST_MAX / base);
|
||||
gdb_mpz maxval (ULONGEST_MAX);
|
||||
if (mpz_cmp (result.val, maxval.val) > 0)
|
||||
error (_("Integer literal out of range"));
|
||||
|
||||
LONGEST value = result.as_integer<LONGEST> ();
|
||||
ULONGEST value = result.as_integer<ULONGEST> ();
|
||||
if ((value >> (gdbarch_int_bit (par_state->gdbarch ())-1)) == 0)
|
||||
yylval.typed_val.type = type_int (par_state);
|
||||
else if ((value >> (gdbarch_long_bit (par_state->gdbarch ())-1)) == 0)
|
||||
|
||||
@@ -18014,7 +18014,6 @@ to be difficult.
|
||||
* Ada Tasks and Core Files:: Tasking Support when Debugging Core Files
|
||||
* Ravenscar Profile:: Tasking Support when using the Ravenscar
|
||||
Profile
|
||||
* Ada Settings:: New settable GDB parameters for Ada.
|
||||
* Ada Source Character Set:: Character set of Ada source files.
|
||||
* Ada Glitches:: Known peculiarities of Ada mode.
|
||||
@end menu
|
||||
@@ -18748,37 +18747,6 @@ it isn't currently possible to single-step through the runtime
|
||||
initialization sequence. If you need to debug this code, you should
|
||||
use @code{set ravenscar task-switching off}.
|
||||
|
||||
@node Ada Settings
|
||||
@subsubsection Ada Settings
|
||||
@cindex Ada settings
|
||||
|
||||
@table @code
|
||||
@kindex set varsize-limit
|
||||
@item set varsize-limit @var{size}
|
||||
Prevent @value{GDBN} from attempting to evaluate objects whose size
|
||||
is above the given limit (@var{size}) when those sizes are computed
|
||||
from run-time quantities. This is typically the case when the object
|
||||
has a variable size, such as an array whose bounds are not known at
|
||||
compile time for example. Setting @var{size} to @code{unlimited}
|
||||
removes the size limitation. By default, the limit is about 65KB.
|
||||
|
||||
The purpose of having such a limit is to prevent @value{GDBN} from
|
||||
trying to grab enormous chunks of virtual memory when asked to evaluate
|
||||
a quantity whose bounds have been corrupted or have not yet been fully
|
||||
initialized. The limit applies to the results of some subexpressions
|
||||
as well as to complete expressions. For example, an expression denoting
|
||||
a simple integer component, such as @code{x.y.z}, may fail if the size of
|
||||
@code{x.y} is variable and exceeds @code{size}. On the other hand,
|
||||
@value{GDBN} is sometimes clever; the expression @code{A(i)}, where
|
||||
@code{A} is an array variable with non-constant size, will generally
|
||||
succeed regardless of the bounds on @code{A}, as long as the component
|
||||
size is less than @var{size}.
|
||||
|
||||
@kindex show varsize-limit
|
||||
@item show varsize-limit
|
||||
Show the limit on types whose size is determined by run-time quantities.
|
||||
@end table
|
||||
|
||||
@node Ada Source Character Set
|
||||
@subsubsection Ada Source Character Set
|
||||
@cindex Ada, source character set
|
||||
|
||||
@@ -821,19 +821,6 @@ gdb_readline_no_editing_callback (gdb_client_data client_data)
|
||||
FILE *stream = ui->instream != nullptr ? ui->instream : ui->stdin_stream;
|
||||
gdb_assert (stream != nullptr);
|
||||
|
||||
/* Unbuffer the input stream, so that, later on, the calls to fgetc
|
||||
fetch only one char at the time from the stream. The fgetc's will
|
||||
get up to the first newline, but there may be more chars in the
|
||||
stream after '\n'. If we buffer the input and fgetc drains the
|
||||
stream, getting stuff beyond the newline as well, a select, done
|
||||
afterwards will not trigger.
|
||||
|
||||
This unbuffering was, at one point, not applied if the input stream
|
||||
was a tty, however, the buffering can cause problems, even for a tty,
|
||||
in some cases. Please ensure that any changes in this area run the MI
|
||||
tests with the FORCE_SEPARATE_MI_TTY=1 flag being passed. */
|
||||
setbuf (stream, NULL);
|
||||
|
||||
/* We still need the while loop here, even though it would seem
|
||||
obvious to invoke gdb_readline_no_editing_callback at every
|
||||
character entered. If not using the readline library, the
|
||||
|
||||
@@ -1974,27 +1974,51 @@ struct user_selected_context
|
||||
{
|
||||
/* Constructor. */
|
||||
user_selected_context ()
|
||||
: m_previous_ptid (inferior_ptid),
|
||||
m_previous_frame (deprecated_safe_get_selected_frame ())
|
||||
{ /* Nothing. */ }
|
||||
: m_previous_ptid (inferior_ptid)
|
||||
{
|
||||
save_selected_frame (&m_previous_frame_id, &m_previous_frame_level);
|
||||
}
|
||||
|
||||
/* Return true if the user selected context has changed since this object
|
||||
was created. */
|
||||
bool has_changed () const
|
||||
{
|
||||
return ((m_previous_ptid != null_ptid
|
||||
&& inferior_ptid != null_ptid
|
||||
&& m_previous_ptid != inferior_ptid)
|
||||
|| m_previous_frame != deprecated_safe_get_selected_frame ());
|
||||
/* Did the selected thread change? */
|
||||
if (m_previous_ptid != null_ptid && inferior_ptid != null_ptid
|
||||
&& m_previous_ptid != inferior_ptid)
|
||||
return true;
|
||||
|
||||
/* Grab details of the currently selected frame, for comparison. */
|
||||
frame_id current_frame_id;
|
||||
int current_frame_level;
|
||||
save_selected_frame (¤t_frame_id, ¤t_frame_level);
|
||||
|
||||
/* Did the selected frame level change? */
|
||||
if (current_frame_level != m_previous_frame_level)
|
||||
return true;
|
||||
|
||||
/* Did the selected frame id change? If the innermost frame is
|
||||
selected then the level will be -1, and the frame-id will be
|
||||
null_frame_id. As comparing null_frame_id with itself always
|
||||
reports not-equal, we only do the equality test if we have something
|
||||
other than the innermost frame selected. */
|
||||
if (current_frame_level != -1
|
||||
&& !frame_id_eq (current_frame_id, m_previous_frame_id))
|
||||
return true;
|
||||
|
||||
/* Nothing changed! */
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
/* The previously selected thread. This might be null_ptid if there was
|
||||
no previously selected thread. */
|
||||
ptid_t m_previous_ptid;
|
||||
|
||||
/* The previously selected frame. This might be nullptr if there was no
|
||||
previously selected frame. */
|
||||
frame_info *m_previous_frame;
|
||||
/* The previously selected frame. If the innermost frame is selected, or
|
||||
no frame is selected, then the frame_id will be null_frame_id, and the
|
||||
level will be -1. */
|
||||
frame_id m_previous_frame_id;
|
||||
int m_previous_frame_level;
|
||||
};
|
||||
|
||||
static void
|
||||
|
||||
@@ -201,6 +201,8 @@ handle_exception (struct target_waitstatus *ourstatus, bool debug_exceptions)
|
||||
thread_rec (ptid_t (current_event.dwProcessId, current_event.dwThreadId, 0),
|
||||
DONT_SUSPEND);
|
||||
|
||||
last_sig = GDB_SIGNAL_0;
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case EXCEPTION_ACCESS_VIOLATION:
|
||||
@@ -261,8 +263,10 @@ handle_exception (struct target_waitstatus *ourstatus, bool debug_exceptions)
|
||||
on startup, first a BREAKPOINT for the 64bit ntdll.dll,
|
||||
then a WX86_BREAKPOINT for the 32bit ntdll.dll.
|
||||
Here we only care about the WX86_BREAKPOINT's. */
|
||||
DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT - ignore_first_breakpoint");
|
||||
ourstatus->set_spurious ();
|
||||
ignore_first_breakpoint = false;
|
||||
break;
|
||||
}
|
||||
else if (wow64_process)
|
||||
{
|
||||
@@ -273,7 +277,7 @@ handle_exception (struct target_waitstatus *ourstatus, bool debug_exceptions)
|
||||
gdb lets the target process continue.
|
||||
So handle it as SIGINT instead, then the target is stopped
|
||||
unconditionally. */
|
||||
DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT");
|
||||
DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT - wow64_process");
|
||||
rec->ExceptionCode = DBG_CONTROL_C;
|
||||
ourstatus->set_stopped (GDB_SIGNAL_INT);
|
||||
break;
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "observable.h"
|
||||
#include "gdbsupport/scoped_fd.h"
|
||||
#include "gdbsupport/pathstuff.h"
|
||||
#include "gdbsupport/buildargv.h"
|
||||
|
||||
/* This module provides the interface between GDB and the
|
||||
/proc file system, which is used on many versions of Unix
|
||||
|
||||
10
gdb/remote.c
10
gdb/remote.c
@@ -1968,15 +1968,17 @@ add_packet_config_cmd (struct packet_config *config, const char *name,
|
||||
/* set/show remote NAME-packet {auto,on,off} -- legacy. */
|
||||
if (legacy)
|
||||
{
|
||||
/* It's not clear who should take ownership of this string, so, for
|
||||
now, make it static, and give copies to each of the add_alias_cmd
|
||||
calls below. */
|
||||
static gdb::unique_xmalloc_ptr<char> legacy_name
|
||||
/* It's not clear who should take ownership of the LEGACY_NAME string
|
||||
created below, so, for now, place the string into a static vector
|
||||
which ensures the strings is released when GDB exits. */
|
||||
static std::vector<gdb::unique_xmalloc_ptr<char>> legacy_names;
|
||||
gdb::unique_xmalloc_ptr<char> legacy_name
|
||||
= xstrprintf ("%s-packet", name);
|
||||
add_alias_cmd (legacy_name.get (), cmds.set, class_obscure, 0,
|
||||
&remote_set_cmdlist);
|
||||
add_alias_cmd (legacy_name.get (), cmds.show, class_obscure, 0,
|
||||
&remote_show_cmdlist);
|
||||
legacy_names.emplace_back (std::move (legacy_name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +271,10 @@ struct rust_parser
|
||||
operation_up parse_entry_point ()
|
||||
{
|
||||
lex ();
|
||||
return parse_expr ();
|
||||
operation_up result = parse_expr ();
|
||||
if (current_token != 0)
|
||||
error (_("Syntax error near '%s'"), pstate->prev_lexptr);
|
||||
return result;
|
||||
}
|
||||
|
||||
operation_up parse_tuple ();
|
||||
@@ -2020,6 +2023,7 @@ rust_parser::parse_atom (bool required)
|
||||
|
||||
case STRING:
|
||||
result = parse_string ();
|
||||
lex ();
|
||||
break;
|
||||
|
||||
case BYTESTRING:
|
||||
|
||||
@@ -1453,11 +1453,6 @@ svr4_fetch_objfile_link_map (struct objfile *objfile)
|
||||
if (objfile == current_program_space->symfile_object_file)
|
||||
return info->main_lm_addr;
|
||||
|
||||
/* If OBJFILE is a separate debug object file, look for the
|
||||
original object file. */
|
||||
if (objfile->separate_debug_objfile_backlink != NULL)
|
||||
objfile = objfile->separate_debug_objfile_backlink;
|
||||
|
||||
/* The other link map addresses may be found by examining the list
|
||||
of shared libraries. */
|
||||
for (struct so_list *so : current_program_space->solibs ())
|
||||
|
||||
@@ -1296,6 +1296,11 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
|
||||
struct target_ops *target = current_inferior ()->top_target ();
|
||||
struct gdbarch *gdbarch = target_gdbarch ();
|
||||
|
||||
/* If OBJFILE is a separate debug object file, look for the
|
||||
original object file. */
|
||||
if (objfile->separate_debug_objfile_backlink != NULL)
|
||||
objfile = objfile->separate_debug_objfile_backlink;
|
||||
|
||||
if (gdbarch_fetch_tls_load_module_address_p (gdbarch))
|
||||
{
|
||||
ptid_t ptid = inferior_ptid;
|
||||
|
||||
@@ -418,7 +418,7 @@ private:
|
||||
char *execd_pathname;
|
||||
/* Syscall number */
|
||||
int syscall_number;
|
||||
} m_value;
|
||||
} m_value {};
|
||||
};
|
||||
|
||||
/* Extended reasons that can explain why a target/thread stopped for a
|
||||
|
||||
@@ -49,27 +49,56 @@ foreach_with_prefix scenario {all minimal} {
|
||||
|
||||
gdb_test "ptype string_access" "= access array \\(<>\\) of character"
|
||||
|
||||
set kfail_int128support_re \
|
||||
"That operation is not available on integers of more than 8 bytes\\."
|
||||
set kfail_packed_array_range_re \
|
||||
# GNAT >= 12.0 has the needed fix here.
|
||||
set xfail_expected 0
|
||||
if {$scenario == "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]} {
|
||||
set xfail_expected 1
|
||||
}
|
||||
|
||||
gdb_test_multiple "print pa_ptr.all" "" {
|
||||
-re -wrap " = \\(10, 20, 30, 40, 50, 60, 62, 63, -23, 42\\)" {
|
||||
pass $gdb_test_name
|
||||
}
|
||||
-re -wrap " = \[0-9\]+" {
|
||||
if { $xfail_expected } {
|
||||
xfail $gdb_test_name
|
||||
} else {
|
||||
fail $gdb_test_name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set xfail_cannot_subscript_re \
|
||||
"cannot subscript or call something of type `foo__packed_array_ptr'"
|
||||
|
||||
# GNAT >= 12.0 has the needed fix here.
|
||||
if {$scenario == "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]} {
|
||||
setup_kfail "minimal encodings" *-*-*
|
||||
}
|
||||
gdb_test "print pa_ptr.all" \
|
||||
" = \\(10, 20, 30, 40, 50, 60, 62, 63, -23, 42\\)"
|
||||
gdb_test_multiple "print pa_ptr(3)" "" {
|
||||
-re -wrap " = 30" {
|
||||
pass $gdb_test_name
|
||||
|
||||
# GNAT >= 12.0 has the needed fix here.
|
||||
if {$scenario == "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]} {
|
||||
setup_kfail "minimal encodings" *-*-*
|
||||
}
|
||||
-re -wrap $xfail_cannot_subscript_re {
|
||||
if { $xfail_expected } {
|
||||
xfail $gdb_test_name
|
||||
} else {
|
||||
fail $gdb_test_name
|
||||
}
|
||||
}
|
||||
}
|
||||
gdb_test "print pa_ptr(3)" " = 30"
|
||||
|
||||
# GNAT >= 12.0 has the needed fix here.
|
||||
if {$scenario == "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]} {
|
||||
setup_kfail "minimal encodings" *-*-*
|
||||
set xfail_attempt_to_index_re \
|
||||
"Attempt to index or call something other than an array or function"
|
||||
|
||||
gdb_test_multiple "print pa_ptr.all(3)" "" {
|
||||
-re -wrap " = 30" {
|
||||
pass $gdb_test_name
|
||||
|
||||
}
|
||||
-re -wrap $xfail_attempt_to_index_re {
|
||||
if { $xfail_expected } {
|
||||
xfail $gdb_test_name
|
||||
} else {
|
||||
fail $gdb_test_name
|
||||
}
|
||||
}
|
||||
}
|
||||
gdb_test "print pa_ptr.all(3)" " = 30"
|
||||
}
|
||||
|
||||
@@ -42,12 +42,29 @@ gdb_test "print val_double := 16lf#bc0d83c94fb6d2ac#" " = -2.0e-19"
|
||||
gdb_test "print val_double" " = -2.0e-19" \
|
||||
"print val_double after assignment"
|
||||
|
||||
gdb_test "print 16llf#7FFFF7FF4054A56FA5B99019A5C8#" " = 5.0e\\+25"
|
||||
set 16llf_supported 0
|
||||
gdb_test_multiple "ptype long_long_float" "" {
|
||||
-re -wrap "<16-byte float>" {
|
||||
set 16llf_supported 1
|
||||
pass $gdb_test_name
|
||||
}
|
||||
-re -wrap "<\\d+-byte float>" {
|
||||
pass $gdb_test_name
|
||||
}
|
||||
}
|
||||
|
||||
if { $16llf_supported } {
|
||||
gdb_test "print 16llf#7FFFF7FF4054A56FA5B99019A5C8#" " = 5.0e\\+25"
|
||||
}
|
||||
gdb_test "print val_long_double" " = 5.0e\\+25"
|
||||
gdb_test "print val_long_double := 16llf#7FFFF7FF4054A56FA5B99019A5C8#" \
|
||||
" = 5.0e\\+25"
|
||||
if { $16llf_supported } {
|
||||
gdb_test "print val_long_double := 16llf#7FFFF7FF4054A56FA5B99019A5C8#" \
|
||||
" = 5.0e\\+25"
|
||||
}
|
||||
gdb_test "print val_long_double" " = 5.0e\\+25" \
|
||||
"print val_long_double after assignment"
|
||||
|
||||
gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \
|
||||
" = <invalid float value>"
|
||||
if { $16llf_supported } {
|
||||
gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \
|
||||
" = <invalid float value>"
|
||||
}
|
||||
|
||||
@@ -34,3 +34,6 @@ gdb_test "print 2e1000" "Integer literal out of range"
|
||||
gdb_test "print 16#ffff#" " = 65535"
|
||||
gdb_test "print 16#f#e1" " = 240"
|
||||
gdb_test "print 16#1#e10" " = 1099511627776"
|
||||
|
||||
gdb_test "print/x 16#7fffffffffffffff#" " = 0x7fffffffffffffff"
|
||||
gdb_test "print 16#ffffffffffffffff#" " = -1"
|
||||
|
||||
@@ -128,41 +128,66 @@ gdb_test_multiple "info break" "breakpoint info" {
|
||||
set binexp [string_to_regexp $binfile]
|
||||
|
||||
set warning_slow_re \
|
||||
"warning: File transfers from remote targets can be slow\[^\r\n\]+"
|
||||
"warning: File transfers from remote targets can be slow\[^\r\n\]+\r\n"
|
||||
set warning_gdb_index_re \
|
||||
[multi_line \
|
||||
"warning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+" \
|
||||
"Do \"set use-deprecated-index-sections on\" before the file is read" \
|
||||
"to use the section anyway\\."]
|
||||
"to use the section anyway\\.\r\n"]
|
||||
set reading_re \
|
||||
"Reading \[^\r\n\]+"
|
||||
"Reading \[^\r\n\]+\r\n"
|
||||
set libthread_db_re \
|
||||
[multi_line \
|
||||
"\\\[Thread debugging using libthread_db enabled\\\]" \
|
||||
"Using host libthread_db library \[^\r\n\]+"]
|
||||
"Using host libthread_db library \[^\r\n\]+\r\n"]
|
||||
|
||||
set optional_re \
|
||||
[list \
|
||||
"\(" \
|
||||
"\($reading_re)" \
|
||||
"|" \
|
||||
"\($warning_slow_re\)" \
|
||||
"|" \
|
||||
"\($libthread_db_re\)" \
|
||||
"|" \
|
||||
"\(\r\n$warning_gdb_index_re\)?" \
|
||||
"\)*"]
|
||||
set optional_re [join $optional_re ""]
|
||||
|
||||
set run_re \
|
||||
[list \
|
||||
"\r\n\032\032post-prompt\r\nStarting program: $binexp " \
|
||||
"\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)\)*" \
|
||||
"\(\r\n$warning_gdb_index_re\)?" \
|
||||
"\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
|
||||
"\032\032starting\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)|\r\n$libthread_db_re\)*" \
|
||||
"\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
|
||||
"\032\032breakpoint 1\r\n\r\n" \
|
||||
"Breakpoint 1, \r\n" \
|
||||
"\032\032frame-begin 0 $hex\r\n\r\n" \
|
||||
"\032\032frame-function-name\r\n" \
|
||||
"main\r\n" \
|
||||
"\032\032frame-args\r\n \\(\\)\r\n" \
|
||||
"\032\032frame-source-begin\r\n at \r\n" \
|
||||
"\032\032frame-source-file\r\n.*annota1.c\r\n" \
|
||||
"\032\032frame-source-file-end\r\n:\r\n" \
|
||||
"\032\032frame-source-line\r\n$main_line\r\n" \
|
||||
"\032\032frame-source-end\r\n\r\n\r\n" \
|
||||
"\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n" \
|
||||
"\032\032frame-end\r\n\r\n" \
|
||||
"\032\032stopped"]
|
||||
"\r\n\032\032post-prompt\r\n" \
|
||||
"Starting program: $binexp \r\n" \
|
||||
$optional_re \
|
||||
"\(\r\n\032\032breakpoints-invalid\r\n\)?" \
|
||||
$optional_re \
|
||||
"\r\n\032\032starting\r\n" \
|
||||
$optional_re \
|
||||
"\r\n\032\032frames-invalid\r\n" \
|
||||
$optional_re \
|
||||
"\r\n\032\032breakpoints-invalid\r\n" \
|
||||
$optional_re \
|
||||
"\r\n\032\032breakpoint 1\r\n" \
|
||||
"\r\n" \
|
||||
"Breakpoint 1, " \
|
||||
"\r\n\032\032frame-begin 0 $hex\r\n" \
|
||||
"\r\n\032\032frame-function-name\r\n" \
|
||||
"main" \
|
||||
"\r\n\032\032frame-args\r\n" \
|
||||
" \\(\\)" \
|
||||
"\r\n\032\032frame-source-begin\r\n" \
|
||||
" at " \
|
||||
"\r\n\032\032frame-source-file\r\n" \
|
||||
".*annota1.c" \
|
||||
"\r\n\032\032frame-source-file-end\r\n" \
|
||||
":" \
|
||||
"\r\n\032\032frame-source-line\r\n" \
|
||||
"$main_line" \
|
||||
"\r\n\032\032frame-source-end\r\n" \
|
||||
"\r\n" \
|
||||
"\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n" \
|
||||
"\r\n\032\032frame-end\r\n" \
|
||||
"\r\n\032\032stopped\r\n"]
|
||||
|
||||
set run_re [join $run_re ""]
|
||||
|
||||
|
||||
@@ -195,4 +195,9 @@ gdb_test_no_output "set remote hardware-breakpoint-limit -1"
|
||||
gdb_test_no_output "set remote hardware-watchpoint-limit 2147483647"
|
||||
gdb_test_no_output "set remote hardware-breakpoint-limit 2147483647"
|
||||
|
||||
# Check the X/P/p alias commands display the correct packet names.
|
||||
foreach pkt {X P p} {
|
||||
gdb_test "show remote ${pkt}-packet" "Support for the `${pkt}' packet is.*"
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
|
||||
@@ -42,10 +42,10 @@ proc stap_test {exec_name {args ""}} {
|
||||
"check argument not at probe point"
|
||||
|
||||
if {[string first "-DUSE_SEMAPHORES" $args] != -1} {
|
||||
gdb_test "info probes stap" \
|
||||
gdb_test_lines "info probes stap" "" \
|
||||
"test *user *$hex *$hex .*"
|
||||
} else {
|
||||
gdb_test "info probes stap" \
|
||||
gdb_test_lines "info probes stap" "" \
|
||||
"test *user *$hex .*"
|
||||
}
|
||||
|
||||
|
||||
@@ -84,9 +84,9 @@ gdb_breakpoint "foo"
|
||||
gdb_continue_to_breakpoint "foo"
|
||||
|
||||
gdb_test_multiple "return 35" "" {
|
||||
-re ".*Function 'foo' does not follow the target calling convention.\r\nIf you continue, setting the return value will probably lead to unpredictable behaviors.\r\nMake foo return now?.*\\(y or n\\) $" {
|
||||
send_gdb "n\n"
|
||||
-re "Function 'foo' does not follow the target calling convention.\r\nIf you continue, setting the return value will probably lead to unpredictable behaviors.\r\nMake foo return now\\? \\(y or n\\) $" {
|
||||
pass $gdb_test_name
|
||||
gdb_test "n" "Not confirmed" "cancel return"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,10 @@ if {![dwarf2_support]} {
|
||||
|
||||
standard_testfile .S -main.c
|
||||
|
||||
set binfile_stripped ${binfile}-stripped
|
||||
|
||||
if { [prepare_for_testing "failed to prepare" "${testfile}" \
|
||||
[list $srcfile2 $srcfile] {nodebug}] } {
|
||||
[list $srcfile2 $srcfile] {nodebug nopie}] } {
|
||||
return -1
|
||||
}
|
||||
|
||||
@@ -40,7 +42,7 @@ gdb_unload
|
||||
# Strip out any labels there as they could corrupt the `main' name.
|
||||
|
||||
set objcopy_program [gdb_find_objcopy]
|
||||
set command "$objcopy_program -N block_start -N block_end -N break_at ${binfile}"
|
||||
set command "$objcopy_program -N block_start -N block_end -N break_at ${binfile} ${binfile_stripped}"
|
||||
verbose -log "Executing: $command"
|
||||
set result [catch "exec $command" output]
|
||||
verbose "result is $result"
|
||||
@@ -49,7 +51,7 @@ if {$result != 0} {
|
||||
return -1
|
||||
}
|
||||
|
||||
gdb_load ${binfile}
|
||||
gdb_load ${binfile_stripped}
|
||||
|
||||
if ![runto "*${break_at}"] {
|
||||
return -1
|
||||
|
||||
@@ -114,7 +114,7 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} {
|
||||
return -1
|
||||
}
|
||||
|
||||
gdb_breakpoint "bar"
|
||||
gdb_breakpoint "bar_label"
|
||||
gdb_continue_to_breakpoint "foo \\(1\\)"
|
||||
|
||||
gdb_test "next" "foo \\(2\\).*" "next to foo (2)"
|
||||
|
||||
@@ -49,7 +49,7 @@ gdb_test_multiple "maintenance print symbols" "" {
|
||||
-re "^\r\n void main.T.Bar\[^\r\n\]*(?=\r\n)" {
|
||||
exp_continue
|
||||
}
|
||||
-re "\r\n$gdb_prompt $" {
|
||||
-re "^\r\n$gdb_prompt $" {
|
||||
pass $gdb_test_name
|
||||
}
|
||||
-re "\r\n\[^\r\n\]*(?=\r\n)" {
|
||||
|
||||
73
gdb/testsuite/gdb.mi/mi-cmd-user-context.c
Normal file
73
gdb/testsuite/gdb.mi/mi-cmd-user-context.c
Normal file
@@ -0,0 +1,73 @@
|
||||
/* This testcase is part of GDB, the GNU debugger.
|
||||
|
||||
Copyright 2016-2022 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 <pthread.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define NUM_THREADS 2
|
||||
|
||||
static volatile int unblock_main[NUM_THREADS];
|
||||
|
||||
static void
|
||||
child_sub_function (int child_idx)
|
||||
{
|
||||
volatile int dummy = 0;
|
||||
|
||||
unblock_main[child_idx] = 1;
|
||||
|
||||
while (1)
|
||||
/* Dummy loop body to allow setting breakpoint. */
|
||||
dummy = !dummy; /* thread loop line */
|
||||
}
|
||||
|
||||
static void *
|
||||
child_function (void *args)
|
||||
{
|
||||
int child_idx = (int) (uintptr_t) args;
|
||||
|
||||
child_sub_function (child_idx); /* thread caller line */
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
int i = 0;
|
||||
pthread_t threads[NUM_THREADS];
|
||||
|
||||
/* Make the test exit eventually. */
|
||||
alarm (20);
|
||||
|
||||
for (i = 0; i < NUM_THREADS; i++)
|
||||
pthread_create (&threads[i], NULL, child_function, (void *) (uintptr_t) i);
|
||||
|
||||
/* Wait for child threads to reach child_sub_function. */
|
||||
for (i = 0; i < NUM_THREADS; i++)
|
||||
while (!unblock_main[i])
|
||||
;
|
||||
|
||||
volatile int dummy = 0;
|
||||
while (1)
|
||||
/* Dummy loop body to allow setting breakpoint. */
|
||||
dummy = !dummy; /* main break line */
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
load_lib mi-support.exp
|
||||
|
||||
standard_testfile user-selected-context-sync.c
|
||||
standard_testfile
|
||||
|
||||
if {[build_executable $testfile.exp $testfile ${srcfile} "debug pthreads"] == -1} {
|
||||
untested "failed to compile"
|
||||
@@ -79,7 +79,7 @@ mi_gdb_test "thread" \
|
||||
|
||||
# Check we're in frame 0.
|
||||
mi_gdb_test "frame" \
|
||||
".*#0 0x.*" \
|
||||
".*#0 .*child_sub_function .*" \
|
||||
"frame 1"
|
||||
|
||||
# Ask about a different frame in the current thread, the current frame
|
||||
@@ -93,7 +93,7 @@ mi_gdb_test "thread" \
|
||||
"info thread 6"
|
||||
|
||||
mi_gdb_test "frame" \
|
||||
".*#0 0x.*" \
|
||||
".*#0 .*child_sub_function.*" \
|
||||
"frame 2"
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ mi_gdb_test "thread" \
|
||||
"info thread 7"
|
||||
|
||||
mi_gdb_test "frame" \
|
||||
".*#0 0x.*" \
|
||||
".*#0 .*child_sub_function.*" \
|
||||
"frame 3"
|
||||
|
||||
# Select a different frame in the current thread. Despite the use of
|
||||
@@ -123,7 +123,7 @@ mi_gdb_test "thread" \
|
||||
"info thread 8"
|
||||
|
||||
mi_gdb_test "frame" \
|
||||
".*#1 0x.*" \
|
||||
".*#1 .*child_function.*" \
|
||||
"frame 4"
|
||||
|
||||
# Similar to the previous test, but this time the --frame option is
|
||||
|
||||
@@ -76,6 +76,9 @@ proc test_value_creation {} {
|
||||
|
||||
# Test address attribute is None in a non-addressable value
|
||||
gdb_test "python print ('result = %s' % i.address)" "= None" "test address attribute in non-addressable value"
|
||||
|
||||
# Test creating / printing an optimized out value
|
||||
gdb_test "python print(gdb.Value(gdb.Value(5).type.optimized_out()))"
|
||||
}
|
||||
|
||||
# Check that we can call gdb.Value.__init__ to change a value.
|
||||
|
||||
@@ -145,3 +145,5 @@ gdb_test "print 0x0 as fn(i64) -> ()" " = \\\(\\*mut fn \\\(i64\\\) -> \\\(\\\)\
|
||||
gdb_test "print r#" "No symbol 'r' in current context"
|
||||
|
||||
gdb_test "printf \"%d %d\\n\", 23+1, 23-1" "24 22"
|
||||
|
||||
gdb_test "print 5," "Syntax error near ','"
|
||||
|
||||
@@ -8302,6 +8302,29 @@ gdb_caching_proc have_mpx {
|
||||
|
||||
remote_file build delete $obj
|
||||
|
||||
if { $status == 0 } {
|
||||
verbose "$me: returning $status" 2
|
||||
return $status
|
||||
}
|
||||
|
||||
# Compile program with -mmpx -fcheck-pointer-bounds, try to trigger
|
||||
# 'No MPX support', in other words, see if kernel supports mpx.
|
||||
set src { int main (void) { return 0; } }
|
||||
set comp_flags {}
|
||||
append comp_flags " additional_flags=-mmpx"
|
||||
append comp_flags " additional_flags=-fcheck-pointer-bounds"
|
||||
if {![gdb_simple_compile $me-2 $src executable $comp_flags]} {
|
||||
return 0
|
||||
}
|
||||
|
||||
set result [remote_exec target $obj]
|
||||
set status [lindex $result 0]
|
||||
set output [lindex $result 1]
|
||||
set status [expr ($status == 0) \
|
||||
&& ![string equal $output "No MPX support\r\n"]]
|
||||
|
||||
remote_file build delete $obj
|
||||
|
||||
verbose "$me: returning $status" 2
|
||||
return $status
|
||||
}
|
||||
|
||||
39
gdb/top.c
39
gdb/top.c
@@ -260,6 +260,41 @@ void (*deprecated_context_hook) (int id);
|
||||
/* The highest UI number ever assigned. */
|
||||
static int highest_ui_num;
|
||||
|
||||
/* Unbuffer STREAM. This is a wrapper around setbuf(STREAM, nullptr)
|
||||
which applies some special rules for MS-Windows hosts. */
|
||||
|
||||
static void
|
||||
unbuffer_stream (FILE *stream)
|
||||
{
|
||||
/* Unbuffer the input stream so that in gdb_readline_no_editing_callback,
|
||||
the calls to fgetc fetch only one char at the time from STREAM.
|
||||
|
||||
This is important because gdb_readline_no_editing_callback will read
|
||||
from STREAM up to the first '\n' character, after this GDB returns to
|
||||
the event loop and relies on a select on STREAM indicating that more
|
||||
input is pending.
|
||||
|
||||
If STREAM is buffered then the fgetc calls may have moved all the
|
||||
pending input from the kernel into a local buffer, after which the
|
||||
select will not indicate that more input is pending, and input after
|
||||
the first '\n' will not be processed immediately.
|
||||
|
||||
Please ensure that any changes in this area run the MI tests with the
|
||||
FORCE_SEPARATE_MI_TTY=1 flag being passed. */
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/* With MS-Windows runtime, making stdin unbuffered when it's
|
||||
connected to the terminal causes it to misbehave. */
|
||||
if (!ISATTY (stream))
|
||||
setbuf (stream, nullptr);
|
||||
#else
|
||||
/* On GNU/Linux the issues described above can impact GDB even when
|
||||
dealing with input from a terminal. For now we unbuffer the input
|
||||
stream for everyone except MS-Windows. */
|
||||
setbuf (stream, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* See top.h. */
|
||||
|
||||
ui::ui (FILE *instream_, FILE *outstream_, FILE *errstream_)
|
||||
@@ -286,6 +321,8 @@ ui::ui (FILE *instream_, FILE *outstream_, FILE *errstream_)
|
||||
{
|
||||
buffer_init (&line_buffer);
|
||||
|
||||
unbuffer_stream (instream_);
|
||||
|
||||
if (ui_list == NULL)
|
||||
ui_list = this;
|
||||
else
|
||||
@@ -415,6 +452,8 @@ read_command_file (FILE *stream)
|
||||
{
|
||||
struct ui *ui = current_ui;
|
||||
|
||||
unbuffer_stream (stream);
|
||||
|
||||
scoped_restore save_instream
|
||||
= make_scoped_restore (&ui->instream, stream);
|
||||
|
||||
|
||||
27
gdb/value.c
27
gdb/value.c
@@ -343,8 +343,10 @@ struct value
|
||||
LONGEST embedded_offset = 0;
|
||||
LONGEST pointed_to_offset = 0;
|
||||
|
||||
/* Actual contents of the value. Target byte-order. NULL or not
|
||||
valid if lazy is nonzero. */
|
||||
/* Actual contents of the value. Target byte-order.
|
||||
|
||||
May be nullptr if the value is lazy or is entirely optimized out.
|
||||
Guaranteed to be non-nullptr otherwise. */
|
||||
gdb::unique_xmalloc_ptr<gdb_byte> contents;
|
||||
|
||||
/* Unavailable ranges in CONTENTS. We mark unavailable ranges,
|
||||
@@ -1725,8 +1727,10 @@ value_copy (const value *arg)
|
||||
val->stack = arg->stack;
|
||||
val->is_zero = arg->is_zero;
|
||||
val->initialized = arg->initialized;
|
||||
val->unavailable = arg->unavailable;
|
||||
val->optimized_out = arg->optimized_out;
|
||||
|
||||
if (!value_lazy (val))
|
||||
if (!value_lazy (val) && !value_entirely_optimized_out (val))
|
||||
{
|
||||
gdb_assert (arg->contents != nullptr);
|
||||
ULONGEST length = TYPE_LENGTH (value_enclosing_type (arg));
|
||||
@@ -1735,8 +1739,6 @@ value_copy (const value *arg)
|
||||
copy (arg_view, value_contents_all_raw (val));
|
||||
}
|
||||
|
||||
val->unavailable = arg->unavailable;
|
||||
val->optimized_out = arg->optimized_out;
|
||||
val->parent = arg->parent;
|
||||
if (VALUE_LVAL (val) == lval_computed)
|
||||
{
|
||||
@@ -4271,6 +4273,20 @@ test_insert_into_bit_range_vector ()
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
test_value_copy ()
|
||||
{
|
||||
type *type = builtin_type (current_inferior ()->gdbarch)->builtin_int;
|
||||
|
||||
/* Verify that we can copy an entirely optimized out value, that may not have
|
||||
its contents allocated. */
|
||||
value_ref_ptr val = release_value (allocate_optimized_out_value (type));
|
||||
value_ref_ptr copy = release_value (value_copy (val.get ()));
|
||||
|
||||
SELF_CHECK (value_entirely_optimized_out (val.get ()));
|
||||
SELF_CHECK (value_entirely_optimized_out (copy.get ()));
|
||||
}
|
||||
|
||||
} /* namespace selftests */
|
||||
#endif /* GDB_SELF_TEST */
|
||||
|
||||
@@ -4355,6 +4371,7 @@ and exceeds this limit will cause an error."),
|
||||
selftests::register_test ("ranges_contain", selftests::test_ranges_contain);
|
||||
selftests::register_test ("insert_into_bit_range_vector",
|
||||
selftests::test_insert_into_bit_range_vector);
|
||||
selftests::register_test ("value_copy", selftests::test_value_copy);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
12.0.50.DATE-git
|
||||
12.1
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Copyright (C) 2019-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2019-2022 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GDB.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- Parent-Version: 1.78 -->
|
||||
|
||||
<!--
|
||||
Copyright (C) 2006-2022 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2021 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
|
||||
<!--
|
||||
Copyright (C) 2007-2022 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2021 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
|
||||
@@ -743,6 +743,8 @@ __glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
|
||||
else
|
||||
{
|
||||
#ifndef WINDOWS32
|
||||
/* Recognize ~user as a shorthand for the specified user's home
|
||||
directory. */
|
||||
char *end_name = strchr (dirname, '/');
|
||||
char *user_name;
|
||||
int malloc_user_name = 0;
|
||||
@@ -881,7 +883,22 @@ __glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
|
||||
}
|
||||
scratch_buffer_free (&pwtmpbuf);
|
||||
}
|
||||
#endif /* !WINDOWS32 */
|
||||
#else /* WINDOWS32 */
|
||||
/* On native Windows, access to a user's home directory
|
||||
(via GetUserProfileDirectory) or to a user's environment
|
||||
variables (via ExpandEnvironmentStringsForUser) requires
|
||||
the credentials of the user. Therefore we cannot support
|
||||
the ~user syntax on this platform.
|
||||
Handling ~user specially (and treat it like plain ~) if
|
||||
user is getenv ("USERNAME") would not be a good idea,
|
||||
since it would make people think that ~user is supported
|
||||
in general. */
|
||||
if (flags & GLOB_TILDE_CHECK)
|
||||
{
|
||||
retval = GLOB_NOMATCH;
|
||||
goto out;
|
||||
}
|
||||
#endif /* WINDOWS32 */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -530,12 +530,13 @@ restart:
|
||||
if (h != handle_array[nhandles])
|
||||
{
|
||||
/* Perform handle->descriptor mapping. */
|
||||
WSAEventSelect ((SOCKET) h, NULL, 0);
|
||||
if (FD_ISSET (h, &handle_rfds))
|
||||
SOCKET s = (SOCKET) h;
|
||||
WSAEventSelect (s, NULL, 0);
|
||||
if (FD_ISSET (s, &handle_rfds))
|
||||
FD_SET (i, rfds);
|
||||
if (FD_ISSET (h, &handle_wfds))
|
||||
if (FD_ISSET (s, &handle_wfds))
|
||||
FD_SET (i, wfds);
|
||||
if (FD_ISSET (h, &handle_xfds))
|
||||
if (FD_ISSET (s, &handle_xfds))
|
||||
FD_SET (i, xfds);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -2033,9 +2033,17 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - "
|
||||
# undef swab
|
||||
# define swab _swab
|
||||
# endif
|
||||
_GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n));
|
||||
/* Need to cast, because in old mingw the arguments are
|
||||
(const char *from, char *to, size_t n). */
|
||||
_GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n));
|
||||
# else
|
||||
# if defined __hpux /* HP-UX */
|
||||
_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n));
|
||||
# elif defined __sun && !defined _XPG4 /* Solaris */
|
||||
_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
|
||||
# endif
|
||||
# endif
|
||||
_GL_CXXALIASWARN (swab);
|
||||
#endif
|
||||
|
||||
49
gnulib/patches/0002-glob-tilde-check
Normal file
49
gnulib/patches/0002-glob-tilde-check
Normal file
@@ -0,0 +1,49 @@
|
||||
commit 38d0749a3077b03fda46567510b1217fb5e4e170
|
||||
Author: Bruno Haible <bruno@clisp.org>
|
||||
Date: Fri Apr 2 17:34:46 2021 +0200
|
||||
|
||||
glob: Reject ~user syntax, when flag GLOB_TILDE_CHECK is given.
|
||||
|
||||
Reported and patch suggested by Eli Zaretskii <eliz@gnu.org> in
|
||||
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00136.html>.
|
||||
|
||||
* lib/glob.c (__glob) [WINDOWS32]: If flag GLOB_TILDE_CHECK is given, do
|
||||
error handling like when ~user is allowed by the user is unknown.
|
||||
|
||||
diff --git a/gnulib/import/glob.c b/gnulib/import/glob.c
|
||||
index 775911ef5b..e148f8d761 100644
|
||||
--- a/gnulib/import/glob.c
|
||||
+++ b/gnulib/import/glob.c
|
||||
@@ -743,6 +743,8 @@ __glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
|
||||
else
|
||||
{
|
||||
#ifndef WINDOWS32
|
||||
+ /* Recognize ~user as a shorthand for the specified user's home
|
||||
+ directory. */
|
||||
char *end_name = strchr (dirname, '/');
|
||||
char *user_name;
|
||||
int malloc_user_name = 0;
|
||||
@@ -881,7 +883,22 @@ __glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
|
||||
}
|
||||
scratch_buffer_free (&pwtmpbuf);
|
||||
}
|
||||
-#endif /* !WINDOWS32 */
|
||||
+#else /* WINDOWS32 */
|
||||
+ /* On native Windows, access to a user's home directory
|
||||
+ (via GetUserProfileDirectory) or to a user's environment
|
||||
+ variables (via ExpandEnvironmentStringsForUser) requires
|
||||
+ the credentials of the user. Therefore we cannot support
|
||||
+ the ~user syntax on this platform.
|
||||
+ Handling ~user specially (and treat it like plain ~) if
|
||||
+ user is getenv ("USERNAME") would not be a good idea,
|
||||
+ since it would make people think that ~user is supported
|
||||
+ in general. */
|
||||
+ if (flags & GLOB_TILDE_CHECK)
|
||||
+ {
|
||||
+ retval = GLOB_NOMATCH;
|
||||
+ goto out;
|
||||
+ }
|
||||
+#endif /* WINDOWS32 */
|
||||
}
|
||||
}
|
||||
|
||||
36
gnulib/patches/0003-unistd-h-fix
Normal file
36
gnulib/patches/0003-unistd-h-fix
Normal file
@@ -0,0 +1,36 @@
|
||||
commit c7b1e060d17023065c776757da406d728310cc38
|
||||
Author: Bruno Haible <bruno@clisp.org>
|
||||
Date: Sun Jun 20 17:18:26 2021 +0200
|
||||
|
||||
unistd: Avoid compilation error in C++ mode on Solaris, HP-UX, mingw.
|
||||
|
||||
Reported by Eli Zaretskii <eliz@gnu.org> in
|
||||
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00135.html>.
|
||||
|
||||
* lib/unistd.in.h (swab): Consider different declarations on Solaris,
|
||||
HP-UX, and old mingw.
|
||||
|
||||
diff --git a/gnulib/import/unistd.in.h b/gnulib/import/unistd.in.h
|
||||
index d4d4ba7743..73c882f97b 100644
|
||||
--- a/gnulib/import/unistd.in.h
|
||||
+++ b/gnulib/import/unistd.in.h
|
||||
@@ -2034,9 +2034,17 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - "
|
||||
# undef swab
|
||||
# define swab _swab
|
||||
# endif
|
||||
-_GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n));
|
||||
-# else
|
||||
+/* Need to cast, because in old mingw the arguments are
|
||||
+ (const char *from, char *to, size_t n). */
|
||||
+_GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n));
|
||||
+# else
|
||||
+# if defined __hpux /* HP-UX */
|
||||
+_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n));
|
||||
+# elif defined __sun && !defined _XPG4 /* Solaris */
|
||||
+_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n));
|
||||
+# else
|
||||
_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
|
||||
+# endif
|
||||
# endif
|
||||
_GL_CXXALIASWARN (swab);
|
||||
#endif
|
||||
33
gnulib/patches/0004-select-mingw
Normal file
33
gnulib/patches/0004-select-mingw
Normal file
@@ -0,0 +1,33 @@
|
||||
commit 21fccfa0451ba59fba479e439465da9c360353d3
|
||||
Author: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Thu Jul 8 10:00:30 2021 -0700
|
||||
|
||||
select: port better to MinGW
|
||||
|
||||
Problem reported by Eli Zaretskii in:
|
||||
https://lists.gnu.org/r/bug-gnulib/2021-07/msg00017.html
|
||||
* lib/select.c (rpl_select) [_WIN32 && !__CYGWIN__]:
|
||||
Pass a SOCKET, not a HANDLE, to FD_ISSET.
|
||||
|
||||
diff --git a/gnulib/import/select.c b/gnulib/import/select.c
|
||||
index 2fe6a18064..eddac4b61f 100644
|
||||
--- a/gnulib/import/select.c
|
||||
+++ b/gnulib/import/select.c
|
||||
@@ -530,12 +530,13 @@ restart:
|
||||
if (h != handle_array[nhandles])
|
||||
{
|
||||
/* Perform handle->descriptor mapping. */
|
||||
- WSAEventSelect ((SOCKET) h, NULL, 0);
|
||||
- if (FD_ISSET (h, &handle_rfds))
|
||||
+ SOCKET s = (SOCKET) h;
|
||||
+ WSAEventSelect (s, NULL, 0);
|
||||
+ if (FD_ISSET (s, &handle_rfds))
|
||||
FD_SET (i, rfds);
|
||||
- if (FD_ISSET (h, &handle_wfds))
|
||||
+ if (FD_ISSET (s, &handle_wfds))
|
||||
FD_SET (i, wfds);
|
||||
- if (FD_ISSET (h, &handle_xfds))
|
||||
+ if (FD_ISSET (s, &handle_xfds))
|
||||
FD_SET (i, xfds);
|
||||
}
|
||||
else
|
||||
@@ -180,6 +180,7 @@ fi
|
||||
# Apply our local patches.
|
||||
apply_patches ()
|
||||
{
|
||||
echo "Applying $1..."
|
||||
patch -p2 -f -i "$1"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to apply some patches. Aborting."
|
||||
@@ -188,6 +189,9 @@ apply_patches ()
|
||||
}
|
||||
|
||||
apply_patches "patches/0001-use-windows-stat"
|
||||
apply_patches "patches/0002-glob-tilde-check"
|
||||
apply_patches "patches/0003-unistd-h-fix"
|
||||
apply_patches "patches/0004-select-mingw"
|
||||
|
||||
# Regenerate all necessary files...
|
||||
aclocal &&
|
||||
|
||||
Reference in New Issue
Block a user