forked from Imagelibrary/binutils-gdb
Compare commits
39 Commits
azanella/p
...
gdb-16.1-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
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
|
||||
|
||||
@@ -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 20250118
|
||||
#define BFD_VERSION @bfd_version@
|
||||
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
|
||||
#define REPORT_BUGS_TO @report_bugs_to@
|
||||
|
||||
2
gdb/NEWS
2
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.
|
||||
|
||||
@@ -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,27 +1169,22 @@ 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
|
||||
{
|
||||
|
||||
@@ -16809,6 +16809,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ""
|
||||
|
||||
@@ -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"
|
||||
@@ -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
|
||||
|
||||
@@ -1 +1 @@
|
||||
16.0.50.DATE-git
|
||||
16.1
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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