mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
Compare commits
150 Commits
users/nalc
...
gdb-16.3-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
140ba011c0 | ||
|
|
788edd470b | ||
|
|
ec46e2ce7a | ||
|
|
a74df132e3 | ||
|
|
6c82a55780 | ||
|
|
055279c914 | ||
|
|
f92a904726 | ||
|
|
3c2c00c32a | ||
|
|
5eed5758ae | ||
|
|
ebf7dd0ed8 | ||
|
|
1936dc6a64 | ||
|
|
6ce88ba61e | ||
|
|
1549d0525b | ||
|
|
565ad7474c | ||
|
|
a7abbebc6d | ||
|
|
4ffff8e30b | ||
|
|
0a363b10a1 | ||
|
|
3348e9233b | ||
|
|
b61f17e695 | ||
|
|
d195670d47 | ||
|
|
da5c8de5b0 | ||
|
|
5c89e5539a | ||
|
|
a2c8f78df5 | ||
|
|
bc997150d8 | ||
|
|
27d7403d46 | ||
|
|
f3ecdb73cd | ||
|
|
9c3d1bb4c8 | ||
|
|
24c91baf98 | ||
|
|
c295d55246 | ||
|
|
66150ea536 | ||
|
|
0c09aa22ee | ||
|
|
b9a7fda110 | ||
|
|
21c21807a3 | ||
|
|
67e9e439f7 | ||
|
|
dcf6d684ce | ||
|
|
639b6f1055 | ||
|
|
a1bcf87a5f | ||
|
|
883f7d18d1 | ||
|
|
b4b7d9f112 | ||
|
|
f45379953a | ||
|
|
d6e18cff1d | ||
|
|
3ee680f9eb | ||
|
|
5bc76dc8d4 | ||
|
|
0230950c6e | ||
|
|
7a6ff0051f | ||
|
|
55b7a56b1f | ||
|
|
465465ce9c | ||
|
|
b4d832ef2b | ||
|
|
5f2f9d4dcc | ||
|
|
4996027dbf | ||
|
|
fbc36742f7 | ||
|
|
ebb9d77f35 | ||
|
|
94f97a3cdd | ||
|
|
96f3f01d9d | ||
|
|
8bdaecde02 | ||
|
|
fa315f8c30 | ||
|
|
a5bfad18c4 | ||
|
|
de2c17ad1d | ||
|
|
fdf8666844 | ||
|
|
7aef96f044 | ||
|
|
26f7f82058 | ||
|
|
56e453742e | ||
|
|
0674100e37 | ||
|
|
636e85837a | ||
|
|
09774db4f0 | ||
|
|
7ea5b42758 | ||
|
|
db69753580 | ||
|
|
15672434ec | ||
|
|
de09906181 | ||
|
|
397f62b9d9 | ||
|
|
e4ec026513 | ||
|
|
bd6f05164f | ||
|
|
6d52d7b146 | ||
|
|
398b42317e | ||
|
|
5429f87550 | ||
|
|
944e553674 | ||
|
|
d6762792f7 | ||
|
|
5baddddfbe | ||
|
|
9ef9fb511f | ||
|
|
6e3384d4cc | ||
|
|
5a14f9e79a | ||
|
|
2b646bb876 | ||
|
|
655703fa8d | ||
|
|
2fc5610642 | ||
|
|
8d4e87af56 | ||
|
|
74023881d2 | ||
|
|
3dd94eccf6 | ||
|
|
e649750353 | ||
|
|
1c3834732b | ||
|
|
82874bd707 | ||
|
|
39330efedd | ||
|
|
50b1dcab86 | ||
|
|
9f5c7b01ea | ||
|
|
06f68b9c9a | ||
|
|
a31b440834 | ||
|
|
da48c9e23a | ||
|
|
0ac766802a | ||
|
|
4144c2f88d | ||
|
|
12630d881e | ||
|
|
7c5dbff66e | ||
|
|
650a77a80d | ||
|
|
16281822d2 | ||
|
|
5bde526b7f | ||
|
|
129bc9e4ac | ||
|
|
a9c3f13e66 | ||
|
|
2461ea21c7 | ||
|
|
4434d7d4cc | ||
|
|
17bfbe6394 | ||
|
|
4912fb7412 | ||
|
|
d4db9fab08 | ||
|
|
0631c99c21 | ||
|
|
f2a0e51cda | ||
|
|
a24a5681c5 | ||
|
|
c7fc539d10 | ||
|
|
d9f3ef784e | ||
|
|
e1474599f2 | ||
|
|
1f3c894d72 | ||
|
|
52b81397b1 | ||
|
|
5746383e8c | ||
|
|
e371d9089a | ||
|
|
3babd75807 | ||
|
|
183e227b00 | ||
|
|
0866754873 | ||
|
|
36d2bf9ba1 | ||
|
|
97b4f10487 | ||
|
|
230ab6b333 | ||
|
|
6cd2d77114 | ||
|
|
03a4ae4018 | ||
|
|
c310e35131 | ||
|
|
6b0351f121 | ||
|
|
4f38faacd9 | ||
|
|
093a1b6b81 | ||
|
|
2efabd1d9b | ||
|
|
dcde183ad1 | ||
|
|
aebbe069df | ||
|
|
947a9c38e7 | ||
|
|
9bc042a41b | ||
|
|
bbd194adc6 | ||
|
|
67a0e92293 | ||
|
|
85c6b4e827 | ||
|
|
97078538d6 | ||
|
|
c1001d08ee | ||
|
|
c2a5fae738 | ||
|
|
7b4436effe | ||
|
|
0d51df64c4 | ||
|
|
f1687b6964 | ||
|
|
557ee7861a | ||
|
|
00d493c805 | ||
|
|
b2d36b9a2b | ||
|
|
f83f33630c |
@@ -1318,7 +1318,7 @@ REGEN_TEXI = \
|
||||
$(MKDOC) -f $(srcdir)/doc/doc.str < $< > $@.tmp; \
|
||||
texi=$@; \
|
||||
texi=$${texi%.stamp}.texi; \
|
||||
test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi $$texi; \
|
||||
test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(abs_srcdir)/$$texi $$texi; \
|
||||
$(SHELL) $(srcdir)/../move-if-change $@.tmp $$texi; \
|
||||
touch $@; \
|
||||
)
|
||||
|
||||
60
bfd/bfd.c
60
bfd/bfd.c
@@ -1090,8 +1090,14 @@ _bfd_doprnt (bfd_print_callback print, void *stream, const char *format,
|
||||
ptr += 2;
|
||||
}
|
||||
|
||||
/* There is a clash between Microsoft's non-standard I64
|
||||
and I32 integer length modifiers and glibc's
|
||||
non-standard I flag. */
|
||||
const char *printf_flag_chars
|
||||
= sizeof PRId64 == sizeof "I64d" ? "-+ #0'" : "-+ #0'I";
|
||||
|
||||
/* Move past flags. */
|
||||
while (strchr ("-+ #0'I", *ptr))
|
||||
while (strchr (printf_flag_chars, *ptr))
|
||||
*sptr++ = *ptr++;
|
||||
|
||||
if (*ptr == '*')
|
||||
@@ -1141,6 +1147,22 @@ _bfd_doprnt (bfd_print_callback print, void *stream, const char *format,
|
||||
while (ISDIGIT (*ptr))
|
||||
*sptr++ = *ptr++;
|
||||
}
|
||||
if (sizeof PRId64 == sizeof "I64d" && *ptr =='I')
|
||||
{
|
||||
if (ptr[1] == '6' && ptr[2] == '4')
|
||||
{
|
||||
wide_width = 3;
|
||||
*sptr++ = *ptr++;
|
||||
*sptr++ = *ptr++;
|
||||
*sptr++ = *ptr++;
|
||||
}
|
||||
else if (ptr[1] == '3' && ptr[2] == '2')
|
||||
{
|
||||
*sptr++ = *ptr++;
|
||||
*sptr++ = *ptr++;
|
||||
*sptr++ = *ptr++;
|
||||
}
|
||||
}
|
||||
while (strchr ("hlL", *ptr))
|
||||
{
|
||||
switch (*ptr)
|
||||
@@ -1192,14 +1214,17 @@ _bfd_doprnt (bfd_print_callback print, void *stream, const char *format,
|
||||
PRINT_TYPE (long, l);
|
||||
break;
|
||||
case 2:
|
||||
if (sizeof PRId64 == sizeof "I64d")
|
||||
{
|
||||
/* Convert any %ll to %I64. */
|
||||
sptr[-3] = 'I';
|
||||
sptr[-2] = '6';
|
||||
sptr[-1] = '4';
|
||||
*sptr++ = ptr[-1];
|
||||
*sptr = '\0';
|
||||
}
|
||||
/* Fall through. */
|
||||
default:
|
||||
#if defined (__MSVCRT__)
|
||||
sptr[-3] = 'I';
|
||||
sptr[-2] = '6';
|
||||
sptr[-1] = '4';
|
||||
*sptr++ = ptr[-1];
|
||||
*sptr = '\0';
|
||||
#endif
|
||||
PRINT_TYPE (long long, ll);
|
||||
break;
|
||||
}
|
||||
@@ -1322,8 +1347,14 @@ _bfd_doprnt_scan (const char *format, va_list ap, union _bfd_doprnt_args *args)
|
||||
ptr += 2;
|
||||
}
|
||||
|
||||
/* There is a clash between Microsoft's non-standard I64
|
||||
and I32 integer length modifiers and glibc's
|
||||
non-standard I flag. */
|
||||
const char *printf_flag_chars
|
||||
= sizeof PRId64 == sizeof "I64d" ? "-+ #0'" : "-+ #0'I";
|
||||
|
||||
/* Move past flags. */
|
||||
while (strchr ("-+ #0'I", *ptr))
|
||||
while (strchr (printf_flag_chars, *ptr))
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '*')
|
||||
@@ -1372,6 +1403,17 @@ _bfd_doprnt_scan (const char *format, va_list ap, union _bfd_doprnt_args *args)
|
||||
while (ISDIGIT (*ptr))
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if (sizeof PRId64 == sizeof "I64d" && *ptr =='I')
|
||||
{
|
||||
if (ptr[1] == '6' && ptr[2] == '4')
|
||||
{
|
||||
wide_width = 3;
|
||||
ptr += 3;
|
||||
}
|
||||
else if (ptr[1] == '3' && ptr[2] == '2')
|
||||
ptr += 3;
|
||||
}
|
||||
while (strchr ("hlL", *ptr))
|
||||
{
|
||||
switch (*ptr)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -101,7 +101,7 @@ REGEN_TEXI = \
|
||||
$(MKDOC) -f $(srcdir)/%D%/doc.str < $< > $@.tmp; \
|
||||
texi=$@; \
|
||||
texi=$${texi%.stamp}.texi; \
|
||||
test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi $$texi; \
|
||||
test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(abs_srcdir)/$$texi $$texi; \
|
||||
$(SHELL) $(srcdir)/../move-if-change $@.tmp $$texi; \
|
||||
touch $@; \
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
In releases, the date is not included in either version strings or
|
||||
sonames. */
|
||||
#define BFD_VERSION_DATE 20241229
|
||||
#define BFD_VERSION_DATE 20250420
|
||||
#define BFD_VERSION @bfd_version@
|
||||
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
|
||||
#define REPORT_BUGS_TO @report_bugs_to@
|
||||
|
||||
8
gdb/NEWS
8
gdb/NEWS
@@ -1,7 +1,7 @@
|
||||
What has changed in GDB?
|
||||
(Organized release by release)
|
||||
|
||||
*** Changes since GDB 15
|
||||
*** Changes in GDB 16
|
||||
|
||||
* Support for Nios II targets has been removed as this architecture
|
||||
has been EOL'ed by Intel.
|
||||
@@ -204,6 +204,12 @@ x addr,length
|
||||
equivalent to 'm', except that the data in the response are in
|
||||
binary format.
|
||||
|
||||
binary-upload in qSupported reply
|
||||
If the stub sends back 'binary-upload+' in it's qSupported reply,
|
||||
then GDB will, where possible, make use of the 'x' packet. If the
|
||||
stub doesn't report this feature supported, then GDB will not use
|
||||
the 'x' packet.
|
||||
|
||||
*** Changes in GDB 15
|
||||
|
||||
* The MPX commands "show/set mpx bound" have been deprecated, as Intel
|
||||
|
||||
@@ -5200,9 +5200,9 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r)
|
||||
CORE_ADDR address;
|
||||
uint64_t addr_offset = 0;
|
||||
uint32_t record_buf[24];
|
||||
uint64_t record_buf_mem[24];
|
||||
std::vector<uint64_t> record_buf_mem;
|
||||
uint32_t reg_rn, reg_rt;
|
||||
uint32_t reg_index = 0, mem_index = 0;
|
||||
uint32_t reg_index = 0;
|
||||
uint8_t opcode_bits, size_bits;
|
||||
|
||||
reg_rt = bits (aarch64_insn_r->aarch64_insn, 0, 4);
|
||||
@@ -5265,8 +5265,8 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r)
|
||||
record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
{
|
||||
record_buf_mem[mem_index++] = esize / 8;
|
||||
record_buf_mem[mem_index++] = address + addr_offset;
|
||||
record_buf_mem.push_back (esize / 8);
|
||||
record_buf_mem.push_back (address + addr_offset);
|
||||
}
|
||||
addr_offset = addr_offset + (esize / 8);
|
||||
reg_rt = (reg_rt + 1) % 32;
|
||||
@@ -5337,8 +5337,8 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r)
|
||||
record_buf[reg_index++] = reg_tt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
{
|
||||
record_buf_mem[mem_index++] = esize / 8;
|
||||
record_buf_mem[mem_index++] = address + addr_offset;
|
||||
record_buf_mem.push_back (esize / 8);
|
||||
record_buf_mem.push_back (address + addr_offset);
|
||||
}
|
||||
addr_offset = addr_offset + (esize / 8);
|
||||
reg_tt = (reg_tt + 1) % 32;
|
||||
@@ -5350,9 +5350,9 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r)
|
||||
record_buf[reg_index++] = reg_rn;
|
||||
|
||||
aarch64_insn_r->reg_rec_count = reg_index;
|
||||
aarch64_insn_r->mem_rec_count = mem_index / 2;
|
||||
aarch64_insn_r->mem_rec_count = record_buf_mem.size () / 2;
|
||||
MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count,
|
||||
record_buf_mem);
|
||||
record_buf_mem.data ());
|
||||
REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count,
|
||||
record_buf);
|
||||
return AARCH64_RECORD_SUCCESS;
|
||||
|
||||
@@ -790,10 +790,10 @@ append_val_type_str (std::string &help, const option_def &opt,
|
||||
}
|
||||
break;
|
||||
case var_string:
|
||||
help += "STRING";
|
||||
help += " STRING";
|
||||
break;
|
||||
case var_filename:
|
||||
help += "FILENAME";
|
||||
help += " FILENAME";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1169,35 +1169,30 @@ core_target_open (const char *arg, int from_tty)
|
||||
|
||||
if (ctx.valid ())
|
||||
{
|
||||
std::string args;
|
||||
for (const auto &a : ctx.args ())
|
||||
{
|
||||
args += ' ';
|
||||
args += a.get ();
|
||||
}
|
||||
|
||||
gdb_printf (_("Core was generated by `%ps%s'.\n"),
|
||||
styled_string (file_name_style.style (),
|
||||
ctx.execfn ()),
|
||||
args.c_str ());
|
||||
|
||||
/* Copy the arguments into the inferior. */
|
||||
std::vector<char *> argv;
|
||||
for (const auto &a : ctx.args ())
|
||||
for (const gdb::unique_xmalloc_ptr<char> &a : ctx.args ())
|
||||
argv.push_back (a.get ());
|
||||
gdb::array_view<char * const> view (argv.data (), argv.size ());
|
||||
current_inferior ()->set_args (view);
|
||||
|
||||
/* And now copy the environment. */
|
||||
current_inferior ()->environment = ctx.environment ();
|
||||
|
||||
/* Inform the user of executable and arguments. */
|
||||
const std::string &args = current_inferior ()->args ();
|
||||
gdb_printf (_("Core was generated by `%ps%s%s'.\n"),
|
||||
styled_string (file_name_style.style (),
|
||||
ctx.execfn ()),
|
||||
(args.length () > 0 ? " " : ""), args.c_str ());
|
||||
}
|
||||
else
|
||||
{
|
||||
gdb::unique_xmalloc_ptr<char> failing_command = make_unique_xstrdup
|
||||
(bfd_core_file_failing_command (current_program_space->core_bfd ()));
|
||||
const char *failing_command
|
||||
= bfd_core_file_failing_command (current_program_space->core_bfd ());
|
||||
if (failing_command != nullptr)
|
||||
gdb_printf (_("Core was generated by `%s'.\n"),
|
||||
failing_command.get ());
|
||||
failing_command);
|
||||
}
|
||||
|
||||
/* Clearing any previous state of convenience variables. */
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "symtab.h"
|
||||
#include "objfiles.h"
|
||||
#include "cli/cli-cmds.h"
|
||||
#include "cli/cli-style.h"
|
||||
#include "gdbcore.h"
|
||||
#include "gdbthread.h"
|
||||
#include "regcache.h"
|
||||
|
||||
@@ -43467,6 +43467,10 @@ and @var{length} is a multiple of the word size, the stub is free to
|
||||
use byte accesses, or not. For this reason, this packet may not be
|
||||
suitable for accessing memory-mapped I/O devices.
|
||||
|
||||
@value{GDBN} will only use this packet if the stub reports the
|
||||
@samp{binary-upload} feature is supported in its @samp{qSupported}
|
||||
reply (@pxref{qSupported}).
|
||||
|
||||
Reply:
|
||||
@table @samp
|
||||
@item b @var{XX@dots{}}
|
||||
@@ -45114,6 +45118,11 @@ These are the currently defined stub features and their properties:
|
||||
@tab @samp{+}
|
||||
@tab No
|
||||
|
||||
@item @samp{binary-upload}
|
||||
@tab No
|
||||
@tab @samp{-}
|
||||
@tab No
|
||||
|
||||
@end multitable
|
||||
|
||||
These are the currently defined stub features, in more detail:
|
||||
@@ -45360,6 +45369,9 @@ The remote stub supports replying with an error in a
|
||||
send this feature back to @value{GDBN} in the @samp{qSupported} reply,
|
||||
@value{GDBN} will always support @samp{E.@var{errtext}} format replies
|
||||
if it sent the @samp{error-message} feature.
|
||||
|
||||
@item binary-upload
|
||||
The remote stub supports the @samp{x} packet (@pxref{x packet}).
|
||||
@end table
|
||||
|
||||
@item qSymbol::
|
||||
|
||||
@@ -388,12 +388,12 @@ dwarf2_find_location_expression (const dwarf2_loclist_baton *baton,
|
||||
enum debug_loc_kind kind;
|
||||
const gdb_byte *new_ptr = NULL; /* init for gcc -Wall */
|
||||
|
||||
if (baton->per_cu->version () < 5 && baton->from_dwo)
|
||||
if (baton->dwarf_version < 5 && baton->from_dwo)
|
||||
kind = decode_debug_loc_dwo_addresses (baton->per_cu,
|
||||
baton->per_objfile,
|
||||
loc_ptr, buf_end, &new_ptr,
|
||||
&low, &high, byte_order);
|
||||
else if (baton->per_cu->version () < 5)
|
||||
else if (baton->dwarf_version < 5)
|
||||
kind = decode_debug_loc_addresses (loc_ptr, buf_end, &new_ptr,
|
||||
&low, &high,
|
||||
byte_order, addr_size,
|
||||
@@ -444,7 +444,7 @@ dwarf2_find_location_expression (const dwarf2_loclist_baton *baton,
|
||||
high = (unrelocated_addr) ((CORE_ADDR) high + (CORE_ADDR) base_address);
|
||||
}
|
||||
|
||||
if (baton->per_cu->version () < 5)
|
||||
if (baton->dwarf_version < 5)
|
||||
{
|
||||
length = extract_unsigned_integer (loc_ptr, 2, byte_order);
|
||||
loc_ptr += 2;
|
||||
@@ -3977,12 +3977,12 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
|
||||
enum debug_loc_kind kind;
|
||||
const gdb_byte *new_ptr = NULL; /* init for gcc -Wall */
|
||||
|
||||
if (dlbaton->per_cu->version () < 5 && dlbaton->from_dwo)
|
||||
if (dlbaton->dwarf_version < 5 && dlbaton->from_dwo)
|
||||
kind = decode_debug_loc_dwo_addresses (dlbaton->per_cu,
|
||||
per_objfile,
|
||||
loc_ptr, buf_end, &new_ptr,
|
||||
&low, &high, byte_order);
|
||||
else if (dlbaton->per_cu->version () < 5)
|
||||
else if (dlbaton->dwarf_version < 5)
|
||||
kind = decode_debug_loc_addresses (loc_ptr, buf_end, &new_ptr,
|
||||
&low, &high,
|
||||
byte_order, addr_size,
|
||||
@@ -4032,7 +4032,7 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
|
||||
CORE_ADDR low_reloc = per_objfile->relocate (low);
|
||||
CORE_ADDR high_reloc = per_objfile->relocate (high);
|
||||
|
||||
if (dlbaton->per_cu->version () < 5)
|
||||
if (dlbaton->dwarf_version < 5)
|
||||
{
|
||||
length = extract_unsigned_integer (loc_ptr, 2, byte_order);
|
||||
loc_ptr += 2;
|
||||
|
||||
@@ -197,6 +197,9 @@ struct dwarf2_loclist_baton
|
||||
/* Non-zero if the location list lives in .debug_loc.dwo.
|
||||
The format of entries in this section are different. */
|
||||
unsigned char from_dwo;
|
||||
|
||||
/* The version of DWARF this loclist comes from. */
|
||||
unsigned char dwarf_version;
|
||||
};
|
||||
|
||||
/* The baton used when a dynamic property is an offset to a parent
|
||||
|
||||
@@ -4103,8 +4103,6 @@ cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
|
||||
/* Establish the type offset that can be used to lookup the type. */
|
||||
sig_type->type_offset_in_section =
|
||||
this_cu->sect_off + to_underlying (sig_type->type_offset_in_tu);
|
||||
|
||||
this_cu->set_version (cu->header.version);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4115,7 +4113,6 @@ cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
|
||||
|
||||
gdb_assert (this_cu->sect_off == cu->header.sect_off);
|
||||
this_cu->set_length (cu->header.get_length_with_initial ());
|
||||
this_cu->set_version (cu->header.version);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5129,10 +5126,6 @@ read_comp_units_from_section (dwarf2_per_objfile *per_objfile,
|
||||
this_cu->set_length (cu_header.get_length_with_initial ());
|
||||
this_cu->is_dwz = is_dwz;
|
||||
this_cu->section = section;
|
||||
/* Init this asap, to avoid a data race in the set_version in
|
||||
cutu_reader::cutu_reader (which may be run in parallel for the cooked
|
||||
index case). */
|
||||
this_cu->set_version (cu_header.version);
|
||||
|
||||
info_ptr = info_ptr + this_cu->length ();
|
||||
per_objfile->per_bfd->all_units.push_back (std::move (this_cu));
|
||||
@@ -9237,7 +9230,7 @@ open_and_init_dwo_file (dwarf2_cu *cu, const char *dwo_name,
|
||||
create_cus_hash_table (per_objfile, cu, *dwo_file, dwo_file->sections.info,
|
||||
dwo_file->cus);
|
||||
|
||||
if (cu->per_cu->version () < 5)
|
||||
if (cu->header.version < 5)
|
||||
{
|
||||
create_debug_types_hash_table (per_objfile, dwo_file.get (),
|
||||
dwo_file->sections.types, dwo_file->tus);
|
||||
@@ -14800,8 +14793,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
if (type->code () == TYPE_CODE_VOID
|
||||
&& !type->is_stub ()
|
||||
&& die->child == nullptr
|
||||
&& (cu->per_cu->version () == 2
|
||||
|| producer_is_gas_2_39 (cu)))
|
||||
&& (cu->header.version == 2 || producer_is_gas_2_39 (cu)))
|
||||
{
|
||||
/* Work around PR gas/29517, pretend we have an DW_TAG_unspecified_type
|
||||
return type. */
|
||||
@@ -16809,6 +16801,12 @@ cooked_indexer::index_dies (cutu_reader *reader,
|
||||
break;
|
||||
|
||||
case DW_TAG_enumeration_type:
|
||||
/* Some versions of gdc could emit an "enum class"
|
||||
without a name, which is nonsensical. These are
|
||||
skipped. */
|
||||
if (is_enum_class && this_entry == nullptr)
|
||||
continue;
|
||||
|
||||
/* We need to recurse even for an anonymous enumeration.
|
||||
Which scope we record as the parent scope depends on
|
||||
whether we're reading an "enum class". If so, we use
|
||||
@@ -21687,6 +21685,7 @@ fill_in_loclist_baton (struct dwarf2_cu *cu,
|
||||
else
|
||||
baton->base_address = {};
|
||||
baton->from_dwo = cu->dwo_unit != NULL;
|
||||
baton->dwarf_version = cu->header.version;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -120,9 +120,6 @@ struct dwarf2_per_cu_data
|
||||
private:
|
||||
unsigned int m_length = 0;
|
||||
|
||||
/* DWARF standard version this data has been read from (such as 4 or 5). */
|
||||
unsigned char m_dwarf_version = 0;
|
||||
|
||||
public:
|
||||
/* Non-zero if this CU is from .debug_types.
|
||||
Struct dwarf2_per_cu_data is contained in struct signatured_type iff
|
||||
@@ -281,24 +278,6 @@ public:
|
||||
gdb_assert (m_length == length);
|
||||
}
|
||||
|
||||
/* Return DWARF version number of this CU. */
|
||||
short version () const
|
||||
{
|
||||
/* Make sure it's set already. */
|
||||
gdb_assert (m_dwarf_version != 0);
|
||||
return m_dwarf_version;
|
||||
}
|
||||
|
||||
void set_version (short version)
|
||||
{
|
||||
if (m_dwarf_version == 0)
|
||||
/* Set if not set already. */
|
||||
m_dwarf_version = version;
|
||||
else
|
||||
/* If already set, verify that it's the same value. */
|
||||
gdb_assert (m_dwarf_version == version);
|
||||
}
|
||||
|
||||
dwarf_unit_type unit_type (bool strict_p = true) const
|
||||
{
|
||||
dwarf_unit_type ut = m_unit_type.load ();
|
||||
|
||||
@@ -1276,7 +1276,7 @@ fd_copy (fd_set *dst, const fd_set *src, int n)
|
||||
{
|
||||
FD_ZERO (dst);
|
||||
for (int i = 0; i < n; ++i)
|
||||
if (FD_ISSET (i, src))
|
||||
if (FD_ISSET (i, const_cast<fd_set *>(src)))
|
||||
FD_SET (i, dst);
|
||||
|
||||
return dst;
|
||||
|
||||
17
gdb/frame.c
17
gdb/frame.c
@@ -2325,7 +2325,22 @@ get_prev_frame_always_1 (const frame_info_ptr &this_frame)
|
||||
until we have unwound all the way down to the previous non-inline
|
||||
frame. */
|
||||
if (get_frame_type (this_frame) == INLINE_FRAME)
|
||||
return get_prev_frame_maybe_check_cycle (this_frame);
|
||||
{
|
||||
frame_info_ptr fi = get_prev_frame_maybe_check_cycle (this_frame);
|
||||
|
||||
/* If this_frame is the current frame, then compute and stash its frame
|
||||
id so that the cycle check in get_prev_frame_maybe_check_cycle works
|
||||
correctly in the case where inline frame 0 has been duplicated.
|
||||
|
||||
The this_id.p check is required to avoid recursion as computing the
|
||||
frame id results in a call to inline_frame_this_id which calls back
|
||||
into get_prev_frame_always. */
|
||||
if (this_frame->level == 0
|
||||
&& this_frame->this_id.p != frame_id_status::COMPUTING)
|
||||
get_frame_id (this_frame);
|
||||
|
||||
return fi;
|
||||
}
|
||||
|
||||
/* If this_frame is the current frame, then compute and stash its
|
||||
frame id prior to fetching and computing the frame id of the
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2024-2025 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
|
||||
@@ -22,8 +22,8 @@
|
||||
GDB=${GDB:-$(command -v gdb)}
|
||||
GDBARGS=${GDBARGS:-}
|
||||
AWK=${AWK:-}
|
||||
PKGVERSION=@PKGVERSION@
|
||||
VERSION=@VERSION@
|
||||
PKGVERSION="@PKGVERSION@"
|
||||
VERSION="@VERSION@"
|
||||
|
||||
# Find an appropriate awk interpreter if one was not specified
|
||||
# via the environment.
|
||||
@@ -132,7 +132,7 @@ EOF
|
||||
)
|
||||
|
||||
# Run GDB and remove some unwanted noise.
|
||||
"$GDB" --quiet -nx --readnever $GDBARGS <<EOF |
|
||||
"$GDB" --quiet -nx $GDBARGS <<EOF |
|
||||
set width 0
|
||||
set height 0
|
||||
set pagination no
|
||||
|
||||
@@ -370,6 +370,16 @@ i386_all_but_ip_registers_record (struct regcache *regcache)
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum i386_syscall
|
||||
{
|
||||
#define SYSCALL(NUMBER,NAME) \
|
||||
i386_sys_ ## NAME = NUMBER,
|
||||
|
||||
#include "gdb/i386-syscalls.def"
|
||||
|
||||
#undef SYSCALL
|
||||
};
|
||||
|
||||
/* i386_canonicalize_syscall maps from the native i386 Linux set
|
||||
of syscall ids into a canonical set of syscall ids used by
|
||||
process record (a mostly trivial mapping, since the canonical
|
||||
@@ -378,12 +388,486 @@ i386_all_but_ip_registers_record (struct regcache *regcache)
|
||||
static enum gdb_syscall
|
||||
i386_canonicalize_syscall (int syscall)
|
||||
{
|
||||
enum { i386_syscall_max = 499 };
|
||||
switch ((enum i386_syscall) syscall)
|
||||
{
|
||||
#define SYSCALL_MAP(SYSCALL) \
|
||||
case i386_sys_ ## SYSCALL: \
|
||||
return gdb_sys_ ## SYSCALL
|
||||
|
||||
if (syscall <= i386_syscall_max)
|
||||
return (enum gdb_syscall) syscall;
|
||||
else
|
||||
return gdb_sys_no_syscall;
|
||||
#define SYSCALL_MAP_RENAME(SYSCALL,GDB_SYSCALL) \
|
||||
case i386_sys_##SYSCALL: \
|
||||
return GDB_SYSCALL;
|
||||
|
||||
#define UNSUPPORTED_SYSCALL_MAP(SYSCALL) \
|
||||
case i386_sys_ ## SYSCALL: \
|
||||
return gdb_sys_no_syscall;
|
||||
|
||||
SYSCALL_MAP (restart_syscall);
|
||||
SYSCALL_MAP (exit);
|
||||
SYSCALL_MAP (fork);
|
||||
SYSCALL_MAP (read);
|
||||
SYSCALL_MAP (write);
|
||||
SYSCALL_MAP (open);
|
||||
SYSCALL_MAP (close);
|
||||
SYSCALL_MAP (waitpid);
|
||||
SYSCALL_MAP (creat);
|
||||
SYSCALL_MAP (link);
|
||||
SYSCALL_MAP (unlink);
|
||||
SYSCALL_MAP (execve);
|
||||
SYSCALL_MAP (chdir);
|
||||
SYSCALL_MAP (time);
|
||||
SYSCALL_MAP (mknod);
|
||||
SYSCALL_MAP (chmod);
|
||||
SYSCALL_MAP_RENAME (lchown, gdb_sys_lchown16);
|
||||
SYSCALL_MAP_RENAME (break, gdb_sys_ni_syscall17);
|
||||
SYSCALL_MAP_RENAME (oldstat, gdb_sys_stat);
|
||||
SYSCALL_MAP (lseek);
|
||||
SYSCALL_MAP (getpid);
|
||||
SYSCALL_MAP (mount);
|
||||
SYSCALL_MAP_RENAME (umount, gdb_sys_oldumount);
|
||||
SYSCALL_MAP_RENAME (setuid, gdb_sys_setuid16);
|
||||
SYSCALL_MAP_RENAME (getuid, gdb_sys_getuid16);
|
||||
SYSCALL_MAP (stime);
|
||||
SYSCALL_MAP (ptrace);
|
||||
SYSCALL_MAP (alarm);
|
||||
SYSCALL_MAP_RENAME (oldfstat, gdb_sys_fstat);
|
||||
SYSCALL_MAP (pause);
|
||||
SYSCALL_MAP (utime);
|
||||
SYSCALL_MAP_RENAME (stty, gdb_sys_ni_syscall31);
|
||||
SYSCALL_MAP_RENAME (gtty, gdb_sys_ni_syscall32);
|
||||
SYSCALL_MAP (access);
|
||||
SYSCALL_MAP (nice);
|
||||
SYSCALL_MAP_RENAME (ftime, gdb_sys_ni_syscall35);
|
||||
SYSCALL_MAP (sync);
|
||||
SYSCALL_MAP (kill);
|
||||
SYSCALL_MAP (rename);
|
||||
SYSCALL_MAP (mkdir);
|
||||
SYSCALL_MAP (rmdir);
|
||||
SYSCALL_MAP (dup);
|
||||
SYSCALL_MAP (pipe);
|
||||
SYSCALL_MAP (times);
|
||||
SYSCALL_MAP_RENAME (prof, gdb_sys_ni_syscall44);
|
||||
SYSCALL_MAP (brk);
|
||||
SYSCALL_MAP_RENAME (setgid, gdb_sys_setgid16);
|
||||
SYSCALL_MAP_RENAME (getgid, gdb_sys_getgid16);
|
||||
SYSCALL_MAP (signal);
|
||||
SYSCALL_MAP_RENAME (geteuid, gdb_sys_geteuid16);
|
||||
SYSCALL_MAP_RENAME (getegid, gdb_sys_getegid16);
|
||||
SYSCALL_MAP (acct);
|
||||
SYSCALL_MAP_RENAME (umount2, gdb_sys_umount);
|
||||
SYSCALL_MAP_RENAME (lock, gdb_sys_ni_syscall53);
|
||||
SYSCALL_MAP (ioctl);
|
||||
SYSCALL_MAP (fcntl);
|
||||
SYSCALL_MAP_RENAME (mpx, gdb_sys_ni_syscall56);
|
||||
SYSCALL_MAP (setpgid);
|
||||
SYSCALL_MAP_RENAME (ulimit, gdb_sys_ni_syscall58);
|
||||
SYSCALL_MAP_RENAME (oldolduname, gdb_sys_olduname);
|
||||
SYSCALL_MAP (umask);
|
||||
SYSCALL_MAP (chroot);
|
||||
SYSCALL_MAP (ustat);
|
||||
SYSCALL_MAP (dup2);
|
||||
SYSCALL_MAP (getppid);
|
||||
SYSCALL_MAP (getpgrp);
|
||||
SYSCALL_MAP (setsid);
|
||||
SYSCALL_MAP (sigaction);
|
||||
SYSCALL_MAP (sgetmask);
|
||||
SYSCALL_MAP (ssetmask);
|
||||
SYSCALL_MAP_RENAME (setreuid, gdb_sys_setreuid16);
|
||||
SYSCALL_MAP_RENAME (setregid, gdb_sys_setregid16);
|
||||
SYSCALL_MAP (sigsuspend);
|
||||
SYSCALL_MAP (sigpending);
|
||||
SYSCALL_MAP (sethostname);
|
||||
SYSCALL_MAP (setrlimit);
|
||||
SYSCALL_MAP_RENAME (getrlimit, gdb_sys_old_getrlimit);
|
||||
SYSCALL_MAP (getrusage);
|
||||
SYSCALL_MAP (gettimeofday);
|
||||
SYSCALL_MAP (settimeofday);
|
||||
SYSCALL_MAP_RENAME (getgroups, gdb_sys_getgroups16);
|
||||
SYSCALL_MAP_RENAME (setgroups, gdb_sys_setgroups16);
|
||||
SYSCALL_MAP_RENAME (select, gdb_old_select);
|
||||
SYSCALL_MAP (symlink);
|
||||
SYSCALL_MAP_RENAME (oldlstat, gdb_sys_lstat);
|
||||
SYSCALL_MAP (readlink);
|
||||
SYSCALL_MAP (uselib);
|
||||
SYSCALL_MAP (swapon);
|
||||
SYSCALL_MAP (reboot);
|
||||
SYSCALL_MAP_RENAME (readdir, gdb_old_readdir);
|
||||
SYSCALL_MAP_RENAME (mmap, gdb_old_mmap);
|
||||
SYSCALL_MAP (munmap);
|
||||
SYSCALL_MAP (truncate);
|
||||
SYSCALL_MAP (ftruncate);
|
||||
SYSCALL_MAP (fchmod);
|
||||
SYSCALL_MAP_RENAME (fchown, gdb_sys_fchown16);
|
||||
SYSCALL_MAP (getpriority);
|
||||
SYSCALL_MAP (setpriority);
|
||||
SYSCALL_MAP_RENAME (profil, gdb_sys_ni_syscall98);
|
||||
SYSCALL_MAP (statfs);
|
||||
SYSCALL_MAP (fstatfs);
|
||||
SYSCALL_MAP (ioperm);
|
||||
SYSCALL_MAP (socketcall);
|
||||
SYSCALL_MAP (syslog);
|
||||
SYSCALL_MAP (setitimer);
|
||||
SYSCALL_MAP (getitimer);
|
||||
SYSCALL_MAP_RENAME (stat, gdb_sys_newstat);
|
||||
SYSCALL_MAP_RENAME (lstat, gdb_sys_newlstat);
|
||||
SYSCALL_MAP_RENAME (fstat, gdb_sys_newfstat);
|
||||
SYSCALL_MAP_RENAME (olduname, gdb_sys_uname);
|
||||
SYSCALL_MAP (iopl);
|
||||
SYSCALL_MAP (vhangup);
|
||||
SYSCALL_MAP_RENAME (idle, gdb_sys_ni_syscall112);
|
||||
SYSCALL_MAP (vm86old);
|
||||
SYSCALL_MAP (wait4);
|
||||
SYSCALL_MAP (swapoff);
|
||||
SYSCALL_MAP (sysinfo);
|
||||
SYSCALL_MAP (ipc);
|
||||
SYSCALL_MAP (fsync);
|
||||
SYSCALL_MAP (sigreturn);
|
||||
SYSCALL_MAP (clone);
|
||||
SYSCALL_MAP (setdomainname);
|
||||
SYSCALL_MAP_RENAME (uname, gdb_sys_newuname);
|
||||
SYSCALL_MAP (modify_ldt);
|
||||
SYSCALL_MAP (adjtimex);
|
||||
SYSCALL_MAP (mprotect);
|
||||
SYSCALL_MAP (sigprocmask);
|
||||
SYSCALL_MAP_RENAME (create_module, gdb_sys_ni_syscall127);
|
||||
SYSCALL_MAP (init_module);
|
||||
SYSCALL_MAP (delete_module);
|
||||
SYSCALL_MAP_RENAME (get_kernel_syms, gdb_sys_ni_syscall130);
|
||||
SYSCALL_MAP (quotactl);
|
||||
SYSCALL_MAP (getpgid);
|
||||
SYSCALL_MAP (fchdir);
|
||||
SYSCALL_MAP (bdflush);
|
||||
SYSCALL_MAP (sysfs);
|
||||
SYSCALL_MAP (personality);
|
||||
SYSCALL_MAP_RENAME (afs_syscall, gdb_sys_ni_syscall137);
|
||||
SYSCALL_MAP_RENAME (setfsuid, gdb_sys_setfsuid16);
|
||||
SYSCALL_MAP_RENAME (setfsgid, gdb_sys_setfsgid16);
|
||||
SYSCALL_MAP_RENAME (_llseek, gdb_sys_llseek);
|
||||
SYSCALL_MAP (getdents);
|
||||
SYSCALL_MAP_RENAME (_newselect, gdb_sys_select);
|
||||
SYSCALL_MAP (flock);
|
||||
SYSCALL_MAP (msync);
|
||||
SYSCALL_MAP (readv);
|
||||
SYSCALL_MAP (writev);
|
||||
SYSCALL_MAP (getsid);
|
||||
SYSCALL_MAP (fdatasync);
|
||||
SYSCALL_MAP_RENAME (_sysctl, gdb_sys_sysctl);
|
||||
SYSCALL_MAP (mlock);
|
||||
SYSCALL_MAP (munlock);
|
||||
SYSCALL_MAP (mlockall);
|
||||
SYSCALL_MAP (munlockall);
|
||||
SYSCALL_MAP (sched_setparam);
|
||||
SYSCALL_MAP (sched_getparam);
|
||||
SYSCALL_MAP (sched_setscheduler);
|
||||
SYSCALL_MAP (sched_getscheduler);
|
||||
SYSCALL_MAP (sched_yield);
|
||||
SYSCALL_MAP (sched_get_priority_max);
|
||||
SYSCALL_MAP (sched_get_priority_min);
|
||||
SYSCALL_MAP (sched_rr_get_interval);
|
||||
SYSCALL_MAP (nanosleep);
|
||||
SYSCALL_MAP (mremap);
|
||||
SYSCALL_MAP_RENAME (setresuid, gdb_sys_setresuid16);
|
||||
SYSCALL_MAP_RENAME (getresuid, gdb_sys_getresuid16);
|
||||
SYSCALL_MAP (vm86);
|
||||
SYSCALL_MAP_RENAME (query_module, gdb_sys_ni_syscall167);
|
||||
SYSCALL_MAP (poll);
|
||||
SYSCALL_MAP (nfsservctl);
|
||||
SYSCALL_MAP_RENAME (setresgid, gdb_sys_setresgid16);
|
||||
SYSCALL_MAP_RENAME (getresgid, gdb_sys_getresgid16);
|
||||
SYSCALL_MAP (prctl);
|
||||
SYSCALL_MAP (rt_sigreturn);
|
||||
SYSCALL_MAP (rt_sigaction);
|
||||
SYSCALL_MAP (rt_sigprocmask);
|
||||
SYSCALL_MAP (rt_sigpending);
|
||||
SYSCALL_MAP (rt_sigtimedwait);
|
||||
SYSCALL_MAP (rt_sigqueueinfo);
|
||||
SYSCALL_MAP (rt_sigsuspend);
|
||||
SYSCALL_MAP (pread64);
|
||||
SYSCALL_MAP (pwrite64);
|
||||
SYSCALL_MAP_RENAME (chown, gdb_sys_chown16);
|
||||
SYSCALL_MAP (getcwd);
|
||||
SYSCALL_MAP (capget);
|
||||
SYSCALL_MAP (capset);
|
||||
SYSCALL_MAP (sigaltstack);
|
||||
SYSCALL_MAP (sendfile);
|
||||
SYSCALL_MAP_RENAME (getpmsg, gdb_sys_ni_syscall188);
|
||||
SYSCALL_MAP_RENAME (putpmsg, gdb_sys_ni_syscall189);
|
||||
SYSCALL_MAP (vfork);
|
||||
SYSCALL_MAP_RENAME (ugetrlimit, gdb_sys_getrlimit);
|
||||
SYSCALL_MAP (mmap2);
|
||||
SYSCALL_MAP (truncate64);
|
||||
SYSCALL_MAP (ftruncate64);
|
||||
SYSCALL_MAP (stat64);
|
||||
SYSCALL_MAP (lstat64);
|
||||
SYSCALL_MAP (fstat64);
|
||||
|
||||
SYSCALL_MAP_RENAME (lchown32, gdb_sys_lchown);
|
||||
SYSCALL_MAP_RENAME (getuid32, gdb_sys_getuid);
|
||||
SYSCALL_MAP_RENAME (getgid32, gdb_sys_getgid);
|
||||
SYSCALL_MAP_RENAME (geteuid32, gdb_sys_geteuid);
|
||||
SYSCALL_MAP_RENAME (getegid32, gdb_sys_getegid);
|
||||
SYSCALL_MAP_RENAME (setreuid32, gdb_sys_setreuid);
|
||||
SYSCALL_MAP_RENAME (setregid32, gdb_sys_setregid);
|
||||
SYSCALL_MAP_RENAME (getgroups32, gdb_sys_getgroups);
|
||||
SYSCALL_MAP_RENAME (setgroups32, gdb_sys_setgroups);
|
||||
SYSCALL_MAP_RENAME (fchown32, gdb_sys_fchown);
|
||||
SYSCALL_MAP_RENAME (setresuid32, gdb_sys_setresuid);
|
||||
SYSCALL_MAP_RENAME (getresuid32, gdb_sys_getresuid);
|
||||
SYSCALL_MAP_RENAME (setresgid32, gdb_sys_setresgid);
|
||||
SYSCALL_MAP_RENAME (getresgid32, gdb_sys_getresgid);
|
||||
SYSCALL_MAP_RENAME (chown32, gdb_sys_chown);
|
||||
SYSCALL_MAP_RENAME (setuid32, gdb_sys_setuid);
|
||||
SYSCALL_MAP_RENAME (setgid32, gdb_sys_setgid);
|
||||
SYSCALL_MAP_RENAME (setfsuid32, gdb_sys_setfsuid);
|
||||
SYSCALL_MAP_RENAME (setfsgid32, gdb_sys_setfsgid);
|
||||
|
||||
SYSCALL_MAP (pivot_root);
|
||||
SYSCALL_MAP (mincore);
|
||||
SYSCALL_MAP (madvise);
|
||||
SYSCALL_MAP (getdents64);
|
||||
SYSCALL_MAP (fcntl64);
|
||||
SYSCALL_MAP (gettid);
|
||||
SYSCALL_MAP (readahead);
|
||||
SYSCALL_MAP (setxattr);
|
||||
SYSCALL_MAP (lsetxattr);
|
||||
SYSCALL_MAP (fsetxattr);
|
||||
SYSCALL_MAP (getxattr);
|
||||
SYSCALL_MAP (lgetxattr);
|
||||
SYSCALL_MAP (fgetxattr);
|
||||
SYSCALL_MAP (listxattr);
|
||||
SYSCALL_MAP (llistxattr);
|
||||
SYSCALL_MAP (flistxattr);
|
||||
SYSCALL_MAP (removexattr);
|
||||
SYSCALL_MAP (lremovexattr);
|
||||
SYSCALL_MAP (fremovexattr);
|
||||
SYSCALL_MAP (tkill);
|
||||
SYSCALL_MAP (sendfile64);
|
||||
SYSCALL_MAP (futex);
|
||||
SYSCALL_MAP (sched_setaffinity);
|
||||
SYSCALL_MAP (sched_getaffinity);
|
||||
SYSCALL_MAP (set_thread_area);
|
||||
SYSCALL_MAP (get_thread_area);
|
||||
SYSCALL_MAP (io_setup);
|
||||
SYSCALL_MAP (io_destroy);
|
||||
SYSCALL_MAP (io_getevents);
|
||||
SYSCALL_MAP (io_submit);
|
||||
SYSCALL_MAP (io_cancel);
|
||||
SYSCALL_MAP (fadvise64);
|
||||
SYSCALL_MAP (exit_group);
|
||||
SYSCALL_MAP (lookup_dcookie);
|
||||
SYSCALL_MAP (epoll_create);
|
||||
SYSCALL_MAP (epoll_ctl);
|
||||
SYSCALL_MAP (epoll_wait);
|
||||
SYSCALL_MAP (remap_file_pages);
|
||||
SYSCALL_MAP (set_tid_address);
|
||||
SYSCALL_MAP (timer_create);
|
||||
SYSCALL_MAP (timer_settime);
|
||||
SYSCALL_MAP (timer_gettime);
|
||||
SYSCALL_MAP (timer_getoverrun);
|
||||
SYSCALL_MAP (timer_delete);
|
||||
SYSCALL_MAP (clock_settime);
|
||||
SYSCALL_MAP (clock_gettime);
|
||||
SYSCALL_MAP (clock_getres);
|
||||
SYSCALL_MAP (clock_nanosleep);
|
||||
SYSCALL_MAP (statfs64);
|
||||
SYSCALL_MAP (fstatfs64);
|
||||
SYSCALL_MAP (tgkill);
|
||||
SYSCALL_MAP (utimes);
|
||||
SYSCALL_MAP (fadvise64_64);
|
||||
SYSCALL_MAP_RENAME (vserver, gdb_sys_ni_syscall273);
|
||||
SYSCALL_MAP (mbind);
|
||||
SYSCALL_MAP (get_mempolicy);
|
||||
SYSCALL_MAP (set_mempolicy);
|
||||
SYSCALL_MAP (mq_open);
|
||||
SYSCALL_MAP (mq_unlink);
|
||||
SYSCALL_MAP (mq_timedsend);
|
||||
SYSCALL_MAP (mq_timedreceive);
|
||||
SYSCALL_MAP (mq_notify);
|
||||
SYSCALL_MAP (mq_getsetattr);
|
||||
SYSCALL_MAP (kexec_load);
|
||||
SYSCALL_MAP (waitid);
|
||||
SYSCALL_MAP (add_key);
|
||||
SYSCALL_MAP (request_key);
|
||||
SYSCALL_MAP (keyctl);
|
||||
SYSCALL_MAP (ioprio_set);
|
||||
SYSCALL_MAP (ioprio_get);
|
||||
SYSCALL_MAP (inotify_init);
|
||||
SYSCALL_MAP (inotify_add_watch);
|
||||
SYSCALL_MAP (inotify_rm_watch);
|
||||
SYSCALL_MAP (migrate_pages);
|
||||
SYSCALL_MAP (openat);
|
||||
SYSCALL_MAP (mkdirat);
|
||||
SYSCALL_MAP (mknodat);
|
||||
SYSCALL_MAP (fchownat);
|
||||
SYSCALL_MAP (futimesat);
|
||||
SYSCALL_MAP (fstatat64);
|
||||
SYSCALL_MAP (unlinkat);
|
||||
SYSCALL_MAP (renameat);
|
||||
SYSCALL_MAP (linkat);
|
||||
SYSCALL_MAP (symlinkat);
|
||||
SYSCALL_MAP (readlinkat);
|
||||
SYSCALL_MAP (fchmodat);
|
||||
SYSCALL_MAP (faccessat);
|
||||
SYSCALL_MAP (pselect6);
|
||||
SYSCALL_MAP (ppoll);
|
||||
SYSCALL_MAP (unshare);
|
||||
SYSCALL_MAP (set_robust_list);
|
||||
SYSCALL_MAP (get_robust_list);
|
||||
SYSCALL_MAP (splice);
|
||||
SYSCALL_MAP (sync_file_range);
|
||||
SYSCALL_MAP (tee);
|
||||
SYSCALL_MAP (vmsplice);
|
||||
SYSCALL_MAP (move_pages);
|
||||
SYSCALL_MAP (getcpu);
|
||||
SYSCALL_MAP (epoll_pwait);
|
||||
UNSUPPORTED_SYSCALL_MAP (utimensat);
|
||||
UNSUPPORTED_SYSCALL_MAP (signalfd);
|
||||
UNSUPPORTED_SYSCALL_MAP (timerfd_create);
|
||||
UNSUPPORTED_SYSCALL_MAP (eventfd);
|
||||
SYSCALL_MAP (fallocate);
|
||||
UNSUPPORTED_SYSCALL_MAP (timerfd_settime);
|
||||
UNSUPPORTED_SYSCALL_MAP (timerfd_gettime);
|
||||
UNSUPPORTED_SYSCALL_MAP (signalfd4);
|
||||
SYSCALL_MAP (eventfd2);
|
||||
SYSCALL_MAP (epoll_create1);
|
||||
SYSCALL_MAP (dup3);
|
||||
SYSCALL_MAP (pipe2);
|
||||
SYSCALL_MAP (inotify_init1);
|
||||
UNSUPPORTED_SYSCALL_MAP (preadv);
|
||||
UNSUPPORTED_SYSCALL_MAP (pwritev);
|
||||
UNSUPPORTED_SYSCALL_MAP (rt_tgsigqueueinfo);
|
||||
UNSUPPORTED_SYSCALL_MAP (perf_event_open);
|
||||
UNSUPPORTED_SYSCALL_MAP (recvmmsg);
|
||||
UNSUPPORTED_SYSCALL_MAP (fanotify_init);
|
||||
UNSUPPORTED_SYSCALL_MAP (fanotify_mark);
|
||||
UNSUPPORTED_SYSCALL_MAP (prlimit64);
|
||||
UNSUPPORTED_SYSCALL_MAP (name_to_handle_at);
|
||||
UNSUPPORTED_SYSCALL_MAP (open_by_handle_at);
|
||||
UNSUPPORTED_SYSCALL_MAP (clock_adjtime);
|
||||
UNSUPPORTED_SYSCALL_MAP (syncfs);
|
||||
UNSUPPORTED_SYSCALL_MAP (sendmmsg);
|
||||
UNSUPPORTED_SYSCALL_MAP (setns);
|
||||
UNSUPPORTED_SYSCALL_MAP (process_vm_readv);
|
||||
UNSUPPORTED_SYSCALL_MAP (process_vm_writev);
|
||||
UNSUPPORTED_SYSCALL_MAP (kcmp);
|
||||
UNSUPPORTED_SYSCALL_MAP (finit_module);
|
||||
UNSUPPORTED_SYSCALL_MAP (sched_setattr);
|
||||
UNSUPPORTED_SYSCALL_MAP (sched_getattr);
|
||||
UNSUPPORTED_SYSCALL_MAP (renameat2);
|
||||
UNSUPPORTED_SYSCALL_MAP (seccomp);
|
||||
SYSCALL_MAP (getrandom);
|
||||
UNSUPPORTED_SYSCALL_MAP (memfd_create);
|
||||
UNSUPPORTED_SYSCALL_MAP (bpf);
|
||||
UNSUPPORTED_SYSCALL_MAP (execveat);
|
||||
SYSCALL_MAP (socket);
|
||||
SYSCALL_MAP (socketpair);
|
||||
SYSCALL_MAP (bind);
|
||||
SYSCALL_MAP (connect);
|
||||
SYSCALL_MAP (listen);
|
||||
UNSUPPORTED_SYSCALL_MAP (accept4);
|
||||
SYSCALL_MAP (getsockopt);
|
||||
SYSCALL_MAP (setsockopt);
|
||||
SYSCALL_MAP (getsockname);
|
||||
SYSCALL_MAP (getpeername);
|
||||
SYSCALL_MAP (sendto);
|
||||
SYSCALL_MAP (sendmsg);
|
||||
SYSCALL_MAP (recvfrom);
|
||||
SYSCALL_MAP (recvmsg);
|
||||
SYSCALL_MAP (shutdown);
|
||||
UNSUPPORTED_SYSCALL_MAP (userfaultfd);
|
||||
UNSUPPORTED_SYSCALL_MAP (membarrier);
|
||||
UNSUPPORTED_SYSCALL_MAP (mlock2);
|
||||
UNSUPPORTED_SYSCALL_MAP (copy_file_range);
|
||||
UNSUPPORTED_SYSCALL_MAP (preadv2);
|
||||
UNSUPPORTED_SYSCALL_MAP (pwritev2);
|
||||
UNSUPPORTED_SYSCALL_MAP (pkey_mprotect);
|
||||
UNSUPPORTED_SYSCALL_MAP (pkey_alloc);
|
||||
UNSUPPORTED_SYSCALL_MAP (pkey_free);
|
||||
SYSCALL_MAP (statx);
|
||||
UNSUPPORTED_SYSCALL_MAP (arch_prctl);
|
||||
UNSUPPORTED_SYSCALL_MAP (io_pgetevents);
|
||||
UNSUPPORTED_SYSCALL_MAP (rseq);
|
||||
SYSCALL_MAP (semget);
|
||||
SYSCALL_MAP (semctl);
|
||||
SYSCALL_MAP (shmget);
|
||||
SYSCALL_MAP (shmctl);
|
||||
SYSCALL_MAP (shmat);
|
||||
SYSCALL_MAP (shmdt);
|
||||
SYSCALL_MAP (msgget);
|
||||
SYSCALL_MAP (msgsnd);
|
||||
SYSCALL_MAP (msgrcv);
|
||||
SYSCALL_MAP (msgctl);
|
||||
SYSCALL_MAP (clock_gettime64);
|
||||
UNSUPPORTED_SYSCALL_MAP (clock_settime64);
|
||||
UNSUPPORTED_SYSCALL_MAP (clock_adjtime64);
|
||||
UNSUPPORTED_SYSCALL_MAP (clock_getres_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (clock_nanosleep_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (timer_gettime64);
|
||||
UNSUPPORTED_SYSCALL_MAP (timer_settime64);
|
||||
UNSUPPORTED_SYSCALL_MAP (timerfd_gettime64);
|
||||
UNSUPPORTED_SYSCALL_MAP (timerfd_settime64);
|
||||
UNSUPPORTED_SYSCALL_MAP (utimensat_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (pselect6_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (ppoll_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (io_pgetevents_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (recvmmsg_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (mq_timedsend_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (mq_timedreceive_time64);
|
||||
SYSCALL_MAP_RENAME (semtimedop_time64, gdb_sys_semtimedop);
|
||||
UNSUPPORTED_SYSCALL_MAP (rt_sigtimedwait_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (futex_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (sched_rr_get_interval_time64);
|
||||
UNSUPPORTED_SYSCALL_MAP (pidfd_send_signal);
|
||||
UNSUPPORTED_SYSCALL_MAP (io_uring_setup);
|
||||
UNSUPPORTED_SYSCALL_MAP (io_uring_enter);
|
||||
UNSUPPORTED_SYSCALL_MAP (io_uring_register);
|
||||
UNSUPPORTED_SYSCALL_MAP (open_tree);
|
||||
UNSUPPORTED_SYSCALL_MAP (move_mount);
|
||||
UNSUPPORTED_SYSCALL_MAP (fsopen);
|
||||
UNSUPPORTED_SYSCALL_MAP (fsconfig);
|
||||
UNSUPPORTED_SYSCALL_MAP (fsmount);
|
||||
UNSUPPORTED_SYSCALL_MAP (fspick);
|
||||
UNSUPPORTED_SYSCALL_MAP (pidfd_open);
|
||||
UNSUPPORTED_SYSCALL_MAP (clone3);
|
||||
UNSUPPORTED_SYSCALL_MAP (close_range);
|
||||
UNSUPPORTED_SYSCALL_MAP (openat2);
|
||||
UNSUPPORTED_SYSCALL_MAP (pidfd_getfd);
|
||||
UNSUPPORTED_SYSCALL_MAP (faccessat2);
|
||||
UNSUPPORTED_SYSCALL_MAP (process_madvise);
|
||||
UNSUPPORTED_SYSCALL_MAP (epoll_pwait2);
|
||||
UNSUPPORTED_SYSCALL_MAP (mount_setattr);
|
||||
UNSUPPORTED_SYSCALL_MAP (quotactl_fd);
|
||||
UNSUPPORTED_SYSCALL_MAP (landlock_create_ruleset);
|
||||
UNSUPPORTED_SYSCALL_MAP (landlock_add_rule);
|
||||
UNSUPPORTED_SYSCALL_MAP (landlock_restrict_self);
|
||||
UNSUPPORTED_SYSCALL_MAP (memfd_secret);
|
||||
UNSUPPORTED_SYSCALL_MAP (process_mrelease);
|
||||
UNSUPPORTED_SYSCALL_MAP (futex_waitv);
|
||||
UNSUPPORTED_SYSCALL_MAP (set_mempolicy_home_node);
|
||||
UNSUPPORTED_SYSCALL_MAP (cachestat);
|
||||
UNSUPPORTED_SYSCALL_MAP (fchmodat2);
|
||||
UNSUPPORTED_SYSCALL_MAP (map_shadow_stack);
|
||||
UNSUPPORTED_SYSCALL_MAP (futex_wake);
|
||||
UNSUPPORTED_SYSCALL_MAP (futex_wait);
|
||||
UNSUPPORTED_SYSCALL_MAP (futex_requeue);
|
||||
UNSUPPORTED_SYSCALL_MAP (statmount);
|
||||
UNSUPPORTED_SYSCALL_MAP (listmount);
|
||||
UNSUPPORTED_SYSCALL_MAP (lsm_get_self_attr);
|
||||
UNSUPPORTED_SYSCALL_MAP (lsm_set_self_attr);
|
||||
UNSUPPORTED_SYSCALL_MAP (lsm_list_modules);
|
||||
UNSUPPORTED_SYSCALL_MAP (mseal);
|
||||
UNSUPPORTED_SYSCALL_MAP (setxattrat);
|
||||
UNSUPPORTED_SYSCALL_MAP (getxattrat);
|
||||
UNSUPPORTED_SYSCALL_MAP (listxattrat);
|
||||
UNSUPPORTED_SYSCALL_MAP (removexattrat);
|
||||
|
||||
#undef SYSCALL_MAP
|
||||
#undef SYSCALL_MAP_RENAME
|
||||
#undef UNSUPPORTED_SYSCALL_MAP
|
||||
|
||||
default:
|
||||
return gdb_sys_no_syscall;
|
||||
}
|
||||
}
|
||||
|
||||
/* Value of the sigcode in case of a boundary fault. */
|
||||
|
||||
479
gdb/i386-syscalls.def
Normal file
479
gdb/i386-syscalls.def
Normal file
@@ -0,0 +1,479 @@
|
||||
/* Copyright (C) 2025 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
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/>.
|
||||
|
||||
Generated using linux v6.13 and command:
|
||||
|
||||
$ egrep -v "^#.*" ./arch/x86/entry/syscalls/syscall_32.tbl \
|
||||
| awk '{printf "SYSCALL (%s, %s)\n", $1, $3}'
|
||||
*/
|
||||
|
||||
SYSCALL (0, restart_syscall)
|
||||
SYSCALL (1, exit)
|
||||
SYSCALL (2, fork)
|
||||
SYSCALL (3, read)
|
||||
SYSCALL (4, write)
|
||||
SYSCALL (5, open)
|
||||
SYSCALL (6, close)
|
||||
SYSCALL (7, waitpid)
|
||||
SYSCALL (8, creat)
|
||||
SYSCALL (9, link)
|
||||
SYSCALL (10, unlink)
|
||||
SYSCALL (11, execve)
|
||||
SYSCALL (12, chdir)
|
||||
SYSCALL (13, time)
|
||||
SYSCALL (14, mknod)
|
||||
SYSCALL (15, chmod)
|
||||
SYSCALL (16, lchown)
|
||||
SYSCALL (17, break)
|
||||
SYSCALL (18, oldstat)
|
||||
SYSCALL (19, lseek)
|
||||
SYSCALL (20, getpid)
|
||||
SYSCALL (21, mount)
|
||||
SYSCALL (22, umount)
|
||||
SYSCALL (23, setuid)
|
||||
SYSCALL (24, getuid)
|
||||
SYSCALL (25, stime)
|
||||
SYSCALL (26, ptrace)
|
||||
SYSCALL (27, alarm)
|
||||
SYSCALL (28, oldfstat)
|
||||
SYSCALL (29, pause)
|
||||
SYSCALL (30, utime)
|
||||
SYSCALL (31, stty)
|
||||
SYSCALL (32, gtty)
|
||||
SYSCALL (33, access)
|
||||
SYSCALL (34, nice)
|
||||
SYSCALL (35, ftime)
|
||||
SYSCALL (36, sync)
|
||||
SYSCALL (37, kill)
|
||||
SYSCALL (38, rename)
|
||||
SYSCALL (39, mkdir)
|
||||
SYSCALL (40, rmdir)
|
||||
SYSCALL (41, dup)
|
||||
SYSCALL (42, pipe)
|
||||
SYSCALL (43, times)
|
||||
SYSCALL (44, prof)
|
||||
SYSCALL (45, brk)
|
||||
SYSCALL (46, setgid)
|
||||
SYSCALL (47, getgid)
|
||||
SYSCALL (48, signal)
|
||||
SYSCALL (49, geteuid)
|
||||
SYSCALL (50, getegid)
|
||||
SYSCALL (51, acct)
|
||||
SYSCALL (52, umount2)
|
||||
SYSCALL (53, lock)
|
||||
SYSCALL (54, ioctl)
|
||||
SYSCALL (55, fcntl)
|
||||
SYSCALL (56, mpx)
|
||||
SYSCALL (57, setpgid)
|
||||
SYSCALL (58, ulimit)
|
||||
SYSCALL (59, oldolduname)
|
||||
SYSCALL (60, umask)
|
||||
SYSCALL (61, chroot)
|
||||
SYSCALL (62, ustat)
|
||||
SYSCALL (63, dup2)
|
||||
SYSCALL (64, getppid)
|
||||
SYSCALL (65, getpgrp)
|
||||
SYSCALL (66, setsid)
|
||||
SYSCALL (67, sigaction)
|
||||
SYSCALL (68, sgetmask)
|
||||
SYSCALL (69, ssetmask)
|
||||
SYSCALL (70, setreuid)
|
||||
SYSCALL (71, setregid)
|
||||
SYSCALL (72, sigsuspend)
|
||||
SYSCALL (73, sigpending)
|
||||
SYSCALL (74, sethostname)
|
||||
SYSCALL (75, setrlimit)
|
||||
SYSCALL (76, getrlimit)
|
||||
SYSCALL (77, getrusage)
|
||||
SYSCALL (78, gettimeofday)
|
||||
SYSCALL (79, settimeofday)
|
||||
SYSCALL (80, getgroups)
|
||||
SYSCALL (81, setgroups)
|
||||
SYSCALL (82, select)
|
||||
SYSCALL (83, symlink)
|
||||
SYSCALL (84, oldlstat)
|
||||
SYSCALL (85, readlink)
|
||||
SYSCALL (86, uselib)
|
||||
SYSCALL (87, swapon)
|
||||
SYSCALL (88, reboot)
|
||||
SYSCALL (89, readdir)
|
||||
SYSCALL (90, mmap)
|
||||
SYSCALL (91, munmap)
|
||||
SYSCALL (92, truncate)
|
||||
SYSCALL (93, ftruncate)
|
||||
SYSCALL (94, fchmod)
|
||||
SYSCALL (95, fchown)
|
||||
SYSCALL (96, getpriority)
|
||||
SYSCALL (97, setpriority)
|
||||
SYSCALL (98, profil)
|
||||
SYSCALL (99, statfs)
|
||||
SYSCALL (100, fstatfs)
|
||||
SYSCALL (101, ioperm)
|
||||
SYSCALL (102, socketcall)
|
||||
SYSCALL (103, syslog)
|
||||
SYSCALL (104, setitimer)
|
||||
SYSCALL (105, getitimer)
|
||||
SYSCALL (106, stat)
|
||||
SYSCALL (107, lstat)
|
||||
SYSCALL (108, fstat)
|
||||
SYSCALL (109, olduname)
|
||||
SYSCALL (110, iopl)
|
||||
SYSCALL (111, vhangup)
|
||||
SYSCALL (112, idle)
|
||||
SYSCALL (113, vm86old)
|
||||
SYSCALL (114, wait4)
|
||||
SYSCALL (115, swapoff)
|
||||
SYSCALL (116, sysinfo)
|
||||
SYSCALL (117, ipc)
|
||||
SYSCALL (118, fsync)
|
||||
SYSCALL (119, sigreturn)
|
||||
SYSCALL (120, clone)
|
||||
SYSCALL (121, setdomainname)
|
||||
SYSCALL (122, uname)
|
||||
SYSCALL (123, modify_ldt)
|
||||
SYSCALL (124, adjtimex)
|
||||
SYSCALL (125, mprotect)
|
||||
SYSCALL (126, sigprocmask)
|
||||
SYSCALL (127, create_module)
|
||||
SYSCALL (128, init_module)
|
||||
SYSCALL (129, delete_module)
|
||||
SYSCALL (130, get_kernel_syms)
|
||||
SYSCALL (131, quotactl)
|
||||
SYSCALL (132, getpgid)
|
||||
SYSCALL (133, fchdir)
|
||||
SYSCALL (134, bdflush)
|
||||
SYSCALL (135, sysfs)
|
||||
SYSCALL (136, personality)
|
||||
SYSCALL (137, afs_syscall)
|
||||
SYSCALL (138, setfsuid)
|
||||
SYSCALL (139, setfsgid)
|
||||
SYSCALL (140, _llseek)
|
||||
SYSCALL (141, getdents)
|
||||
SYSCALL (142, _newselect)
|
||||
SYSCALL (143, flock)
|
||||
SYSCALL (144, msync)
|
||||
SYSCALL (145, readv)
|
||||
SYSCALL (146, writev)
|
||||
SYSCALL (147, getsid)
|
||||
SYSCALL (148, fdatasync)
|
||||
SYSCALL (149, _sysctl)
|
||||
SYSCALL (150, mlock)
|
||||
SYSCALL (151, munlock)
|
||||
SYSCALL (152, mlockall)
|
||||
SYSCALL (153, munlockall)
|
||||
SYSCALL (154, sched_setparam)
|
||||
SYSCALL (155, sched_getparam)
|
||||
SYSCALL (156, sched_setscheduler)
|
||||
SYSCALL (157, sched_getscheduler)
|
||||
SYSCALL (158, sched_yield)
|
||||
SYSCALL (159, sched_get_priority_max)
|
||||
SYSCALL (160, sched_get_priority_min)
|
||||
SYSCALL (161, sched_rr_get_interval)
|
||||
SYSCALL (162, nanosleep)
|
||||
SYSCALL (163, mremap)
|
||||
SYSCALL (164, setresuid)
|
||||
SYSCALL (165, getresuid)
|
||||
SYSCALL (166, vm86)
|
||||
SYSCALL (167, query_module)
|
||||
SYSCALL (168, poll)
|
||||
SYSCALL (169, nfsservctl)
|
||||
SYSCALL (170, setresgid)
|
||||
SYSCALL (171, getresgid)
|
||||
SYSCALL (172, prctl)
|
||||
SYSCALL (173, rt_sigreturn)
|
||||
SYSCALL (174, rt_sigaction)
|
||||
SYSCALL (175, rt_sigprocmask)
|
||||
SYSCALL (176, rt_sigpending)
|
||||
SYSCALL (177, rt_sigtimedwait)
|
||||
SYSCALL (178, rt_sigqueueinfo)
|
||||
SYSCALL (179, rt_sigsuspend)
|
||||
SYSCALL (180, pread64)
|
||||
SYSCALL (181, pwrite64)
|
||||
SYSCALL (182, chown)
|
||||
SYSCALL (183, getcwd)
|
||||
SYSCALL (184, capget)
|
||||
SYSCALL (185, capset)
|
||||
SYSCALL (186, sigaltstack)
|
||||
SYSCALL (187, sendfile)
|
||||
SYSCALL (188, getpmsg)
|
||||
SYSCALL (189, putpmsg)
|
||||
SYSCALL (190, vfork)
|
||||
SYSCALL (191, ugetrlimit)
|
||||
SYSCALL (192, mmap2)
|
||||
SYSCALL (193, truncate64)
|
||||
SYSCALL (194, ftruncate64)
|
||||
SYSCALL (195, stat64)
|
||||
SYSCALL (196, lstat64)
|
||||
SYSCALL (197, fstat64)
|
||||
SYSCALL (198, lchown32)
|
||||
SYSCALL (199, getuid32)
|
||||
SYSCALL (200, getgid32)
|
||||
SYSCALL (201, geteuid32)
|
||||
SYSCALL (202, getegid32)
|
||||
SYSCALL (203, setreuid32)
|
||||
SYSCALL (204, setregid32)
|
||||
SYSCALL (205, getgroups32)
|
||||
SYSCALL (206, setgroups32)
|
||||
SYSCALL (207, fchown32)
|
||||
SYSCALL (208, setresuid32)
|
||||
SYSCALL (209, getresuid32)
|
||||
SYSCALL (210, setresgid32)
|
||||
SYSCALL (211, getresgid32)
|
||||
SYSCALL (212, chown32)
|
||||
SYSCALL (213, setuid32)
|
||||
SYSCALL (214, setgid32)
|
||||
SYSCALL (215, setfsuid32)
|
||||
SYSCALL (216, setfsgid32)
|
||||
SYSCALL (217, pivot_root)
|
||||
SYSCALL (218, mincore)
|
||||
SYSCALL (219, madvise)
|
||||
SYSCALL (220, getdents64)
|
||||
SYSCALL (221, fcntl64)
|
||||
SYSCALL (224, gettid)
|
||||
SYSCALL (225, readahead)
|
||||
SYSCALL (226, setxattr)
|
||||
SYSCALL (227, lsetxattr)
|
||||
SYSCALL (228, fsetxattr)
|
||||
SYSCALL (229, getxattr)
|
||||
SYSCALL (230, lgetxattr)
|
||||
SYSCALL (231, fgetxattr)
|
||||
SYSCALL (232, listxattr)
|
||||
SYSCALL (233, llistxattr)
|
||||
SYSCALL (234, flistxattr)
|
||||
SYSCALL (235, removexattr)
|
||||
SYSCALL (236, lremovexattr)
|
||||
SYSCALL (237, fremovexattr)
|
||||
SYSCALL (238, tkill)
|
||||
SYSCALL (239, sendfile64)
|
||||
SYSCALL (240, futex)
|
||||
SYSCALL (241, sched_setaffinity)
|
||||
SYSCALL (242, sched_getaffinity)
|
||||
SYSCALL (243, set_thread_area)
|
||||
SYSCALL (244, get_thread_area)
|
||||
SYSCALL (245, io_setup)
|
||||
SYSCALL (246, io_destroy)
|
||||
SYSCALL (247, io_getevents)
|
||||
SYSCALL (248, io_submit)
|
||||
SYSCALL (249, io_cancel)
|
||||
SYSCALL (250, fadvise64)
|
||||
SYSCALL (252, exit_group)
|
||||
SYSCALL (253, lookup_dcookie)
|
||||
SYSCALL (254, epoll_create)
|
||||
SYSCALL (255, epoll_ctl)
|
||||
SYSCALL (256, epoll_wait)
|
||||
SYSCALL (257, remap_file_pages)
|
||||
SYSCALL (258, set_tid_address)
|
||||
SYSCALL (259, timer_create)
|
||||
SYSCALL (260, timer_settime)
|
||||
SYSCALL (261, timer_gettime)
|
||||
SYSCALL (262, timer_getoverrun)
|
||||
SYSCALL (263, timer_delete)
|
||||
SYSCALL (264, clock_settime)
|
||||
SYSCALL (265, clock_gettime)
|
||||
SYSCALL (266, clock_getres)
|
||||
SYSCALL (267, clock_nanosleep)
|
||||
SYSCALL (268, statfs64)
|
||||
SYSCALL (269, fstatfs64)
|
||||
SYSCALL (270, tgkill)
|
||||
SYSCALL (271, utimes)
|
||||
SYSCALL (272, fadvise64_64)
|
||||
SYSCALL (273, vserver)
|
||||
SYSCALL (274, mbind)
|
||||
SYSCALL (275, get_mempolicy)
|
||||
SYSCALL (276, set_mempolicy)
|
||||
SYSCALL (277, mq_open)
|
||||
SYSCALL (278, mq_unlink)
|
||||
SYSCALL (279, mq_timedsend)
|
||||
SYSCALL (280, mq_timedreceive)
|
||||
SYSCALL (281, mq_notify)
|
||||
SYSCALL (282, mq_getsetattr)
|
||||
SYSCALL (283, kexec_load)
|
||||
SYSCALL (284, waitid)
|
||||
SYSCALL (286, add_key)
|
||||
SYSCALL (287, request_key)
|
||||
SYSCALL (288, keyctl)
|
||||
SYSCALL (289, ioprio_set)
|
||||
SYSCALL (290, ioprio_get)
|
||||
SYSCALL (291, inotify_init)
|
||||
SYSCALL (292, inotify_add_watch)
|
||||
SYSCALL (293, inotify_rm_watch)
|
||||
SYSCALL (294, migrate_pages)
|
||||
SYSCALL (295, openat)
|
||||
SYSCALL (296, mkdirat)
|
||||
SYSCALL (297, mknodat)
|
||||
SYSCALL (298, fchownat)
|
||||
SYSCALL (299, futimesat)
|
||||
SYSCALL (300, fstatat64)
|
||||
SYSCALL (301, unlinkat)
|
||||
SYSCALL (302, renameat)
|
||||
SYSCALL (303, linkat)
|
||||
SYSCALL (304, symlinkat)
|
||||
SYSCALL (305, readlinkat)
|
||||
SYSCALL (306, fchmodat)
|
||||
SYSCALL (307, faccessat)
|
||||
SYSCALL (308, pselect6)
|
||||
SYSCALL (309, ppoll)
|
||||
SYSCALL (310, unshare)
|
||||
SYSCALL (311, set_robust_list)
|
||||
SYSCALL (312, get_robust_list)
|
||||
SYSCALL (313, splice)
|
||||
SYSCALL (314, sync_file_range)
|
||||
SYSCALL (315, tee)
|
||||
SYSCALL (316, vmsplice)
|
||||
SYSCALL (317, move_pages)
|
||||
SYSCALL (318, getcpu)
|
||||
SYSCALL (319, epoll_pwait)
|
||||
SYSCALL (320, utimensat)
|
||||
SYSCALL (321, signalfd)
|
||||
SYSCALL (322, timerfd_create)
|
||||
SYSCALL (323, eventfd)
|
||||
SYSCALL (324, fallocate)
|
||||
SYSCALL (325, timerfd_settime)
|
||||
SYSCALL (326, timerfd_gettime)
|
||||
SYSCALL (327, signalfd4)
|
||||
SYSCALL (328, eventfd2)
|
||||
SYSCALL (329, epoll_create1)
|
||||
SYSCALL (330, dup3)
|
||||
SYSCALL (331, pipe2)
|
||||
SYSCALL (332, inotify_init1)
|
||||
SYSCALL (333, preadv)
|
||||
SYSCALL (334, pwritev)
|
||||
SYSCALL (335, rt_tgsigqueueinfo)
|
||||
SYSCALL (336, perf_event_open)
|
||||
SYSCALL (337, recvmmsg)
|
||||
SYSCALL (338, fanotify_init)
|
||||
SYSCALL (339, fanotify_mark)
|
||||
SYSCALL (340, prlimit64)
|
||||
SYSCALL (341, name_to_handle_at)
|
||||
SYSCALL (342, open_by_handle_at)
|
||||
SYSCALL (343, clock_adjtime)
|
||||
SYSCALL (344, syncfs)
|
||||
SYSCALL (345, sendmmsg)
|
||||
SYSCALL (346, setns)
|
||||
SYSCALL (347, process_vm_readv)
|
||||
SYSCALL (348, process_vm_writev)
|
||||
SYSCALL (349, kcmp)
|
||||
SYSCALL (350, finit_module)
|
||||
SYSCALL (351, sched_setattr)
|
||||
SYSCALL (352, sched_getattr)
|
||||
SYSCALL (353, renameat2)
|
||||
SYSCALL (354, seccomp)
|
||||
SYSCALL (355, getrandom)
|
||||
SYSCALL (356, memfd_create)
|
||||
SYSCALL (357, bpf)
|
||||
SYSCALL (358, execveat)
|
||||
SYSCALL (359, socket)
|
||||
SYSCALL (360, socketpair)
|
||||
SYSCALL (361, bind)
|
||||
SYSCALL (362, connect)
|
||||
SYSCALL (363, listen)
|
||||
SYSCALL (364, accept4)
|
||||
SYSCALL (365, getsockopt)
|
||||
SYSCALL (366, setsockopt)
|
||||
SYSCALL (367, getsockname)
|
||||
SYSCALL (368, getpeername)
|
||||
SYSCALL (369, sendto)
|
||||
SYSCALL (370, sendmsg)
|
||||
SYSCALL (371, recvfrom)
|
||||
SYSCALL (372, recvmsg)
|
||||
SYSCALL (373, shutdown)
|
||||
SYSCALL (374, userfaultfd)
|
||||
SYSCALL (375, membarrier)
|
||||
SYSCALL (376, mlock2)
|
||||
SYSCALL (377, copy_file_range)
|
||||
SYSCALL (378, preadv2)
|
||||
SYSCALL (379, pwritev2)
|
||||
SYSCALL (380, pkey_mprotect)
|
||||
SYSCALL (381, pkey_alloc)
|
||||
SYSCALL (382, pkey_free)
|
||||
SYSCALL (383, statx)
|
||||
SYSCALL (384, arch_prctl)
|
||||
SYSCALL (385, io_pgetevents)
|
||||
SYSCALL (386, rseq)
|
||||
SYSCALL (393, semget)
|
||||
SYSCALL (394, semctl)
|
||||
SYSCALL (395, shmget)
|
||||
SYSCALL (396, shmctl)
|
||||
SYSCALL (397, shmat)
|
||||
SYSCALL (398, shmdt)
|
||||
SYSCALL (399, msgget)
|
||||
SYSCALL (400, msgsnd)
|
||||
SYSCALL (401, msgrcv)
|
||||
SYSCALL (402, msgctl)
|
||||
SYSCALL (403, clock_gettime64)
|
||||
SYSCALL (404, clock_settime64)
|
||||
SYSCALL (405, clock_adjtime64)
|
||||
SYSCALL (406, clock_getres_time64)
|
||||
SYSCALL (407, clock_nanosleep_time64)
|
||||
SYSCALL (408, timer_gettime64)
|
||||
SYSCALL (409, timer_settime64)
|
||||
SYSCALL (410, timerfd_gettime64)
|
||||
SYSCALL (411, timerfd_settime64)
|
||||
SYSCALL (412, utimensat_time64)
|
||||
SYSCALL (413, pselect6_time64)
|
||||
SYSCALL (414, ppoll_time64)
|
||||
SYSCALL (416, io_pgetevents_time64)
|
||||
SYSCALL (417, recvmmsg_time64)
|
||||
SYSCALL (418, mq_timedsend_time64)
|
||||
SYSCALL (419, mq_timedreceive_time64)
|
||||
SYSCALL (420, semtimedop_time64)
|
||||
SYSCALL (421, rt_sigtimedwait_time64)
|
||||
SYSCALL (422, futex_time64)
|
||||
SYSCALL (423, sched_rr_get_interval_time64)
|
||||
SYSCALL (424, pidfd_send_signal)
|
||||
SYSCALL (425, io_uring_setup)
|
||||
SYSCALL (426, io_uring_enter)
|
||||
SYSCALL (427, io_uring_register)
|
||||
SYSCALL (428, open_tree)
|
||||
SYSCALL (429, move_mount)
|
||||
SYSCALL (430, fsopen)
|
||||
SYSCALL (431, fsconfig)
|
||||
SYSCALL (432, fsmount)
|
||||
SYSCALL (433, fspick)
|
||||
SYSCALL (434, pidfd_open)
|
||||
SYSCALL (435, clone3)
|
||||
SYSCALL (436, close_range)
|
||||
SYSCALL (437, openat2)
|
||||
SYSCALL (438, pidfd_getfd)
|
||||
SYSCALL (439, faccessat2)
|
||||
SYSCALL (440, process_madvise)
|
||||
SYSCALL (441, epoll_pwait2)
|
||||
SYSCALL (442, mount_setattr)
|
||||
SYSCALL (443, quotactl_fd)
|
||||
SYSCALL (444, landlock_create_ruleset)
|
||||
SYSCALL (445, landlock_add_rule)
|
||||
SYSCALL (446, landlock_restrict_self)
|
||||
SYSCALL (447, memfd_secret)
|
||||
SYSCALL (448, process_mrelease)
|
||||
SYSCALL (449, futex_waitv)
|
||||
SYSCALL (450, set_mempolicy_home_node)
|
||||
SYSCALL (451, cachestat)
|
||||
SYSCALL (452, fchmodat2)
|
||||
SYSCALL (453, map_shadow_stack)
|
||||
SYSCALL (454, futex_wake)
|
||||
SYSCALL (455, futex_wait)
|
||||
SYSCALL (456, futex_requeue)
|
||||
SYSCALL (457, statmount)
|
||||
SYSCALL (458, listmount)
|
||||
SYSCALL (459, lsm_get_self_attr)
|
||||
SYSCALL (460, lsm_set_self_attr)
|
||||
SYSCALL (461, lsm_list_modules)
|
||||
SYSCALL (462, mseal)
|
||||
SYSCALL (463, setxattrat)
|
||||
SYSCALL (464, getxattrat)
|
||||
SYSCALL (465, listxattrat)
|
||||
SYSCALL (466, removexattrat)
|
||||
@@ -665,6 +665,8 @@ jit_object_close_impl (struct gdb_symbol_callbacks *cb,
|
||||
|
||||
objfile *objfile = objfile::make (nullptr, current_program_space,
|
||||
objfile_name.c_str (), OBJF_NOT_FILENAME);
|
||||
objfile->section_offsets.push_back (0);
|
||||
objfile->sect_index_text = 0;
|
||||
objfile->per_bfd->gdbarch = priv_data->gdbarch;
|
||||
|
||||
for (gdb_symtab &symtab : obj->symtabs)
|
||||
|
||||
@@ -854,7 +854,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args,
|
||||
{
|
||||
xsnprintf (filename, sizeof filename, "/proc/%ld/cmdline", pid);
|
||||
gdb_byte *buffer;
|
||||
ssize_t len = target_fileio_read_alloc (NULL, filename, &buffer);
|
||||
LONGEST len = target_fileio_read_alloc (nullptr, filename, &buffer);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
@@ -2180,17 +2180,17 @@ linux_fill_prpsinfo (struct elf_internal_linux_prpsinfo *p)
|
||||
/* The number of fields read by `sscanf'. */
|
||||
int n_fields = 0;
|
||||
|
||||
gdb_assert (p != NULL);
|
||||
gdb_assert (p != nullptr);
|
||||
|
||||
/* Obtaining PID and filename. */
|
||||
pid = inferior_ptid.pid ();
|
||||
xsnprintf (filename, sizeof (filename), "/proc/%d/cmdline", (int) pid);
|
||||
/* The full name of the program which generated the corefile. */
|
||||
gdb_byte *buf = NULL;
|
||||
size_t buf_len = target_fileio_read_alloc (NULL, filename, &buf);
|
||||
gdb_byte *buf = nullptr;
|
||||
LONGEST buf_len = target_fileio_read_alloc (nullptr, filename, &buf);
|
||||
gdb::unique_xmalloc_ptr<char> fname ((char *)buf);
|
||||
|
||||
if (buf_len < 1 || fname.get ()[0] == '\0')
|
||||
if (buf_len < 1 || fname.get () == nullptr || fname.get ()[0] == '\0')
|
||||
{
|
||||
/* No program name was read, so we won't be able to retrieve more
|
||||
information about the process. */
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "gdbsupport/scoped_fd.h"
|
||||
#include "gdbsupport/pathstuff.h"
|
||||
#include "gdbsupport/buildargv.h"
|
||||
#include "gdbsupport/eintr.h"
|
||||
#include "cli/cli-style.h"
|
||||
|
||||
/* This module provides the interface between GDB and the
|
||||
|
||||
@@ -21,7 +21,7 @@ from typing import Optional, Sequence
|
||||
|
||||
import gdb
|
||||
|
||||
from .server import capability, request, send_event
|
||||
from .server import capability, export_line, import_line, request, send_event
|
||||
from .sources import make_source
|
||||
from .startup import (
|
||||
DAPException,
|
||||
@@ -128,7 +128,7 @@ def _breakpoint_descriptor(bp):
|
||||
result.update(
|
||||
{
|
||||
"source": make_source(filename),
|
||||
"line": line,
|
||||
"line": export_line(line),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -281,7 +281,7 @@ def _rewrite_src_breakpoint(
|
||||
):
|
||||
return {
|
||||
"source": source["path"],
|
||||
"line": line,
|
||||
"line": import_line(line),
|
||||
"condition": condition,
|
||||
"hitCondition": hitCondition,
|
||||
"logMessage": logMessage,
|
||||
|
||||
@@ -21,7 +21,7 @@ import gdb
|
||||
from .frames import dap_frame_generator
|
||||
from .modules import module_id
|
||||
from .scopes import symbol_value
|
||||
from .server import capability, request
|
||||
from .server import capability, export_line, request
|
||||
from .sources import make_source
|
||||
from .startup import in_gdb_thread
|
||||
from .state import set_thread
|
||||
@@ -86,8 +86,11 @@ def _backtrace(thread_id, levels, startFrame, stack_format):
|
||||
}
|
||||
line = current_frame.line()
|
||||
if line is not None:
|
||||
newframe["line"] = line
|
||||
newframe["line"] = export_line(line)
|
||||
if stack_format["line"]:
|
||||
# Unclear whether export_line should be called
|
||||
# here, but since it's just for users we pick the
|
||||
# gdb representation.
|
||||
name += ", line " + str(line)
|
||||
objfile = gdb.current_progspace().objfile_for_address(pc)
|
||||
if objfile is not None:
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
import gdb
|
||||
|
||||
from .server import capability, request
|
||||
from .server import capability, export_line, request
|
||||
from .sources import make_source
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class _BlockTracker:
|
||||
sal = gdb.find_pc_line(pc)
|
||||
if sal.symtab is not None:
|
||||
if sal.line != 0:
|
||||
result["line"] = sal.line
|
||||
result["line"] = export_line(sal.line)
|
||||
if sal.symtab.filename is not None:
|
||||
# The spec says this can be omitted in some
|
||||
# situations, but it's a little simpler to just always
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# This is deprecated in 3.9, but required in older versions.
|
||||
from typing import Optional
|
||||
|
||||
from .server import capability, request
|
||||
from .server import capability, export_line, import_line, request
|
||||
from .sources import decode_source
|
||||
from .startup import exec_mi_and_log
|
||||
|
||||
@@ -31,12 +31,15 @@ from .startup import exec_mi_and_log
|
||||
@request("breakpointLocations", expect_stopped=False)
|
||||
@capability("supportsBreakpointLocationsRequest")
|
||||
def breakpoint_locations(*, source, line: int, endLine: Optional[int] = None, **extra):
|
||||
line = import_line(line)
|
||||
if endLine is None:
|
||||
endLine = line
|
||||
else:
|
||||
endLine = import_line(endLine)
|
||||
filename = decode_source(source)
|
||||
lines = set()
|
||||
for entry in exec_mi_and_log("-symbol-list-lines", filename)["lines"]:
|
||||
this_line = entry["line"]
|
||||
if this_line >= line and this_line <= endLine:
|
||||
lines.add(this_line)
|
||||
lines.add(export_line(this_line))
|
||||
return {"breakpoints": [{"line": x} for x in sorted(lines)]}
|
||||
|
||||
@@ -17,7 +17,7 @@ import gdb
|
||||
|
||||
from .frames import frame_for_id
|
||||
from .globalvars import get_global_scope
|
||||
from .server import request
|
||||
from .server import export_line, request
|
||||
from .sources import make_source
|
||||
from .startup import in_gdb_thread
|
||||
from .varref import BaseReference
|
||||
@@ -92,7 +92,7 @@ class _ScopeReference(BaseReference):
|
||||
result["namedVariables"] = self.child_count()
|
||||
frame = frame_for_id(self.frameId)
|
||||
if frame.line() is not None:
|
||||
result["line"] = frame.line()
|
||||
result["line"] = export_line(frame.line())
|
||||
filename = frame.filename()
|
||||
if filename is not None:
|
||||
result["source"] = make_source(filename)
|
||||
|
||||
@@ -46,6 +46,10 @@ _commands = {}
|
||||
# The global server.
|
||||
_server = None
|
||||
|
||||
# This is set by the initialize request and is used when rewriting
|
||||
# line numbers.
|
||||
_lines_start_at_1 = False
|
||||
|
||||
|
||||
class DeferredRequest:
|
||||
"""If a DAP request function returns a deferred request, no
|
||||
@@ -571,15 +575,15 @@ def capability(name, value=True):
|
||||
return wrap
|
||||
|
||||
|
||||
def client_bool_capability(name):
|
||||
def client_bool_capability(name, default=False):
|
||||
"""Return the value of a boolean client capability.
|
||||
|
||||
If the capability was not specified, or did not have boolean type,
|
||||
False is returned."""
|
||||
DEFAULT is returned. DEFAULT defaults to False."""
|
||||
global _server
|
||||
if name in _server.config and isinstance(_server.config[name], bool):
|
||||
return _server.config[name]
|
||||
return False
|
||||
return default
|
||||
|
||||
|
||||
@request("initialize", on_dap_thread=True)
|
||||
@@ -587,6 +591,8 @@ def initialize(**args):
|
||||
global _server, _capabilities
|
||||
_server.config = args
|
||||
_server.send_event_later("initialized")
|
||||
global _lines_start_at_1
|
||||
_lines_start_at_1 = client_bool_capability("linesStartAt1", True)
|
||||
return _capabilities.copy()
|
||||
|
||||
|
||||
@@ -690,3 +696,27 @@ def send_gdb_with_response(fn):
|
||||
if isinstance(val, (Exception, KeyboardInterrupt)):
|
||||
raise val
|
||||
return val
|
||||
|
||||
|
||||
def export_line(line):
|
||||
"""Rewrite LINE according to client capability.
|
||||
This applies the linesStartAt1 capability as needed,
|
||||
when sending a line number from gdb to the client."""
|
||||
global _lines_start_at_1
|
||||
if not _lines_start_at_1:
|
||||
# In gdb, lines start at 1, so we only need to change this if
|
||||
# the client starts at 0.
|
||||
line = line - 1
|
||||
return line
|
||||
|
||||
|
||||
def import_line(line):
|
||||
"""Rewrite LINE according to client capability.
|
||||
This applies the linesStartAt1 capability as needed,
|
||||
when the client sends a line number to gdb."""
|
||||
global _lines_start_at_1
|
||||
if not _lines_start_at_1:
|
||||
# In gdb, lines start at 1, so we only need to change this if
|
||||
# the client starts at 0.
|
||||
line = line + 1
|
||||
return line
|
||||
|
||||
@@ -5847,6 +5847,7 @@ static const struct protocol_feature remote_protocol_features[] = {
|
||||
PACKET_memory_tagging_feature },
|
||||
{ "error-message", PACKET_ENABLE, remote_supported_packet,
|
||||
PACKET_accept_error_message },
|
||||
{ "binary-upload", PACKET_DISABLE, remote_supported_packet, PACKET_x },
|
||||
};
|
||||
|
||||
static char *remote_support_xml;
|
||||
|
||||
@@ -69,7 +69,7 @@ gdb_test_multiple "core-file $corefile_1" "load core file no args" {
|
||||
}
|
||||
|
||||
# Generate a core file, this time pass some arguments to the inferior.
|
||||
set args "aaaaa bbbbb ccccc ddddd eeeee"
|
||||
set args "aaaaa bbbbb ccccc ddddd e\\\\ e\\\\ e\\\\ e\\\\ e"
|
||||
set corefile [core_find $binfile {} $args]
|
||||
if {$corefile == ""} {
|
||||
untested "unable to create corefile"
|
||||
@@ -101,6 +101,27 @@ gdb_test_multiple "core-file $corefile_2" "load core file with args" {
|
||||
gdb_test "show args" \
|
||||
"Argument list to give program being debugged when it is started is \"$args\"\\."
|
||||
|
||||
# Move up to 'main'. Do it this way because we cannot know how many
|
||||
# frames up 'main' actually is.
|
||||
gdb_test_multiple "up" "move up to main" {
|
||||
-re -wrap "#$decimal\\s+\[^\r\n\]+ in main .*" {
|
||||
pass $gdb_test_name
|
||||
}
|
||||
|
||||
-re -wrap "#$decimal\\s+\[^\r\n\]+ in .*" {
|
||||
send_gdb "up\n"
|
||||
exp_continue
|
||||
}
|
||||
}
|
||||
|
||||
# Check that the inferior was started with the expected arguments.
|
||||
gdb_test "print argc" " = 6"
|
||||
gdb_test "print argv\[1\]" " = $hex \"aaaaa\""
|
||||
gdb_test "print argv\[2\]" " = $hex \"bbbbb\""
|
||||
gdb_test "print argv\[3\]" " = $hex \"ccccc\""
|
||||
gdb_test "print argv\[4\]" " = $hex \"ddddd\""
|
||||
gdb_test "print argv\[5\]" " = $hex \"e e e e e\""
|
||||
|
||||
# Find the name of an environment variable that is not set.
|
||||
set env_var_base "GDB_TEST_ENV_VAR_"
|
||||
set env_var_name ""
|
||||
|
||||
@@ -692,7 +692,7 @@ set show_conv_list \
|
||||
{$_gdb_setting_str = <internal function _gdb_setting_str>} \
|
||||
{$_gdb_setting = <internal function _gdb_setting>} \
|
||||
{$_gdb_major = 16} \
|
||||
{$_gdb_minor = 1} \
|
||||
{$_gdb_minor = 3} \
|
||||
{$_shell_exitsignal = void} \
|
||||
{$_shell_exitcode = 0} \
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2024-2025 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
|
||||
@@ -60,8 +60,10 @@ if { ![gdb_assert { ![expr {$res < 0 || $res == ""}] } $test] } {
|
||||
set test "got backtrace"
|
||||
set saw_backtrace false
|
||||
set no_awk false
|
||||
set location_re ${srcfile}:${decimal}
|
||||
|
||||
gdb_test_multiple "" $test {
|
||||
-i "$res" -re "#0 +(0x\[0-9a-f\]+ in )?main \(\).*\r\nGSTACK-END\r\n\$" {
|
||||
-i "$res" -re "#0 +(0x\[0-9a-f\]+ in )?main \(\).*$location_re.*\r\nGSTACK-END\r\n\$" {
|
||||
set saw_backtrace true
|
||||
pass $test
|
||||
exp_continue
|
||||
|
||||
@@ -72,77 +72,89 @@ gdb_continue_to_breakpoint "stop at test breakpoint"
|
||||
gdb_test_no_output "source ${pyfile}"\
|
||||
"import python scripts"
|
||||
|
||||
# Check the unbroken stack.
|
||||
gdb_test_sequence "bt" "backtrace when the unwind is left unbroken" {
|
||||
"\\r\\n#0 \[^\r\n\]* inline_func \\(\\) at "
|
||||
"\\r\\n#1 \[^\r\n\]* normal_func \\(\\) at "
|
||||
"\\r\\n#2 \[^\r\n\]* inline_func \\(\\) at "
|
||||
"\\r\\n#3 \[^\r\n\]* normal_func \\(\\) at "
|
||||
"\\r\\n#4 \[^\r\n\]* inline_func \\(\\) at "
|
||||
"\\r\\n#5 \[^\r\n\]* normal_func \\(\\) at "
|
||||
"\\r\\n#6 \[^\r\n\]* main \\(\\) at "
|
||||
}
|
||||
# Test with and without filters.
|
||||
foreach bt_cmd { "bt" "bt -no-filters" } {
|
||||
with_test_prefix "$bt_cmd" {
|
||||
|
||||
with_test_prefix "cycle at level 5" {
|
||||
# Arrange to introduce a stack cycle at frame 5.
|
||||
gdb_test_no_output "python stop_at_level=5"
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\."
|
||||
gdb_test_lines "bt" "backtrace when the unwind is broken at frame 5" \
|
||||
[multi_line \
|
||||
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"#2 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#3 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"#4 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#5 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
|
||||
}
|
||||
# Check the unbroken stack.
|
||||
gdb_test_sequence "$bt_cmd" "backtrace when the unwind is left unbroken" {
|
||||
"\\r\\n#0 \[^\r\n\]* inline_func \\(\\) at "
|
||||
"\\r\\n#1 \[^\r\n\]* normal_func \\(\\) at "
|
||||
"\\r\\n#2 \[^\r\n\]* inline_func \\(\\) at "
|
||||
"\\r\\n#3 \[^\r\n\]* normal_func \\(\\) at "
|
||||
"\\r\\n#4 \[^\r\n\]* inline_func \\(\\) at "
|
||||
"\\r\\n#5 \[^\r\n\]* normal_func \\(\\) at "
|
||||
"\\r\\n#6 \[^\r\n\]* main \\(\\) at "
|
||||
}
|
||||
|
||||
with_test_prefix "cycle at level 3" {
|
||||
# Arrange to introduce a stack cycle at frame 3.
|
||||
gdb_test_no_output "python stop_at_level=3"
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\."
|
||||
gdb_test_lines "bt" "backtrace when the unwind is broken at frame 3" \
|
||||
[multi_line \
|
||||
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"#2 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#3 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
|
||||
}
|
||||
with_test_prefix "cycle at level 5" {
|
||||
# Arrange to introduce a stack cycle at frame 5.
|
||||
gdb_test_no_output "python stop_at_level=5"
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\."
|
||||
gdb_test_lines "$bt_cmd" "backtrace when the unwind is broken at frame 5" \
|
||||
[multi_line \
|
||||
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"#2 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#3 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"#4 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#5 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
|
||||
}
|
||||
|
||||
with_test_prefix "cycle at level 1" {
|
||||
# Arrange to introduce a stack cycle at frame 1.
|
||||
gdb_test_no_output "python stop_at_level=1"
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\."
|
||||
gdb_test_lines "bt" "backtrace when the unwind is broken at frame 1" \
|
||||
[multi_line \
|
||||
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
|
||||
}
|
||||
with_test_prefix "cycle at level 3" {
|
||||
# Arrange to introduce a stack cycle at frame 3.
|
||||
gdb_test_no_output "python stop_at_level=3"
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\."
|
||||
gdb_test_lines "$bt_cmd" "backtrace when the unwind is broken at frame 3" \
|
||||
[multi_line \
|
||||
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"#2 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#3 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
|
||||
}
|
||||
|
||||
# Flush the register cache (which also flushes the frame cache) so we
|
||||
# get a full backtrace again, then switch on frame debugging and try
|
||||
# to back trace. At one point this triggered an assertion.
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\." ""
|
||||
gdb_test_no_output "set debug frame 1"
|
||||
set ok 1
|
||||
gdb_test_multiple "bt" "backtrace with debugging on" {
|
||||
-re "^$gdb_prompt $" {
|
||||
gdb_assert { $ok } $gdb_test_name
|
||||
}
|
||||
-re "Python Exception <class 'gdb.error'>: \[^\r\n\]*\r\n" {
|
||||
set ok 0
|
||||
exp_continue
|
||||
}
|
||||
-re "\[^\r\n\]+\r\n" {
|
||||
exp_continue
|
||||
with_test_prefix "cycle at level 1" {
|
||||
# Arrange to introduce a stack cycle at frame 1.
|
||||
gdb_test_no_output "python stop_at_level=1"
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\."
|
||||
gdb_test_lines "$bt_cmd" "backtrace when the unwind is broken at frame 1" \
|
||||
[multi_line \
|
||||
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
|
||||
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
|
||||
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
|
||||
}
|
||||
|
||||
# Flush the register cache (which also flushes the frame cache) so we
|
||||
# get a full backtrace again, then switch on frame debugging and try
|
||||
# to back trace. At one point this triggered an assertion.
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\." ""
|
||||
gdb_test_no_output "set debug frame 1"
|
||||
set ok 1
|
||||
gdb_test_multiple "$bt_cmd" "backtrace with debugging on" {
|
||||
-re "^$gdb_prompt $" {
|
||||
gdb_assert { $ok } $gdb_test_name
|
||||
}
|
||||
-re "Python Exception <class 'gdb.error'>: \[^\r\n\]*\r\n" {
|
||||
set ok 0
|
||||
exp_continue
|
||||
}
|
||||
-re "\[^\r\n\]+\r\n" {
|
||||
exp_continue
|
||||
}
|
||||
}
|
||||
gdb_test "p 1 + 2 + 3" " = 6" \
|
||||
"ensure GDB is still alive"
|
||||
|
||||
# Prepare for the next iteration of the test loop
|
||||
gdb_test_no_output "set debug frame 0"
|
||||
gdb_test_no_output "python stop_at_level=None"
|
||||
gdb_test "maint flush register-cache" \
|
||||
"Register cache flushed\\." "maint flush register-cache at (loop end)"
|
||||
}
|
||||
}
|
||||
gdb_test "p 1 + 2 + 3" " = 6" \
|
||||
"ensure GDB is still alive"
|
||||
|
||||
@@ -62,6 +62,18 @@ read_debug_info (struct gdb_reader_funcs *self,
|
||||
(GDB_CORE_ADDR) symfile->function_stack_mangle.end,
|
||||
"jit_function_stack_mangle");
|
||||
|
||||
/* Add some line table information. This ensures that GDB can handle
|
||||
accepting this information, and can scan the table. However, this
|
||||
information is constructed such that none of the tests actually hit any
|
||||
of these line entries. */
|
||||
struct gdb_line_mapping mangle_lines[] =
|
||||
{
|
||||
{ 1, (GDB_CORE_ADDR) symfile->function_stack_mangle.begin + 0 },
|
||||
{ 0, (GDB_CORE_ADDR) symfile->function_stack_mangle.begin + 1 },
|
||||
};
|
||||
int mangle_nlines = sizeof (mangle_lines) / sizeof (mangle_lines[0]);
|
||||
cbs->line_mapping_add (cbs, symtab, mangle_nlines, mangle_lines);
|
||||
|
||||
cbs->block_open (cbs, symtab, NULL,
|
||||
(GDB_CORE_ADDR) symfile->function_add.begin,
|
||||
(GDB_CORE_ADDR) symfile->function_add.end,
|
||||
|
||||
@@ -1162,3 +1162,9 @@ test-thread-apply
|
||||
|
||||
# Basic "info threads" integration tests.
|
||||
test-info-threads
|
||||
|
||||
# There was a bug where the "metasyntactic variable" was glued to the
|
||||
# option.
|
||||
gdb_test "help maintenance test-options unknown-is-operand" \
|
||||
"-string STRING.*-filename FILENAME.*" \
|
||||
"option help has spaces"
|
||||
|
||||
60
gdb/testsuite/gdb.dap/line-zero.exp
Normal file
60
gdb/testsuite/gdb.dap/line-zero.exp
Normal file
@@ -0,0 +1,60 @@
|
||||
# Copyright 2024 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/>.
|
||||
|
||||
# Test breakpoints when lines start at zero.
|
||||
|
||||
require allow_dap_tests
|
||||
|
||||
load_lib dap-support.exp
|
||||
|
||||
standard_testfile basic-dap.c
|
||||
|
||||
if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} {
|
||||
return
|
||||
}
|
||||
|
||||
if {[dap_initialize {linesStartAt1 [l false]}] == ""} {
|
||||
return
|
||||
}
|
||||
|
||||
set launch_id [dap_launch $testfile]
|
||||
|
||||
# We told gdb that lines start at 0, so subtract one.
|
||||
set line [expr {[gdb_get_line_number "BREAK"] - 1}]
|
||||
set obj [dap_check_request_and_response "set breakpoint by line number" \
|
||||
setBreakpoints \
|
||||
[format {o source [o path [%s]] breakpoints [a [o line [i %d]]]} \
|
||||
[list s $srcfile] $line]]
|
||||
set line_bpno [dap_get_breakpoint_number $obj]
|
||||
|
||||
dap_check_request_and_response "configurationDone" configurationDone
|
||||
|
||||
dap_check_response "launch response" launch $launch_id
|
||||
|
||||
dap_wait_for_event_and_check "inferior started" thread "body reason" started
|
||||
|
||||
dap_wait_for_event_and_check "stopped at line breakpoint" stopped \
|
||||
"body reason" breakpoint \
|
||||
"body hitBreakpointIds" $line_bpno \
|
||||
"body allThreadsStopped" true
|
||||
|
||||
set bt [lindex [dap_check_request_and_response "backtrace" stackTrace \
|
||||
{o threadId [i 1]}] \
|
||||
0]
|
||||
set stop_line [dict get [lindex [dict get $bt body stackFrames] 0] line]
|
||||
|
||||
gdb_assert {$stop_line == $line} "stop line is 0-based"
|
||||
|
||||
dap_shutdown
|
||||
62
gdb/testsuite/gdb.dwarf2/nameless-enum.exp
Normal file
62
gdb/testsuite/gdb.dwarf2/nameless-enum.exp
Normal file
@@ -0,0 +1,62 @@
|
||||
# Copyright 2025 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/>.
|
||||
|
||||
# Test a nameless "enum class". This is nonsensical but previously
|
||||
# made gdb crash.
|
||||
|
||||
load_lib dwarf.exp
|
||||
require dwarf2_support
|
||||
|
||||
standard_testfile main.c .S
|
||||
|
||||
set asm_file [standard_output_file $srcfile2]
|
||||
Dwarf::assemble $asm_file {
|
||||
global srcfile
|
||||
|
||||
cu {} {
|
||||
DW_TAG_compile_unit {
|
||||
{DW_AT_language @DW_LANG_D}
|
||||
{DW_AT_name $srcfile}
|
||||
{DW_AT_comp_dir /tmp}
|
||||
} {
|
||||
declare_labels integer_label
|
||||
|
||||
integer_label: DW_TAG_base_type {
|
||||
{DW_AT_byte_size 4 DW_FORM_sdata}
|
||||
{DW_AT_encoding @DW_ATE_signed}
|
||||
{DW_AT_name int}
|
||||
}
|
||||
|
||||
DW_TAG_enumeration_type {
|
||||
{DW_AT_type :$integer_label}
|
||||
{DW_AT_enum_class 1 DW_FORM_flag}
|
||||
} {
|
||||
DW_TAG_enumerator {
|
||||
{DW_AT_name VALUE}
|
||||
{DW_AT_const_value 17 DW_FORM_sdata}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if {[prepare_for_testing "failed to prepare" ${testfile} \
|
||||
[list $srcfile $asm_file] {nodebug}]} {
|
||||
return -1
|
||||
}
|
||||
|
||||
# The bug was a crash, so just do anything here to verify gdb is still
|
||||
# alive.
|
||||
gdb_test "print 23" " = 23"
|
||||
54
gdb/testsuite/gdb.tui/flush-after-run.c
Normal file
54
gdb/testsuite/gdb.tui/flush-after-run.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/* This testcase is part of GDB, the GNU debugger.
|
||||
|
||||
Copyright 2025 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 <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
/* Don't let this test stay alive forever. */
|
||||
alarm (300);
|
||||
|
||||
if (argc != 2)
|
||||
abort ();
|
||||
|
||||
/* Check the file doesn't already exist. */
|
||||
const char *filename = argv[1];
|
||||
struct stat buf;
|
||||
if (stat (filename, &buf) == 0 || errno != ENOENT)
|
||||
abort ();
|
||||
|
||||
/* Create the file, and write something into it. */
|
||||
FILE *out = fopen (filename, "w");
|
||||
if (out == NULL)
|
||||
abort ();
|
||||
|
||||
fprintf (out, "Hello World\n");
|
||||
|
||||
if (fclose (out) != 0)
|
||||
abort ();
|
||||
|
||||
/* Spin until the marker file is deleted. */
|
||||
while (stat (filename, &buf) == 0)
|
||||
sleep (1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
66
gdb/testsuite/gdb.tui/flush-after-run.exp
Normal file
66
gdb/testsuite/gdb.tui/flush-after-run.exp
Normal file
@@ -0,0 +1,66 @@
|
||||
# Copyright 2025 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/>.
|
||||
|
||||
# Check that the 'Starting program' message is correctly flushed to
|
||||
# the TUI terminal as soon as it is available.
|
||||
|
||||
require allow_tui_tests
|
||||
require target_can_use_run_cmd
|
||||
|
||||
tuiterm_env
|
||||
|
||||
standard_testfile
|
||||
|
||||
if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
|
||||
return -1
|
||||
}
|
||||
|
||||
Term::clean_restart 24 80 $testfile
|
||||
|
||||
if {![Term::enter_tui]} {
|
||||
unsupported "TUI not supported"
|
||||
return
|
||||
}
|
||||
|
||||
# Pick a name for a marker file, and ensure it doesn't exist.
|
||||
set marker_file [standard_output_file "marker"]
|
||||
file delete $marker_file
|
||||
|
||||
# Run the inferior, which will create MARKER_FILE.
|
||||
send_gdb "run \"$marker_file\"\n"
|
||||
|
||||
# Spin until MARKER_FILE appears.
|
||||
while { ! [file exists $marker_file] } {
|
||||
sleep 1
|
||||
}
|
||||
|
||||
# We now know that the inferior has started, and that the 'Starting
|
||||
# program: ' string should have been printed to the terminal. Don't
|
||||
# use Term::wait_for here as there will be no prompt after the
|
||||
# 'Starting program' message.
|
||||
gdb_assert {[Term::wait_for_region_contents 0 16 80 7 "Starting program: "]} \
|
||||
"starting program message has appeared"
|
||||
|
||||
# Delete MARKER_FILE. This will cause the inferior to exit.
|
||||
file delete $marker_file
|
||||
|
||||
# Now wait for the prompt, and check that the inferior exited message
|
||||
# appeared.
|
||||
gdb_assert {[Term::wait_for ""]} \
|
||||
"wait for prompt after inferior exits"
|
||||
Term::check_region_contents \
|
||||
"check for inferior exited message" \
|
||||
0 16 80 8 \
|
||||
"\\\[Inferior $decimal \[^\r\n\]+ exited normally\\\]"
|
||||
@@ -101,3 +101,6 @@ Term::command "finish"
|
||||
Term::check_box_contents "check source box is empty after return" \
|
||||
0 0 80 15 "No Source Available"
|
||||
Term::check_contents "Back in main" "Value returned is .* 13"
|
||||
|
||||
Term::resize 30 100
|
||||
Term::check_box "source box after resize" 0 0 100 19
|
||||
|
||||
@@ -272,16 +272,19 @@ proc dap_check_request_and_response {name command {obj {}}} {
|
||||
# Start gdb, send a DAP initialization request and return the
|
||||
# response. This approach lets the caller check the feature list, if
|
||||
# desired. Returns the empty string on failure. NAME is used as the
|
||||
# test name.
|
||||
proc dap_initialize {{name "initialize"}} {
|
||||
# test name. EXTRA are other settings to pass via the "initialize"
|
||||
# request.
|
||||
proc dap_initialize {{name "initialize"} {extra ""}} {
|
||||
if {[dap_gdb_start]} {
|
||||
return ""
|
||||
}
|
||||
return [dap_check_request_and_response $name initialize \
|
||||
{o clientID [s "gdb testsuite"] \
|
||||
supportsVariableType [l true] \
|
||||
supportsVariablePaging [l true] \
|
||||
supportsMemoryReferences [l true]}]
|
||||
[format {o clientID [s "gdb testsuite"] \
|
||||
supportsVariableType [l true] \
|
||||
supportsVariablePaging [l true] \
|
||||
supportsMemoryReferences [l true] \
|
||||
%s} \
|
||||
$extra]]
|
||||
}
|
||||
|
||||
# Send a launch request specifying FILE as the program to use for the
|
||||
|
||||
@@ -56,7 +56,12 @@ void
|
||||
tui_win_info::refresh_window ()
|
||||
{
|
||||
if (handle != NULL)
|
||||
wnoutrefresh (handle.get ());
|
||||
{
|
||||
if (suppress_output)
|
||||
wnoutrefresh (handle.get ());
|
||||
else
|
||||
wrefresh (handle.get ());
|
||||
}
|
||||
}
|
||||
|
||||
/* Draw a border around the window. */
|
||||
|
||||
@@ -314,6 +314,9 @@ tui_source_window_base::refresh_window ()
|
||||
the screen, potentially creating a flicker. */
|
||||
wnoutrefresh (handle.get ());
|
||||
|
||||
if (m_content.empty ())
|
||||
return;
|
||||
|
||||
int pad_width = getmaxx (m_pad.get ());
|
||||
int left_margin = this->left_margin ();
|
||||
int view_width = this->view_width ();
|
||||
|
||||
@@ -315,9 +315,11 @@ ui_file_style::parse (const char *buf, size_t *n_read)
|
||||
case 35:
|
||||
case 36:
|
||||
case 37:
|
||||
m_foreground = color (value - 30);
|
||||
break;
|
||||
/* Note: not 38. */
|
||||
case 39:
|
||||
m_foreground = color (value - 30);
|
||||
m_foreground = NONE;
|
||||
break;
|
||||
|
||||
case 40:
|
||||
@@ -328,9 +330,11 @@ ui_file_style::parse (const char *buf, size_t *n_read)
|
||||
case 45:
|
||||
case 46:
|
||||
case 47:
|
||||
m_background = color (value - 40);
|
||||
break;
|
||||
/* Note: not 48. */
|
||||
case 49:
|
||||
m_background = color (value - 40);
|
||||
m_background = NONE;
|
||||
break;
|
||||
|
||||
case 90:
|
||||
|
||||
@@ -1 +1 @@
|
||||
16.0.50.DATE-git
|
||||
16.3
|
||||
|
||||
@@ -3114,9 +3114,9 @@ _initialize_windows_nat ()
|
||||
|
||||
add_com ("signal-event", class_run, signal_event_command, _("\
|
||||
Signal a crashed process with event ID, to allow its debugging.\n\
|
||||
This command is needed in support of setting up GDB as JIT debugger on \
|
||||
MS-Windows. The command should be invoked from the GDB command line using \
|
||||
the '-ex' command-line option. The ID of the event that blocks the \
|
||||
This command is needed in support of setting up GDB as JIT debugger on\n\
|
||||
MS-Windows. The command should be invoked from the GDB command line using\n\
|
||||
the '-ex' command-line option. The ID of the event that blocks the\n\
|
||||
crashed process will be supplied by the Windows JIT debugging mechanism."));
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
|
||||
@@ -623,7 +623,7 @@ mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
|
||||
&priv->watch_mirror);
|
||||
|
||||
/* Only update the threads of this process. */
|
||||
proc->for_each_thread (pid, update_watch_registers_callback);
|
||||
proc->for_each_thread (update_watch_registers_callback);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ regcache::raw_compare (int regnum, const void *buf, int offset) const
|
||||
gdb_assert (buf != NULL);
|
||||
|
||||
gdb::array_view<const gdb_byte> regbuf = register_data (this, regnum);
|
||||
gdb_assert (offset < regbuf.size ());
|
||||
gdb_assert (offset <= regbuf.size ());
|
||||
regbuf = regbuf.slice (offset);
|
||||
|
||||
return memcmp (buf, regbuf.data (), regbuf.size ()) == 0;
|
||||
|
||||
@@ -2777,7 +2777,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
|
||||
"PacketSize=%x;QPassSignals+;QProgramSignals+;"
|
||||
"QStartupWithShell+;QEnvironmentHexEncoded+;"
|
||||
"QEnvironmentReset+;QEnvironmentUnset+;"
|
||||
"QSetWorkingDir+",
|
||||
"QSetWorkingDir+;binary-upload+",
|
||||
PBUFSIZ - 1);
|
||||
|
||||
if (target_supports_catch_syscall ())
|
||||
@@ -4092,6 +4092,38 @@ test_memory_tagging_functions (void)
|
||||
&& tags.size () == 5);
|
||||
}
|
||||
|
||||
/* Exercise the behavior of doing a 0-length comparison for a register in a
|
||||
register buffer, which should return true. */
|
||||
|
||||
static void test_registers_raw_compare_zero_length ()
|
||||
{
|
||||
/* Start off with a dummy target description. */
|
||||
target_desc dummy_tdesc;
|
||||
|
||||
/* Make it 8 bytes long. */
|
||||
dummy_tdesc.registers_size = 8;
|
||||
|
||||
/* Add a couple dummy 32-bit registers. */
|
||||
dummy_tdesc.reg_defs.emplace_back ("r0", 0, 32);
|
||||
dummy_tdesc.reg_defs.emplace_back ("r1", 32, 32);
|
||||
|
||||
/* Create a dummy buffer that will serve as the register buffer for our
|
||||
dummy regcache. */
|
||||
gdb_byte dummy_register_buffer[8];
|
||||
|
||||
/* Create our dummy register cache so we can invoke the raw_compare method
|
||||
we want to validate. */
|
||||
regcache dummy_regcache;
|
||||
init_register_cache (&dummy_regcache, &dummy_tdesc, dummy_register_buffer);
|
||||
|
||||
/* Create a dummy byte buffer we can pass to the raw_compare method. */
|
||||
gdb_byte dummy_buffer[8];
|
||||
|
||||
/* Validate the 0-length comparison (due to the comparison offset being
|
||||
equal to the length of the register) returns true. */
|
||||
SELF_CHECK (dummy_regcache.raw_compare (0, dummy_buffer, 4));
|
||||
}
|
||||
|
||||
} // namespace selftests
|
||||
#endif /* GDB_SELF_TEST */
|
||||
|
||||
@@ -4115,6 +4147,8 @@ captured_main (int argc, char *argv[])
|
||||
|
||||
selftests::register_test ("remote_memory_tagging",
|
||||
selftests::test_memory_tagging_functions);
|
||||
selftests::register_test ("test_registers_raw_compare_zero_length",
|
||||
selftests::test_registers_raw_compare_zero_length);
|
||||
#endif
|
||||
|
||||
current_directory = getcwd (NULL, 0);
|
||||
|
||||
@@ -151,6 +151,14 @@ win32_isatty (int fd)
|
||||
# define RL_TIMEOUT_USE_SELECT
|
||||
#else
|
||||
# define RL_TIMEOUT_USE_SIGALRM
|
||||
# ifdef __MINGW32_MAJOR_VERSION
|
||||
/* mingw.org's MinGW doesn't have 'alarm'. */
|
||||
unsigned int
|
||||
alarm (unsigned int seconds)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int rl_set_timeout (unsigned int, unsigned int);
|
||||
|
||||
Reference in New Issue
Block a user