forked from Imagelibrary/binutils-gdb
Compare commits
11 Commits
users/sima
...
users/lsix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c98824eb67 | ||
|
|
8ee7518997 | ||
|
|
d50638ee66 | ||
|
|
0aafa7e13b | ||
|
|
c59f8e81dc | ||
|
|
ce752f43cc | ||
|
|
54c3b56559 | ||
|
|
f795c529a8 | ||
|
|
e7b38ccb82 | ||
|
|
a6b89d38e2 | ||
|
|
738a7fe01e |
@@ -469,7 +469,6 @@ SELFTESTS_SRCS = \
|
||||
unittests/memrange-selftests.c \
|
||||
unittests/offset-type-selftests.c \
|
||||
unittests/observable-selftests.c \
|
||||
unittests/optional-selftests.c \
|
||||
unittests/packed-selftests.c \
|
||||
unittests/parallel-for-selftests.c \
|
||||
unittests/parse-connection-spec-selftests.c \
|
||||
@@ -483,7 +482,6 @@ SELFTESTS_SRCS = \
|
||||
unittests/scoped_mmap-selftests.c \
|
||||
unittests/scoped_restore-selftests.c \
|
||||
unittests/search-memory-selftests.c \
|
||||
unittests/string_view-selftests.c \
|
||||
unittests/style-selftests.c \
|
||||
unittests/tracepoint-selftests.c \
|
||||
unittests/tui-selftests.c \
|
||||
|
||||
3
gdb/NEWS
3
gdb/NEWS
@@ -3,6 +3,9 @@
|
||||
|
||||
*** Changes since GDB 14
|
||||
|
||||
* Building GDB and GDBserver now requires a C++17 compiler.
|
||||
For example, GCC 9 or later.
|
||||
|
||||
* GDB index now contains information about the main function. This speeds up
|
||||
startup when it is being used for some large binaries.
|
||||
|
||||
|
||||
@@ -1609,7 +1609,7 @@ static const struct target_desc *
|
||||
aarch64_linux_core_read_description (struct gdbarch *gdbarch,
|
||||
struct target_ops *target, bfd *abfd)
|
||||
{
|
||||
gdb::optional<gdb::byte_vector> auxv = target_read_auxv_raw (target);
|
||||
std::optional<gdb::byte_vector> auxv = target_read_auxv_raw (target);
|
||||
CORE_ADDR hwcap = linux_get_hwcap (auxv, target, gdbarch);
|
||||
CORE_ADDR hwcap2 = linux_get_hwcap2 (auxv, target, gdbarch);
|
||||
|
||||
@@ -2427,7 +2427,7 @@ aarch64_linux_gcc_target_options (struct gdbarch *gdbarch)
|
||||
|
||||
Return the allocation tag if successful and nullopt otherwise. */
|
||||
|
||||
static gdb::optional<CORE_ADDR>
|
||||
static std::optional<CORE_ADDR>
|
||||
aarch64_mte_get_atag (CORE_ADDR address)
|
||||
{
|
||||
gdb::byte_vector tags;
|
||||
@@ -2481,7 +2481,7 @@ aarch64_linux_memtag_matches_p (struct gdbarch *gdbarch,
|
||||
CORE_ADDR addr = value_as_address (address);
|
||||
|
||||
/* Fetch the allocation tag for ADDRESS. */
|
||||
gdb::optional<CORE_ADDR> atag
|
||||
std::optional<CORE_ADDR> atag
|
||||
= aarch64_mte_get_atag (gdbarch_remove_non_address_bits (gdbarch, addr));
|
||||
|
||||
if (!atag.has_value ())
|
||||
@@ -2579,7 +2579,7 @@ aarch64_linux_get_memtag (struct gdbarch *gdbarch, struct value *address,
|
||||
|
||||
/* Remove the top byte. */
|
||||
addr = gdbarch_remove_non_address_bits (gdbarch, addr);
|
||||
gdb::optional<CORE_ADDR> atag = aarch64_mte_get_atag (addr);
|
||||
std::optional<CORE_ADDR> atag = aarch64_mte_get_atag (addr);
|
||||
|
||||
if (!atag.has_value ())
|
||||
return nullptr;
|
||||
@@ -2651,7 +2651,7 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch,
|
||||
uiout->field_core_addr ("fault-addr", gdbarch, fault_addr);
|
||||
uiout->text ("\n");
|
||||
|
||||
gdb::optional<CORE_ADDR> atag
|
||||
std::optional<CORE_ADDR> atag
|
||||
= aarch64_mte_get_atag (gdbarch_remove_non_address_bits (gdbarch,
|
||||
fault_addr));
|
||||
gdb_byte ltag = aarch64_mte_get_ltag (fault_addr);
|
||||
|
||||
@@ -1035,12 +1035,12 @@ find_case_fold_entry (uint32_t c)
|
||||
rather than emitting a warning. Result good to next call. */
|
||||
|
||||
static const char *
|
||||
ada_fold_name (gdb::string_view name, bool throw_on_error = false)
|
||||
ada_fold_name (std::string_view name, bool throw_on_error = false)
|
||||
{
|
||||
static std::string fold_storage;
|
||||
|
||||
if (!name.empty () && name[0] == '\'')
|
||||
fold_storage = gdb::to_string (name.substr (1, name.size () - 2));
|
||||
fold_storage = name.substr (1, name.size () - 2);
|
||||
else
|
||||
{
|
||||
/* Why convert to UTF-32 and implement our own case-folding,
|
||||
@@ -1081,12 +1081,12 @@ ada_fold_name (gdb::string_view name, bool throw_on_error = false)
|
||||
warned = true;
|
||||
warning (_("could not convert '%s' from the host encoding (%s) to UTF-32.\n"
|
||||
"This normally should not happen, please file a bug report."),
|
||||
gdb::to_string (name).c_str (), host_charset ());
|
||||
std::string (name).c_str (), host_charset ());
|
||||
}
|
||||
|
||||
/* We don't try to recover from errors; just return the
|
||||
original string. */
|
||||
fold_storage = gdb::to_string (name);
|
||||
fold_storage = name;
|
||||
return fold_storage.c_str ();
|
||||
}
|
||||
|
||||
@@ -1135,12 +1135,12 @@ ada_fold_name (gdb::string_view name, bool throw_on_error = false)
|
||||
warned = true;
|
||||
warning (_("could not convert the lower-cased variant of '%s'\n"
|
||||
"from UTF-32 to the host encoding (%s)."),
|
||||
gdb::to_string (name).c_str (), host_charset ());
|
||||
std::string (name).c_str (), host_charset ());
|
||||
}
|
||||
|
||||
/* We don't try to recover from errors; just return the
|
||||
original string. */
|
||||
fold_storage = gdb::to_string (name);
|
||||
fold_storage = name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3098,7 +3098,7 @@ ada_value_slice_from_ptr (struct value *array_ptr, struct type *type,
|
||||
type0->dyn_prop (DYN_PROP_BYTE_STRIDE),
|
||||
type0->field (0).bitsize ());
|
||||
int base_low = ada_discrete_type_low_bound (type0->index_type ());
|
||||
gdb::optional<LONGEST> base_low_pos, low_pos;
|
||||
std::optional<LONGEST> base_low_pos, low_pos;
|
||||
CORE_ADDR base;
|
||||
|
||||
low_pos = discrete_position (base_index_type, low);
|
||||
@@ -3132,7 +3132,7 @@ ada_value_slice (struct value *array, int low, int high)
|
||||
(alloc, type->target_type (), index_type,
|
||||
type->dyn_prop (DYN_PROP_BYTE_STRIDE),
|
||||
type->field (0).bitsize ());
|
||||
gdb::optional<LONGEST> low_pos, high_pos;
|
||||
std::optional<LONGEST> low_pos, high_pos;
|
||||
|
||||
|
||||
low_pos = discrete_position (base_index_type, low);
|
||||
@@ -8792,7 +8792,7 @@ pos_atr (struct value *arg)
|
||||
if (!discrete_type_p (type))
|
||||
error (_("'POS only defined on discrete types"));
|
||||
|
||||
gdb::optional<LONGEST> result = discrete_position (type, value_as_long (val));
|
||||
std::optional<LONGEST> result = discrete_position (type, value_as_long (val));
|
||||
if (!result.has_value ())
|
||||
error (_("enumeration value is invalid: can't find 'POS"));
|
||||
|
||||
@@ -13250,16 +13250,14 @@ do_exact_match (const char *symbol_search_name,
|
||||
|
||||
ada_lookup_name_info::ada_lookup_name_info (const lookup_name_info &lookup_name)
|
||||
{
|
||||
gdb::string_view user_name = lookup_name.name ();
|
||||
std::string_view user_name = lookup_name.name ();
|
||||
|
||||
if (!user_name.empty () && user_name[0] == '<')
|
||||
{
|
||||
if (user_name.back () == '>')
|
||||
m_encoded_name
|
||||
= gdb::to_string (user_name.substr (1, user_name.size () - 2));
|
||||
m_encoded_name = user_name.substr (1, user_name.size () - 2);
|
||||
else
|
||||
m_encoded_name
|
||||
= gdb::to_string (user_name.substr (1, user_name.size () - 1));
|
||||
m_encoded_name = user_name.substr (1, user_name.size () - 1);
|
||||
m_encoded_p = true;
|
||||
m_verbatim_p = true;
|
||||
m_wild_match_p = false;
|
||||
@@ -13269,17 +13267,17 @@ ada_lookup_name_info::ada_lookup_name_info (const lookup_name_info &lookup_name)
|
||||
{
|
||||
m_verbatim_p = false;
|
||||
|
||||
m_encoded_p = user_name.find ("__") != gdb::string_view::npos;
|
||||
m_encoded_p = user_name.find ("__") != std::string_view::npos;
|
||||
|
||||
if (!m_encoded_p)
|
||||
{
|
||||
const char *folded = ada_fold_name (user_name);
|
||||
m_encoded_name = ada_encode_1 (folded, false);
|
||||
if (m_encoded_name.empty ())
|
||||
m_encoded_name = gdb::to_string (user_name);
|
||||
m_encoded_name = user_name;
|
||||
}
|
||||
else
|
||||
m_encoded_name = gdb::to_string (user_name);
|
||||
m_encoded_name = user_name;
|
||||
|
||||
/* Handle the 'package Standard' special case. See description
|
||||
of m_standard_p. */
|
||||
@@ -13326,7 +13324,7 @@ literal_symbol_name_matcher (const char *symbol_search_name,
|
||||
const lookup_name_info &lookup_name,
|
||||
completion_match_result *comp_match_res)
|
||||
{
|
||||
gdb::string_view name_view = lookup_name.name ();
|
||||
std::string_view name_view = lookup_name.name ();
|
||||
|
||||
if (lookup_name.completion_mode ()
|
||||
? (strncmp (symbol_search_name, name_view.data (),
|
||||
|
||||
@@ -713,7 +713,7 @@ processAttribute (const char *str)
|
||||
if (strcasecmp (str, item.name) == 0)
|
||||
return item.code;
|
||||
|
||||
gdb::optional<int> found;
|
||||
std::optional<int> found;
|
||||
for (const auto &item : attributes)
|
||||
if (subseqMatch (str, item.name))
|
||||
{
|
||||
|
||||
@@ -385,7 +385,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
|
||||
|
||||
case TYPE_CODE_ENUM:
|
||||
{
|
||||
gdb::optional<LONGEST> posn = discrete_position (type, val);
|
||||
std::optional<LONGEST> posn = discrete_position (type, val);
|
||||
if (posn.has_value ())
|
||||
fputs_styled (ada_enum_name (type->field (*posn).name ()),
|
||||
variable_name_style.style (), stream);
|
||||
@@ -827,7 +827,7 @@ ada_val_print_enum (struct value *value, struct ui_file *stream, int recurse,
|
||||
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
|
||||
|
||||
val = unpack_long (type, valaddr + offset_aligned);
|
||||
gdb::optional<LONGEST> posn = discrete_position (type, val);
|
||||
std::optional<LONGEST> posn = discrete_position (type, val);
|
||||
if (posn.has_value ())
|
||||
{
|
||||
const char *name = ada_enum_name (type->field (*posn).name ());
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "gdbsupport/gdb_obstack.h"
|
||||
#include "addrmap.h"
|
||||
#include "gdbsupport/selftest.h"
|
||||
#include <memory>
|
||||
|
||||
/* Make sure splay trees can actually hold the values we want to
|
||||
store in them. */
|
||||
@@ -428,7 +429,7 @@ test_addrmap ()
|
||||
|
||||
/* Create mutable addrmap. */
|
||||
auto_obstack temp_obstack;
|
||||
auto map = gdb::make_unique<struct addrmap_mutable> ();
|
||||
auto map = std::make_unique<struct addrmap_mutable> ();
|
||||
SELF_CHECK (map != nullptr);
|
||||
|
||||
/* Check initial state. */
|
||||
|
||||
@@ -528,7 +528,7 @@ amd_dbgapi_target::xfer_partial (enum target_object object, const char *annex,
|
||||
ULONGEST offset, ULONGEST requested_len,
|
||||
ULONGEST *xfered_len)
|
||||
{
|
||||
gdb::optional<scoped_restore_current_thread> maybe_restore_thread;
|
||||
std::optional<scoped_restore_current_thread> maybe_restore_thread;
|
||||
|
||||
if (!ptid_is_gpu (inferior_ptid))
|
||||
return beneath ()->xfer_partial (object, annex, readbuf, writebuf, offset,
|
||||
@@ -1901,7 +1901,7 @@ static void
|
||||
amd_dbgapi_log_message_callback (amd_dbgapi_log_level_t level,
|
||||
const char *message)
|
||||
{
|
||||
gdb::optional<target_terminal::scoped_restore_terminal_state> tstate;
|
||||
std::optional<target_terminal::scoped_restore_terminal_state> tstate;
|
||||
|
||||
if (target_supports_terminal_ours ())
|
||||
{
|
||||
|
||||
@@ -237,7 +237,7 @@ struct amd_dbgapi_register_type_flags : public amd_dbgapi_register_type
|
||||
using container_type = std::vector<field>;
|
||||
using const_iterator_type = container_type::const_iterator;
|
||||
|
||||
amd_dbgapi_register_type_flags (unsigned int bit_size, gdb::string_view name)
|
||||
amd_dbgapi_register_type_flags (unsigned int bit_size, std::string_view name)
|
||||
: amd_dbgapi_register_type (kind::FLAGS,
|
||||
make_lookup_name (bit_size, name)),
|
||||
m_bit_size (bit_size),
|
||||
@@ -270,7 +270,7 @@ struct amd_dbgapi_register_type_flags : public amd_dbgapi_register_type
|
||||
const std::string &name () const
|
||||
{ return m_name; }
|
||||
|
||||
static std::string make_lookup_name (int bits, gdb::string_view name)
|
||||
static std::string make_lookup_name (int bits, std::string_view name)
|
||||
{
|
||||
std::string res = string_printf ("flags%d_t ", bits);
|
||||
res.append (name.data (), name.size ());
|
||||
@@ -297,7 +297,7 @@ struct amd_dbgapi_register_type_enum : public amd_dbgapi_register_type
|
||||
using container_type = std::vector<enumerator>;
|
||||
using const_iterator_type = container_type::const_iterator;
|
||||
|
||||
amd_dbgapi_register_type_enum (gdb::string_view name)
|
||||
amd_dbgapi_register_type_enum (std::string_view name)
|
||||
: amd_dbgapi_register_type (kind::ENUM, make_lookup_name (name)),
|
||||
m_name (name.data (), name.length ())
|
||||
{}
|
||||
@@ -326,7 +326,7 @@ struct amd_dbgapi_register_type_enum : public amd_dbgapi_register_type
|
||||
const std::string &name () const
|
||||
{ return m_name; }
|
||||
|
||||
static std::string make_lookup_name (gdb::string_view name)
|
||||
static std::string make_lookup_name (std::string_view name)
|
||||
{
|
||||
std::string res = "enum ";
|
||||
res.append (name.data (), name.length ());
|
||||
@@ -349,7 +349,7 @@ using amd_dbgapi_register_type_map
|
||||
/* Parse S as a ULONGEST, raise an error on overflow. */
|
||||
|
||||
static ULONGEST
|
||||
try_strtoulst (gdb::string_view s)
|
||||
try_strtoulst (std::string_view s)
|
||||
{
|
||||
errno = 0;
|
||||
ULONGEST value = strtoulst (s.data (), nullptr, 0);
|
||||
@@ -365,7 +365,7 @@ try_strtoulst (gdb::string_view s)
|
||||
#define WSOPT "[ \t]*"
|
||||
|
||||
static const amd_dbgapi_register_type &
|
||||
parse_amd_dbgapi_register_type (gdb::string_view type_name,
|
||||
parse_amd_dbgapi_register_type (std::string_view type_name,
|
||||
amd_dbgapi_register_type_map &type_map);
|
||||
|
||||
|
||||
@@ -373,7 +373,7 @@ parse_amd_dbgapi_register_type (gdb::string_view type_name,
|
||||
|
||||
static void
|
||||
parse_amd_dbgapi_register_type_enum_fields
|
||||
(amd_dbgapi_register_type_enum &enum_type, gdb::string_view fields)
|
||||
(amd_dbgapi_register_type_enum &enum_type, std::string_view fields)
|
||||
{
|
||||
compiled_regex regex (/* name */
|
||||
"^(" IDENTIFIER ")"
|
||||
@@ -394,14 +394,14 @@ parse_amd_dbgapi_register_type_enum_fields
|
||||
auto sv_from_match = [fields] (const regmatch_t &m)
|
||||
{ return fields.substr (m.rm_so, m.rm_eo - m.rm_so); };
|
||||
|
||||
gdb::string_view name = sv_from_match (matches[1]);
|
||||
gdb::string_view value_str = sv_from_match (matches[2]);
|
||||
std::string_view name = sv_from_match (matches[1]);
|
||||
std::string_view value_str = sv_from_match (matches[2]);
|
||||
ULONGEST value = try_strtoulst (value_str);
|
||||
|
||||
if (value > std::numeric_limits<uint32_t>::max ())
|
||||
enum_type.set_bit_size (64);
|
||||
|
||||
enum_type.add_enumerator (gdb::to_string (name), value);
|
||||
enum_type.add_enumerator (std::string (name), value);
|
||||
|
||||
fields = fields.substr (matches[0].rm_eo);
|
||||
}
|
||||
@@ -412,7 +412,7 @@ parse_amd_dbgapi_register_type_enum_fields
|
||||
static void
|
||||
parse_amd_dbgapi_register_type_flags_fields
|
||||
(amd_dbgapi_register_type_flags &flags_type,
|
||||
int bits, gdb::string_view name, gdb::string_view fields,
|
||||
int bits, std::string_view name, std::string_view fields,
|
||||
amd_dbgapi_register_type_map &type_map)
|
||||
{
|
||||
gdb_assert (bits == 32 || bits == 64);
|
||||
@@ -439,24 +439,24 @@ parse_amd_dbgapi_register_type_flags_fields
|
||||
auto sv_from_match = [fields] (const regmatch_t &m)
|
||||
{ return fields.substr (m.rm_so, m.rm_eo - m.rm_so); };
|
||||
|
||||
gdb::string_view field_type_str = sv_from_match (matches[1]);
|
||||
gdb::string_view field_name = sv_from_match (matches[3]);
|
||||
gdb::string_view pos_begin_str = sv_from_match (matches[4]);
|
||||
std::string_view field_type_str = sv_from_match (matches[1]);
|
||||
std::string_view field_name = sv_from_match (matches[3]);
|
||||
std::string_view pos_begin_str = sv_from_match (matches[4]);
|
||||
ULONGEST pos_begin = try_strtoulst (pos_begin_str);
|
||||
|
||||
if (field_type_str == "bool")
|
||||
flags_type.add_field (gdb::to_string (field_name), pos_begin, pos_begin,
|
||||
flags_type.add_field (std::string (field_name), pos_begin, pos_begin,
|
||||
nullptr);
|
||||
else
|
||||
{
|
||||
if (matches[5].rm_so == -1)
|
||||
error (_("Missing end bit position"));
|
||||
|
||||
gdb::string_view pos_end_str = sv_from_match (matches[5]);
|
||||
std::string_view pos_end_str = sv_from_match (matches[5]);
|
||||
ULONGEST pos_end = try_strtoulst (pos_end_str.substr (1));
|
||||
const amd_dbgapi_register_type &field_type
|
||||
= parse_amd_dbgapi_register_type (field_type_str, type_map);
|
||||
flags_type.add_field (gdb::to_string (field_name), pos_begin, pos_end,
|
||||
flags_type.add_field (std::string (field_name), pos_begin, pos_end,
|
||||
&field_type);
|
||||
}
|
||||
|
||||
@@ -467,10 +467,10 @@ parse_amd_dbgapi_register_type_flags_fields
|
||||
/* parse_amd_dbgapi_register_type helper for scalars. */
|
||||
|
||||
static const amd_dbgapi_register_type &
|
||||
parse_amd_dbgapi_register_type_scalar (gdb::string_view name,
|
||||
parse_amd_dbgapi_register_type_scalar (std::string_view name,
|
||||
amd_dbgapi_register_type_map &type_map)
|
||||
{
|
||||
std::string name_str = gdb::to_string (name);
|
||||
std::string name_str (name);
|
||||
auto it = type_map.find (name_str);
|
||||
if (it != type_map.end ())
|
||||
{
|
||||
@@ -513,27 +513,27 @@ parse_amd_dbgapi_register_type_scalar (gdb::string_view name,
|
||||
details about the format. */
|
||||
|
||||
static const amd_dbgapi_register_type &
|
||||
parse_amd_dbgapi_register_type (gdb::string_view type_str,
|
||||
parse_amd_dbgapi_register_type (std::string_view type_str,
|
||||
amd_dbgapi_register_type_map &type_map)
|
||||
{
|
||||
size_t pos_open_bracket = type_str.find_last_of ('[');
|
||||
auto sv_from_match = [type_str] (const regmatch_t &m)
|
||||
{ return type_str.substr (m.rm_so, m.rm_eo - m.rm_so); };
|
||||
|
||||
if (pos_open_bracket != gdb::string_view::npos)
|
||||
if (pos_open_bracket != std::string_view::npos)
|
||||
{
|
||||
/* Vector types. */
|
||||
gdb::string_view element_type_str
|
||||
std::string_view element_type_str
|
||||
= type_str.substr (0, pos_open_bracket);
|
||||
const amd_dbgapi_register_type &element_type
|
||||
= parse_amd_dbgapi_register_type (element_type_str, type_map);
|
||||
|
||||
size_t pos_close_bracket = type_str.find_last_of (']');
|
||||
gdb_assert (pos_close_bracket != gdb::string_view::npos);
|
||||
gdb::string_view count_str_view
|
||||
gdb_assert (pos_close_bracket != std::string_view::npos);
|
||||
std::string_view count_str_view
|
||||
= type_str.substr (pos_open_bracket + 1,
|
||||
pos_close_bracket - pos_open_bracket);
|
||||
std::string count_str = gdb::to_string (count_str_view);
|
||||
std::string count_str (count_str_view);
|
||||
unsigned int count = std::stoul (count_str);
|
||||
|
||||
std::string lookup_name
|
||||
@@ -567,9 +567,9 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str,
|
||||
if (res == REG_NOMATCH)
|
||||
error (_("Failed to parse flags type string"));
|
||||
|
||||
gdb::string_view flags_keyword = sv_from_match (matches[1]);
|
||||
std::string_view flags_keyword = sv_from_match (matches[1]);
|
||||
unsigned int bit_size = flags_keyword == "flags32_t" ? 32 : 64;
|
||||
gdb::string_view name = sv_from_match (matches[2]);
|
||||
std::string_view name = sv_from_match (matches[2]);
|
||||
std::string lookup_name
|
||||
= amd_dbgapi_register_type_flags::make_lookup_name (bit_size, name);
|
||||
auto existing_type_it = type_map.find (lookup_name);
|
||||
@@ -579,7 +579,7 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str,
|
||||
/* No braces, lookup existing type. */
|
||||
if (existing_type_it == type_map.end ())
|
||||
error (_("reference to unknown type %s."),
|
||||
gdb::to_string (name).c_str ());
|
||||
std::string (name).c_str ());
|
||||
|
||||
if (existing_type_it->second->kind ()
|
||||
!= amd_dbgapi_register_type::kind::FLAGS)
|
||||
@@ -592,11 +592,11 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str,
|
||||
/* With braces, it's a definition. */
|
||||
if (existing_type_it != type_map.end ())
|
||||
error (_("re-definition of type %s."),
|
||||
gdb::to_string (name).c_str ());
|
||||
std::string (name).c_str ());
|
||||
|
||||
amd_dbgapi_register_type_flags_up flags_type
|
||||
(new amd_dbgapi_register_type_flags (bit_size, name));
|
||||
gdb::string_view fields_without_braces = sv_from_match (matches[4]);
|
||||
std::string_view fields_without_braces = sv_from_match (matches[4]);
|
||||
|
||||
parse_amd_dbgapi_register_type_flags_fields
|
||||
(*flags_type, bit_size, name, fields_without_braces, type_map);
|
||||
@@ -620,7 +620,7 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str,
|
||||
if (res == REG_NOMATCH)
|
||||
error (_("Failed to parse flags type string"));
|
||||
|
||||
gdb::string_view name = sv_from_match (matches[1]);
|
||||
std::string_view name = sv_from_match (matches[1]);
|
||||
|
||||
std::string lookup_name
|
||||
= amd_dbgapi_register_type_enum::make_lookup_name (name);
|
||||
@@ -631,7 +631,7 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str,
|
||||
/* No braces, lookup existing type. */
|
||||
if (existing_type_it == type_map.end ())
|
||||
error (_("reference to unknown type %s"),
|
||||
gdb::to_string (name).c_str ());
|
||||
std::string (name).c_str ());
|
||||
|
||||
if (existing_type_it->second->kind ()
|
||||
!= amd_dbgapi_register_type::kind::ENUM)
|
||||
@@ -644,11 +644,11 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str,
|
||||
/* With braces, it's a definition. */
|
||||
if (existing_type_it != type_map.end ())
|
||||
error (_("re-definition of type %s"),
|
||||
gdb::to_string (name).c_str ());
|
||||
std::string (name).c_str ());
|
||||
|
||||
amd_dbgapi_register_type_enum_up enum_type
|
||||
(new amd_dbgapi_register_type_enum (name));
|
||||
gdb::string_view fields_without_braces = sv_from_match (matches[3]);
|
||||
std::string_view fields_without_braces = sv_from_match (matches[3]);
|
||||
|
||||
parse_amd_dbgapi_register_type_enum_fields
|
||||
(*enum_type, fields_without_braces);
|
||||
|
||||
@@ -233,7 +233,7 @@ annotate_thread_changed (void)
|
||||
|
||||
static void
|
||||
annotate_thread_exited (thread_info *t,
|
||||
gdb::optional<ULONGEST> exit_code,
|
||||
std::optional<ULONGEST> exit_code,
|
||||
bool /* silent */)
|
||||
{
|
||||
if (annotation_level > 1)
|
||||
|
||||
@@ -215,7 +215,7 @@ arm_fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||
/* See arm-fbsd-tdep.h. */
|
||||
|
||||
const struct target_desc *
|
||||
arm_fbsd_read_description_auxv (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
arm_fbsd_read_description_auxv (const std::optional<gdb::byte_vector> &auxv,
|
||||
target_ops *target, gdbarch *gdbarch, bool tls)
|
||||
{
|
||||
CORE_ADDR arm_hwcap = 0;
|
||||
@@ -244,7 +244,7 @@ arm_fbsd_read_description_auxv (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
const struct target_desc *
|
||||
arm_fbsd_read_description_auxv (bool tls)
|
||||
{
|
||||
const gdb::optional<gdb::byte_vector> &auxv = target_read_auxv ();
|
||||
const std::optional<gdb::byte_vector> &auxv = target_read_auxv ();
|
||||
return arm_fbsd_read_description_auxv (auxv,
|
||||
current_inferior ()->top_target (),
|
||||
current_inferior ()->arch (),
|
||||
@@ -260,7 +260,7 @@ arm_fbsd_core_read_description (struct gdbarch *gdbarch,
|
||||
{
|
||||
asection *tls = bfd_get_section_by_name (abfd, ".reg-aarch-tls");
|
||||
|
||||
gdb::optional<gdb::byte_vector> auxv = target_read_auxv_raw (target);
|
||||
std::optional<gdb::byte_vector> auxv = target_read_auxv_raw (target);
|
||||
return arm_fbsd_read_description_auxv (auxv, target, gdbarch, tls != nullptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ extern const struct regset arm_fbsd_tls_regset;
|
||||
AUXV. */
|
||||
|
||||
extern const struct target_desc *
|
||||
arm_fbsd_read_description_auxv (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
arm_fbsd_read_description_auxv (const std::optional<gdb::byte_vector> &auxv,
|
||||
target_ops *target, gdbarch *gdbarch,
|
||||
bool tls);
|
||||
|
||||
|
||||
@@ -732,7 +732,7 @@ arm_linux_core_read_description (struct gdbarch *gdbarch,
|
||||
struct target_ops *target,
|
||||
bfd *abfd)
|
||||
{
|
||||
gdb::optional<gdb::byte_vector> auxv = target_read_auxv_raw (target);
|
||||
std::optional<gdb::byte_vector> auxv = target_read_auxv_raw (target);
|
||||
CORE_ADDR arm_hwcap = linux_get_hwcap (auxv, target, gdbarch);
|
||||
|
||||
if (arm_hwcap & HWCAP_VFP)
|
||||
|
||||
@@ -302,7 +302,7 @@ struct arm_prologue_cache
|
||||
int framereg;
|
||||
|
||||
/* True if the return address is signed, false otherwise. */
|
||||
gdb::optional<bool> ra_signed_state;
|
||||
std::optional<bool> ra_signed_state;
|
||||
|
||||
/* Saved register offsets. */
|
||||
trad_frame_saved_reg *saved_regs;
|
||||
@@ -1035,7 +1035,7 @@ thumb_analyze_prologue (struct gdbarch *gdbarch,
|
||||
while (start < limit)
|
||||
{
|
||||
unsigned short insn;
|
||||
gdb::optional<bool> ra_signed_state;
|
||||
std::optional<bool> ra_signed_state;
|
||||
|
||||
insn = read_code_unsigned_integer (start, 2, byte_order_for_code);
|
||||
|
||||
|
||||
@@ -914,7 +914,7 @@ source_script_file (struct auto_load_pspace_info *pspace_info,
|
||||
return;
|
||||
}
|
||||
|
||||
gdb::optional<open_script> opened = find_and_open_script (file,
|
||||
std::optional<open_script> opened = find_and_open_script (file,
|
||||
1 /*search_path*/);
|
||||
|
||||
if (opened)
|
||||
|
||||
10
gdb/auxv.c
10
gdb/auxv.c
@@ -331,7 +331,7 @@ parse_auxv (target_ops *ops, gdbarch *gdbarch, const gdb_byte **readptr,
|
||||
overhead of transfering data from a remote target to the local host. */
|
||||
struct auxv_info
|
||||
{
|
||||
gdb::optional<gdb::byte_vector> data;
|
||||
std::optional<gdb::byte_vector> data;
|
||||
};
|
||||
|
||||
/* Per-inferior data key for auxv. */
|
||||
@@ -357,7 +357,7 @@ auxv_all_objfiles_removed (program_space *pspace)
|
||||
|
||||
/* See auxv.h. */
|
||||
|
||||
const gdb::optional<gdb::byte_vector> &
|
||||
const std::optional<gdb::byte_vector> &
|
||||
target_read_auxv ()
|
||||
{
|
||||
inferior *inf = current_inferior ();
|
||||
@@ -374,7 +374,7 @@ target_read_auxv ()
|
||||
|
||||
/* See auxv.h. */
|
||||
|
||||
gdb::optional<gdb::byte_vector>
|
||||
std::optional<gdb::byte_vector>
|
||||
target_read_auxv_raw (target_ops *ops)
|
||||
{
|
||||
return target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL);
|
||||
@@ -413,7 +413,7 @@ target_auxv_search (const gdb::byte_vector &auxv, target_ops *ops,
|
||||
int
|
||||
target_auxv_search (CORE_ADDR match, CORE_ADDR *valp)
|
||||
{
|
||||
const gdb::optional<gdb::byte_vector> &auxv = target_read_auxv ();
|
||||
const std::optional<gdb::byte_vector> &auxv = target_read_auxv ();
|
||||
|
||||
if (!auxv.has_value ())
|
||||
return -1;
|
||||
@@ -572,7 +572,7 @@ fprint_target_auxv (struct ui_file *file)
|
||||
gdbarch *gdbarch = current_inferior ()->arch ();
|
||||
CORE_ADDR type, val;
|
||||
int ents = 0;
|
||||
const gdb::optional<gdb::byte_vector> &auxv = target_read_auxv ();
|
||||
const std::optional<gdb::byte_vector> &auxv = target_read_auxv ();
|
||||
|
||||
if (!auxv.has_value ())
|
||||
return -1;
|
||||
|
||||
@@ -48,11 +48,11 @@ extern int svr4_auxv_parse (struct gdbarch *gdbarch, const gdb_byte **readptr,
|
||||
|
||||
/* Read auxv data from the current inferior's target stack. */
|
||||
|
||||
extern const gdb::optional<gdb::byte_vector> &target_read_auxv ();
|
||||
extern const std::optional<gdb::byte_vector> &target_read_auxv ();
|
||||
|
||||
/* Read auxv data from OPS. */
|
||||
|
||||
extern gdb::optional<gdb::byte_vector> target_read_auxv_raw (target_ops *ops);
|
||||
extern std::optional<gdb::byte_vector> target_read_auxv_raw (target_ops *ops);
|
||||
|
||||
/* Search AUXV for an entry with a_type matching MATCH.
|
||||
|
||||
|
||||
@@ -1566,7 +1566,7 @@ avr_io_reg_read_command (const char *args, int from_tty)
|
||||
unsigned int val;
|
||||
|
||||
/* Find out how many io registers the target has. */
|
||||
gdb::optional<gdb::byte_vector> buf
|
||||
std::optional<gdb::byte_vector> buf
|
||||
= target_read_alloc (current_inferior ()->top_target (),
|
||||
TARGET_OBJECT_AVR, "avr.io_reg");
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
#
|
||||
# Check for baseline language coverage in the compiler for the specified
|
||||
# version of the C++ standard. If necessary, add switches to CXX and
|
||||
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
|
||||
# or '14' (for the C++14 standard).
|
||||
# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for
|
||||
# the respective C++ standard version.
|
||||
#
|
||||
# The second argument, if specified, indicates whether you insist on an
|
||||
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
|
||||
# -std=c++11). If neither is specified, you get whatever works, with
|
||||
# preference for an extended mode.
|
||||
# preference for no added switch, and then for an extended mode.
|
||||
#
|
||||
# The third argument, if specified 'mandatory' or if left unspecified,
|
||||
# indicates that baseline support for the specified C++ standard is
|
||||
@@ -42,14 +42,17 @@
|
||||
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
|
||||
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
|
||||
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
|
||||
# Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
|
||||
# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
|
||||
# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
|
||||
# Copyright (c) 2020 Jason Merrill <jason@redhat.com>
|
||||
# Copyright (c) 2021 Jörn Heusipp <osmanx@problemloesungsmaschine.de>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 8
|
||||
#serial 18
|
||||
|
||||
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
|
||||
dnl (serial version number 13).
|
||||
@@ -58,6 +61,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
|
||||
m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
|
||||
[$1], [14], [ax_cxx_compile_alternatives="14 1y"],
|
||||
[$1], [17], [ax_cxx_compile_alternatives="17 1z"],
|
||||
[$1], [20], [ax_cxx_compile_alternatives="20"],
|
||||
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
|
||||
m4_if([$2], [], [],
|
||||
[$2], [ext], [],
|
||||
@@ -70,14 +74,16 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
|
||||
AC_LANG_PUSH([C++])dnl
|
||||
CXX_DIALECT=""
|
||||
ac_success=no
|
||||
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
|
||||
ax_cv_cxx_compile_cxx$1,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
|
||||
[ax_cv_cxx_compile_cxx$1=yes],
|
||||
[ax_cv_cxx_compile_cxx$1=no])])
|
||||
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
|
||||
ac_success=yes
|
||||
fi
|
||||
|
||||
m4_if([$2], [], [dnl
|
||||
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
|
||||
ax_cv_cxx_compile_cxx$1,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
|
||||
[ax_cv_cxx_compile_cxx$1=yes],
|
||||
[ax_cv_cxx_compile_cxx$1=no])])
|
||||
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
|
||||
ac_success=yes
|
||||
fi])
|
||||
|
||||
m4_if([$2], [noext], [], [dnl
|
||||
if test x$ac_success = xno; then
|
||||
@@ -109,9 +115,18 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
|
||||
dnl HP's aCC needs +std=c++11 according to:
|
||||
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
|
||||
dnl Cray's crayCC needs "-h std=c++11"
|
||||
dnl MSVC needs -std:c++NN for C++17 and later (default is C++14)
|
||||
for alternative in ${ax_cxx_compile_alternatives}; do
|
||||
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
|
||||
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do
|
||||
if test x"$switch" = xMSVC; then
|
||||
dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide
|
||||
dnl with -std=c++17. We suffix the cache variable name with _MSVC to
|
||||
dnl avoid this.
|
||||
switch=-std:c++${alternative}
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC])
|
||||
else
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
|
||||
fi
|
||||
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
|
||||
$cachevar,
|
||||
[ac_save_CXX="$CXX"
|
||||
@@ -160,7 +175,6 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
)
|
||||
|
||||
|
||||
dnl Test body for checking C++14 support
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
|
||||
@@ -168,12 +182,24 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
|
||||
)
|
||||
|
||||
dnl Test body for checking C++17 support
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17
|
||||
)
|
||||
|
||||
dnl Test body for checking C++20 support
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_20
|
||||
)
|
||||
|
||||
|
||||
dnl Tests for new features in C++11
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
|
||||
@@ -185,7 +211,11 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 201103L
|
||||
// MSVC always sets __cplusplus to 199711L in older versions; newer versions
|
||||
// only set it correctly if /Zc:__cplusplus is specified as well as a
|
||||
// /std:c++NN switch:
|
||||
// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
|
||||
#elif __cplusplus < 201103L && !defined _MSC_VER
|
||||
|
||||
#error "This is not a C++11 compiler"
|
||||
|
||||
@@ -210,11 +240,13 @@ namespace cxx11
|
||||
|
||||
struct Base
|
||||
{
|
||||
virtual ~Base() {}
|
||||
virtual void f() {}
|
||||
};
|
||||
|
||||
struct Derived : public Base
|
||||
{
|
||||
virtual ~Derived() override {}
|
||||
virtual void f() override {}
|
||||
};
|
||||
|
||||
@@ -474,7 +506,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 201402L
|
||||
#elif __cplusplus < 201402L && !defined _MSC_VER
|
||||
|
||||
#error "This is not a C++14 compiler"
|
||||
|
||||
@@ -598,20 +630,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus <= 201402L
|
||||
#elif __cplusplus < 201703L && !defined _MSC_VER
|
||||
|
||||
#error "This is not a C++17 compiler"
|
||||
|
||||
#else
|
||||
|
||||
#if defined(__clang__)
|
||||
#define REALLY_CLANG
|
||||
#else
|
||||
#if defined(__GNUC__)
|
||||
#define REALLY_GCC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <initializer_list>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
@@ -619,16 +643,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
|
||||
namespace cxx17
|
||||
{
|
||||
|
||||
#if !defined(REALLY_CLANG)
|
||||
namespace test_constexpr_lambdas
|
||||
{
|
||||
|
||||
// TODO: test it with clang++ from git
|
||||
|
||||
constexpr int foo = [](){return 42;}();
|
||||
|
||||
}
|
||||
#endif // !defined(REALLY_CLANG)
|
||||
|
||||
namespace test::nested_namespace::definitions
|
||||
{
|
||||
@@ -863,12 +883,9 @@ namespace cxx17
|
||||
|
||||
}
|
||||
|
||||
#if !defined(REALLY_CLANG)
|
||||
namespace test_template_argument_deduction_for_class_templates
|
||||
{
|
||||
|
||||
// TODO: test it with clang++ from git
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct pair
|
||||
{
|
||||
@@ -887,7 +904,6 @@ namespace cxx17
|
||||
}
|
||||
|
||||
}
|
||||
#endif // !defined(REALLY_CLANG)
|
||||
|
||||
namespace test_non_type_auto_template_parameters
|
||||
{
|
||||
@@ -901,12 +917,9 @@ namespace cxx17
|
||||
|
||||
}
|
||||
|
||||
#if !defined(REALLY_CLANG)
|
||||
namespace test_structured_bindings
|
||||
{
|
||||
|
||||
// TODO: test it with clang++ from git
|
||||
|
||||
int arr[2] = { 1, 2 };
|
||||
std::pair<int, int> pr = { 1, 2 };
|
||||
|
||||
@@ -938,14 +951,10 @@ namespace cxx17
|
||||
const auto [ x3, y3 ] = f3();
|
||||
|
||||
}
|
||||
#endif // !defined(REALLY_CLANG)
|
||||
|
||||
#if !defined(REALLY_CLANG)
|
||||
namespace test_exception_spec_type_system
|
||||
{
|
||||
|
||||
// TODO: test it with clang++ from git
|
||||
|
||||
struct Good {};
|
||||
struct Bad {};
|
||||
|
||||
@@ -963,7 +972,6 @@ namespace cxx17
|
||||
static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
|
||||
|
||||
}
|
||||
#endif // !defined(REALLY_CLANG)
|
||||
|
||||
namespace test_inline_variables
|
||||
{
|
||||
@@ -988,6 +996,36 @@ namespace cxx17
|
||||
|
||||
} // namespace cxx17
|
||||
|
||||
#endif // __cplusplus <= 201402L
|
||||
#endif // __cplusplus < 201703L && !defined _MSC_VER
|
||||
|
||||
]])
|
||||
|
||||
|
||||
dnl Tests for new features in C++20
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 202002L && !defined _MSC_VER
|
||||
|
||||
#error "This is not a C++20 compiler"
|
||||
|
||||
#else
|
||||
|
||||
#include <version>
|
||||
|
||||
namespace cxx20
|
||||
{
|
||||
|
||||
// As C++20 supports feature test macros in the standard, there is no
|
||||
// immediate need to actually test for feature availability on the
|
||||
// Autoconf side.
|
||||
|
||||
} // namespace cxx20
|
||||
|
||||
#endif // __cplusplus < 202002L && !defined _MSC_VER
|
||||
|
||||
]])
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "solist.h"
|
||||
#include "target.h"
|
||||
#include "valprint.h"
|
||||
#include <memory>
|
||||
|
||||
/* An instance of this type is used to represent an solib catchpoint.
|
||||
A breakpoint is really of this type iff its ops pointer points to
|
||||
@@ -230,7 +231,7 @@ add_solib_catchpoint (const char *arg, bool is_load, bool is_temp, bool enabled)
|
||||
if (*arg == '\0')
|
||||
arg = nullptr;
|
||||
|
||||
auto c = gdb::make_unique<solib_catchpoint> (gdbarch, is_temp, nullptr,
|
||||
auto c = std::make_unique<solib_catchpoint> (gdbarch, is_temp, nullptr,
|
||||
is_load, arg);
|
||||
|
||||
c->enable_state = enabled ? bp_enabled : bp_disabled;
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
#include <algorithm>
|
||||
#include "progspace-and-thread.h"
|
||||
#include "gdbsupport/array-view.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "gdbsupport/common-utils.h"
|
||||
|
||||
/* Prototypes for local functions. */
|
||||
@@ -2067,7 +2067,7 @@ update_watchpoint (struct watchpoint *b, bool reparse)
|
||||
if (b->disposition == disp_del_at_next_stop)
|
||||
return;
|
||||
|
||||
gdb::optional<scoped_restore_selected_frame> restore_frame;
|
||||
std::optional<scoped_restore_selected_frame> restore_frame;
|
||||
|
||||
/* Determine if the watchpoint is within scope. */
|
||||
if (b->exp_valid_block == NULL)
|
||||
@@ -3365,7 +3365,7 @@ remove_breakpoints (void)
|
||||
|
||||
static void
|
||||
remove_threaded_breakpoints (thread_info *tp,
|
||||
gdb::optional<ULONGEST> /* exit_code */,
|
||||
std::optional<ULONGEST> /* exit_code */,
|
||||
int /* silent */)
|
||||
{
|
||||
for (breakpoint &b : all_breakpoints_safe ())
|
||||
@@ -6780,8 +6780,8 @@ print_one_breakpoint_location (struct breakpoint *b,
|
||||
(uiout->test_flags (fix_breakpoint_script_output)
|
||||
|| fix_breakpoint_script_output_globally);
|
||||
|
||||
gdb::optional<ui_out_emit_tuple> tuple_emitter;
|
||||
gdb::optional<ui_out_emit_list> list_emitter;
|
||||
std::optional<ui_out_emit_tuple> tuple_emitter;
|
||||
std::optional<ui_out_emit_list> list_emitter;
|
||||
|
||||
if (use_fixed_output)
|
||||
list_emitter.emplace (uiout, "script");
|
||||
@@ -6854,7 +6854,8 @@ print_one_breakpoint (breakpoint *b, const bp_location **last_loc, int allflag)
|
||||
= (uiout->test_flags (fix_multi_location_breakpoint_output)
|
||||
|| fix_multi_location_breakpoint_output_globally);
|
||||
|
||||
gdb::optional<ui_out_emit_tuple> bkpt_tuple_emitter (gdb::in_place, uiout, "bkpt");
|
||||
std::optional<ui_out_emit_tuple> bkpt_tuple_emitter (std::in_place, uiout,
|
||||
"bkpt");
|
||||
bool printed = print_one_breakpoint_location (b, NULL, 0, last_loc,
|
||||
allflag, false);
|
||||
|
||||
@@ -6889,7 +6890,7 @@ print_one_breakpoint (breakpoint *b, const bp_location **last_loc, int allflag)
|
||||
|| !b->first_loc ().enabled
|
||||
|| b->first_loc ().disabled_by_cond))))
|
||||
{
|
||||
gdb::optional<ui_out_emit_list> locations_list;
|
||||
std::optional<ui_out_emit_list> locations_list;
|
||||
|
||||
/* For MI version <= 2, keep the behavior where GDB outputs an invalid
|
||||
MI record. For later versions, place breakpoint locations in a
|
||||
@@ -9954,7 +9955,7 @@ watchpoint::print_it (const bpstat *bs) const
|
||||
|
||||
string_file stb;
|
||||
|
||||
gdb::optional<ui_out_emit_tuple> tuple_emitter;
|
||||
std::optional<ui_out_emit_tuple> tuple_emitter;
|
||||
switch (this->type)
|
||||
{
|
||||
case bp_watchpoint:
|
||||
@@ -10932,7 +10933,7 @@ until_break_command (const char *arg, int from_tty, int anywhere)
|
||||
|
||||
std::vector<breakpoint_up> breakpoints;
|
||||
|
||||
gdb::optional<delete_longjmp_breakpoint_cleanup> lj_deleter;
|
||||
std::optional<delete_longjmp_breakpoint_cleanup> lj_deleter;
|
||||
|
||||
if (frame_id_p (caller_frame_id))
|
||||
{
|
||||
|
||||
@@ -643,7 +643,7 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
|
||||
anyway. */
|
||||
if (line == 0)
|
||||
{
|
||||
gdb::optional<int> last_line;
|
||||
std::optional<int> last_line;
|
||||
|
||||
while (!subfile->line_vector_entries.empty ())
|
||||
{
|
||||
|
||||
@@ -655,12 +655,12 @@ show_script_ext_mode (struct ui_file *file, int from_tty,
|
||||
If SEARCH_PATH is non-zero, and the file isn't found in cwd,
|
||||
search for it in the source search path. */
|
||||
|
||||
gdb::optional<open_script>
|
||||
std::optional<open_script>
|
||||
find_and_open_script (const char *script_file, int search_path)
|
||||
{
|
||||
int fd;
|
||||
openp_flags search_flags = OPF_TRY_CWD_FIRST | OPF_RETURN_REALPATH;
|
||||
gdb::optional<open_script> opened;
|
||||
std::optional<open_script> opened;
|
||||
|
||||
gdb::unique_xmalloc_ptr<char> file (tilde_expand (script_file));
|
||||
|
||||
@@ -742,7 +742,7 @@ source_script_with_search (const char *file, int from_tty, int search_path)
|
||||
if (file == NULL || *file == 0)
|
||||
error (_("source command requires file name of file to source."));
|
||||
|
||||
gdb::optional<open_script> opened = find_and_open_script (file, search_path);
|
||||
std::optional<open_script> opened = find_and_open_script (file, search_path);
|
||||
if (!opened)
|
||||
{
|
||||
/* The script wasn't found, or was otherwise inaccessible.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define CLI_CLI_CMDS_H
|
||||
|
||||
#include "gdbsupport/filestuff.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "completer.h"
|
||||
|
||||
/* Chain containing all defined commands. */
|
||||
@@ -179,7 +179,7 @@ struct open_script
|
||||
}
|
||||
};
|
||||
|
||||
extern gdb::optional<open_script>
|
||||
extern std::optional<open_script>
|
||||
find_and_open_script (const char *file, int search_path);
|
||||
|
||||
/* Command tracing state. */
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "cli/cli-cmds.h"
|
||||
#include "cli/cli-decode.h"
|
||||
#include "cli/cli-style.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
|
||||
/* Prototypes for local functions. */
|
||||
|
||||
@@ -2727,7 +2727,7 @@ cmd_func (struct cmd_list_element *cmd, const char *args, int from_tty)
|
||||
{
|
||||
if (!cmd->is_command_class_help ())
|
||||
{
|
||||
gdb::optional<scoped_restore_tmpl<bool>> restore_suppress;
|
||||
std::optional<scoped_restore_tmpl<bool>> restore_suppress;
|
||||
|
||||
if (cmd->suppress_notification != NULL)
|
||||
restore_suppress.emplace (cmd->suppress_notification, true);
|
||||
|
||||
@@ -233,7 +233,7 @@ struct cmd_list_element
|
||||
void (*destroyer) (struct cmd_list_element *self, void *context) = nullptr;
|
||||
|
||||
/* Setting affected by "set" and "show". Not used if type is not_set_cmd. */
|
||||
gdb::optional<setting> var;
|
||||
std::optional<setting> var;
|
||||
|
||||
/* Pointer to NULL terminated list of enumerated values (like
|
||||
argv). */
|
||||
|
||||
@@ -58,11 +58,11 @@ struct option_def_and_value
|
||||
void *ctx;
|
||||
|
||||
/* The option's value, if any. */
|
||||
gdb::optional<option_value> value;
|
||||
std::optional<option_value> value;
|
||||
|
||||
/* Constructor. */
|
||||
option_def_and_value (const option_def &option_, void *ctx_,
|
||||
gdb::optional<option_value> &&value_ = {})
|
||||
std::optional<option_value> &&value_ = {})
|
||||
: option (option_),
|
||||
ctx (ctx_),
|
||||
value (std::move (value_))
|
||||
@@ -99,7 +99,7 @@ private:
|
||||
allocated on the heap, so we must clear the pointer in the
|
||||
source, to avoid a double free. */
|
||||
static void clear_value (const option_def &option,
|
||||
gdb::optional<option_value> &value)
|
||||
std::optional<option_value> &value)
|
||||
{
|
||||
if (value.has_value ())
|
||||
{
|
||||
@@ -109,7 +109,7 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
static void save_option_value_in_ctx (gdb::optional<option_def_and_value> &ov);
|
||||
static void save_option_value_in_ctx (std::optional<option_def_and_value> &ov);
|
||||
|
||||
/* Info passed around when handling completion. */
|
||||
struct parse_option_completion_info
|
||||
@@ -177,7 +177,7 @@ complete_on_all_options (completion_tracker &tracker,
|
||||
/* Parse ARGS, guided by OPTIONS_GROUP. HAVE_DELIMITER is true if the
|
||||
whole ARGS line included the "--" options-terminator delimiter. */
|
||||
|
||||
static gdb::optional<option_def_and_value>
|
||||
static std::optional<option_def_and_value>
|
||||
parse_option (gdb::array_view<const option_def_group> options_group,
|
||||
process_options_mode mode,
|
||||
bool have_delimiter,
|
||||
@@ -496,7 +496,7 @@ complete_options (completion_tracker &tracker,
|
||||
}
|
||||
else if (**args == '-')
|
||||
{
|
||||
gdb::optional<option_def_and_value> ov
|
||||
std::optional<option_def_and_value> ov
|
||||
= parse_option (options_group, mode, have_delimiter,
|
||||
args, &completion_info);
|
||||
if (!ov && !tracker.have_completions ())
|
||||
@@ -589,7 +589,7 @@ complete_options (completion_tracker &tracker,
|
||||
/* Save the parsed value in the option's context. */
|
||||
|
||||
static void
|
||||
save_option_value_in_ctx (gdb::optional<option_def_and_value> &ov)
|
||||
save_option_value_in_ctx (std::optional<option_def_and_value> &ov)
|
||||
{
|
||||
switch (ov->option.type)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef CLI_OPTION_H
|
||||
#define CLI_OPTION_H 1
|
||||
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "gdbsupport/array-view.h"
|
||||
#include "completer.h"
|
||||
#include <string>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "extension.h"
|
||||
#include "interps.h"
|
||||
#include "compile/compile.h"
|
||||
#include "gdbsupport/gdb_string_view.h"
|
||||
#include <string_view>
|
||||
#include "python/python.h"
|
||||
#include "guile/guile.h"
|
||||
|
||||
@@ -103,7 +103,7 @@ private:
|
||||
std::string m_command_line;
|
||||
|
||||
/* The arguments. Each element points inside M_COMMAND_LINE. */
|
||||
std::vector<gdb::string_view> m_args;
|
||||
std::vector<std::string_view> m_args;
|
||||
};
|
||||
|
||||
/* The stack of arguments passed to user defined functions. We need a
|
||||
|
||||
@@ -126,7 +126,7 @@ struct literal_def
|
||||
LONGEST use;
|
||||
|
||||
/* An optional number accepted that stands for the literal. */
|
||||
gdb::optional<LONGEST> val;
|
||||
std::optional<LONGEST> val;
|
||||
};
|
||||
|
||||
/* Return true if a setting of type VAR_TYPE is backed with type T.
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "gdbsupport/gdb-dlfcn.h"
|
||||
#include "gdbsupport/preprocessor.h"
|
||||
#include "gdbarch.h"
|
||||
#include <memory>
|
||||
|
||||
/* See compile-internal.h. */
|
||||
|
||||
@@ -118,7 +119,7 @@ get_compile_context (const char *fe_libcc, const char *fe_context,
|
||||
error (_("The loaded version of GCC does not support the required version "
|
||||
"of the API."));
|
||||
|
||||
return gdb::make_unique<INSTTYPE> (context);
|
||||
return std::make_unique<INSTTYPE> (context);
|
||||
}
|
||||
|
||||
/* A C-language implementation of get_compile_context. */
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "osabi.h"
|
||||
#include "gdbsupport/gdb_wait.h"
|
||||
#include "valprint.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "gdbsupport/gdb_unlinker.h"
|
||||
#include "gdbsupport/pathstuff.h"
|
||||
#include "gdbsupport/scoped_ignore_signal.h"
|
||||
@@ -768,7 +768,7 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
|
||||
|
||||
compile_file_names fnames = get_new_file_names ();
|
||||
|
||||
gdb::optional<gdb::unlinker> source_remover;
|
||||
std::optional<gdb::unlinker> source_remover;
|
||||
|
||||
{
|
||||
gdb_file_up src = gdb_fopen_cloexec (fnames.source_file (), "w");
|
||||
|
||||
@@ -99,8 +99,8 @@
|
||||
/* Define to 1 if you have the <curses.h> header file. */
|
||||
#undef HAVE_CURSES_H
|
||||
|
||||
/* define if the compiler supports basic C++11 syntax */
|
||||
#undef HAVE_CXX11
|
||||
/* define if the compiler supports basic C++17 syntax */
|
||||
#undef HAVE_CXX17
|
||||
|
||||
/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
|
||||
you don't. */
|
||||
|
||||
1580
gdb/configure
vendored
1580
gdb/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -53,9 +53,9 @@ LT_INIT
|
||||
# link tests in the configure script.
|
||||
LT_OUTPUT
|
||||
|
||||
# We require a C++11 compiler. Check if one is available, and if
|
||||
# We require a C++17 compiler. Check if one is available, and if
|
||||
# necessary, set CXX_DIALECT to some -std=xxx switch.
|
||||
AX_CXX_COMPILE_STDCXX(11, , mandatory)
|
||||
AX_CXX_COMPILE_STDCXX(17, , mandatory)
|
||||
|
||||
# Dependency checking.
|
||||
ZW_CREATE_DEPDIR
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "cp-support.h"
|
||||
#include "c-support.h"
|
||||
#include "parser-defs.h"
|
||||
#include <memory>
|
||||
|
||||
#define GDB_YY_REMAP_PREFIX cpname
|
||||
#include "yy-remap.h"
|
||||
@@ -2038,7 +2039,7 @@ cp_demangled_name_to_comp (const char *demangled_name,
|
||||
|
||||
state.demangle_info = allocate_info ();
|
||||
|
||||
auto result = gdb::make_unique<demangle_parse_info> ();
|
||||
auto result = std::make_unique<demangle_parse_info> ();
|
||||
result->info = state.demangle_info;
|
||||
|
||||
if (yyparse (&state))
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "run-on-main-thread.h"
|
||||
#include "typeprint.h"
|
||||
#include "inferior.h"
|
||||
#include <memory>
|
||||
|
||||
#define d_left(dc) (dc)->u.s_binary.left
|
||||
#define d_right(dc) (dc)->u.s_binary.right
|
||||
@@ -675,7 +676,7 @@ mangled_name_to_comp (const char *mangled_name, int options,
|
||||
options, memory);
|
||||
if (ret)
|
||||
{
|
||||
auto info = gdb::make_unique<demangle_parse_info> ();
|
||||
auto info = std::make_unique<demangle_parse_info> ();
|
||||
info->tree = ret;
|
||||
*demangled_p = NULL;
|
||||
return info;
|
||||
@@ -1657,13 +1658,7 @@ gdb_demangle (const char *name, int options)
|
||||
we might be in a background thread. Instead, arrange for
|
||||
the reporting to happen on the main thread. */
|
||||
std::string copy = name;
|
||||
run_on_main_thread ([
|
||||
#if __cplusplus >= 201402L
|
||||
=, copy = std::move (copy)
|
||||
#else
|
||||
=
|
||||
#endif
|
||||
] ()
|
||||
run_on_main_thread ([=, copy = std::move (copy)] ()
|
||||
{
|
||||
report_failed_demangle (copy.c_str (), core_dump_allowed,
|
||||
crash_signal);
|
||||
|
||||
@@ -1967,7 +1967,7 @@ darwin_nat_target::create_inferior (const char *exec_file,
|
||||
const std::string &allargs,
|
||||
char **env, int from_tty)
|
||||
{
|
||||
gdb::optional<scoped_restore_tmpl<bool>> restore_startup_with_shell;
|
||||
std::optional<scoped_restore_tmpl<bool>> restore_startup_with_shell;
|
||||
darwin_nat_target *the_target = this;
|
||||
|
||||
if (startup_with_shell && may_have_sip ())
|
||||
|
||||
@@ -1483,7 +1483,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
{
|
||||
case 'S':
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
|
||||
pst->add_psymbol (std::string_view (sym_name, sym_len), true,
|
||||
VAR_DOMAIN, LOC_STATIC,
|
||||
data_sect_index,
|
||||
psymbol_placement::STATIC,
|
||||
@@ -1500,7 +1500,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
/* The addresses in these entries are reported to be
|
||||
wrong. See the code that reads 'G's for symtabs. */
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
|
||||
pst->add_psymbol (std::string_view (sym_name, sym_len), true,
|
||||
VAR_DOMAIN, LOC_STATIC,
|
||||
data_sect_index,
|
||||
psymbol_placement::GLOBAL,
|
||||
@@ -1525,7 +1525,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
&& namestring[0] != ' '))
|
||||
{
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (sym_name, sym_len),
|
||||
pst->add_psymbol (std::string_view (sym_name, sym_len),
|
||||
true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
|
||||
psymbol_placement::STATIC,
|
||||
unrelocated_addr (0),
|
||||
@@ -1540,7 +1540,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
{
|
||||
/* Also a typedef with the same name. */
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (sym_name, sym_len),
|
||||
pst->add_psymbol (std::string_view (sym_name, sym_len),
|
||||
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
|
||||
psymbol_placement::STATIC,
|
||||
unrelocated_addr (0),
|
||||
@@ -1559,7 +1559,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
if (p != namestring) /* a name is there, not just :T... */
|
||||
{
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (sym_name, sym_len),
|
||||
pst->add_psymbol (std::string_view (sym_name, sym_len),
|
||||
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
|
||||
psymbol_placement::STATIC,
|
||||
unrelocated_addr (0),
|
||||
@@ -1627,7 +1627,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
/* Note that the value doesn't matter for
|
||||
enum constants in psymtabs, just in symtabs. */
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (p, q - p), true,
|
||||
pst->add_psymbol (std::string_view (p, q - p), true,
|
||||
VAR_DOMAIN, LOC_CONST, -1,
|
||||
psymbol_placement::STATIC,
|
||||
unrelocated_addr (0),
|
||||
@@ -1652,7 +1652,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
case 'c':
|
||||
/* Constant, e.g. from "const" in Pascal. */
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
|
||||
pst->add_psymbol (std::string_view (sym_name, sym_len), true,
|
||||
VAR_DOMAIN, LOC_CONST, -1,
|
||||
psymbol_placement::STATIC,
|
||||
unrelocated_addr (0),
|
||||
@@ -1712,7 +1712,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
textlow_not_set = 0;
|
||||
}
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
|
||||
pst->add_psymbol (std::string_view (sym_name, sym_len), true,
|
||||
VAR_DOMAIN, LOC_BLOCK,
|
||||
SECT_OFF_TEXT (objfile),
|
||||
psymbol_placement::STATIC,
|
||||
@@ -1771,7 +1771,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
|
||||
textlow_not_set = 0;
|
||||
}
|
||||
if (pst != nullptr)
|
||||
pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
|
||||
pst->add_psymbol (std::string_view (sym_name, sym_len), true,
|
||||
VAR_DOMAIN, LOC_BLOCK,
|
||||
SECT_OFF_TEXT (objfile),
|
||||
psymbol_placement::GLOBAL,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <errno.h>
|
||||
#include "gdbsupport/scoped_fd.h"
|
||||
#include "debuginfod-support.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "cli/cli-cmds.h"
|
||||
#include "cli/cli-style.h"
|
||||
#include "cli-out.h"
|
||||
@@ -246,11 +246,11 @@ debuginfod_is_enabled ()
|
||||
gdb_printf (_("\nThis GDB supports auto-downloading debuginfo " \
|
||||
"from the following URLs:\n"));
|
||||
|
||||
gdb::string_view url_view (urls);
|
||||
std::string_view url_view (urls);
|
||||
while (true)
|
||||
{
|
||||
size_t off = url_view.find_first_not_of (' ');
|
||||
if (off == gdb::string_view::npos)
|
||||
if (off == std::string_view::npos)
|
||||
break;
|
||||
url_view = url_view.substr (off);
|
||||
/* g++ 11.2.1 on s390x, g++ 11.3.1 on ppc64le and g++ 11 on
|
||||
@@ -264,9 +264,8 @@ debuginfod_is_enabled ()
|
||||
gdb_printf
|
||||
(_(" <%ps>\n"),
|
||||
styled_string (file_name_style.style (),
|
||||
gdb::to_string (url_view.substr (0,
|
||||
off)).c_str ()));
|
||||
if (off == gdb::string_view::npos)
|
||||
std::string (url_view.substr (0, off)).c_str ()));
|
||||
if (off == std::string_view::npos)
|
||||
break;
|
||||
url_view = url_view.substr (off);
|
||||
}
|
||||
@@ -320,7 +319,7 @@ debuginfod_source_query (const unsigned char *build_id,
|
||||
|
||||
char *dname = nullptr;
|
||||
scoped_fd fd;
|
||||
gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
std::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
|
||||
{
|
||||
user_data data ("source file", srcpath);
|
||||
@@ -366,7 +365,7 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
|
||||
|
||||
char *dname = nullptr;
|
||||
scoped_fd fd;
|
||||
gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
std::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
|
||||
{
|
||||
user_data data ("separate debug info for", filename);
|
||||
@@ -409,7 +408,7 @@ debuginfod_exec_query (const unsigned char *build_id,
|
||||
|
||||
char *dname = nullptr;
|
||||
scoped_fd fd;
|
||||
gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
std::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
|
||||
{
|
||||
user_data data ("executable for", filename);
|
||||
@@ -458,7 +457,7 @@ debuginfod_section_query (const unsigned char *build_id,
|
||||
char *dname = nullptr;
|
||||
std::string desc = std::string ("section ") + section_name + " for";
|
||||
scoped_fd fd;
|
||||
gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
std::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
|
||||
{
|
||||
user_data data (desc.c_str (), filename);
|
||||
|
||||
14
gdb/disasm.c
14
gdb/disasm.c
@@ -29,7 +29,7 @@
|
||||
#include "source.h"
|
||||
#include "gdbsupport/gdb-safe-ctype.h"
|
||||
#include <algorithm>
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "valprint.h"
|
||||
#include "cli/cli-style.h"
|
||||
#include "objfiles.h"
|
||||
@@ -653,8 +653,8 @@ do_mixed_source_and_assembly_deprecated
|
||||
|
||||
ui_out_emit_list asm_insns_list (uiout, "asm_insns");
|
||||
|
||||
gdb::optional<ui_out_emit_tuple> outer_tuple_emitter;
|
||||
gdb::optional<ui_out_emit_list> inner_list_emitter;
|
||||
std::optional<ui_out_emit_tuple> outer_tuple_emitter;
|
||||
std::optional<ui_out_emit_list> inner_list_emitter;
|
||||
|
||||
for (i = 0; i < newlines; i++)
|
||||
{
|
||||
@@ -810,8 +810,8 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
|
||||
|
||||
ui_out_emit_list asm_insns_emitter (uiout, "asm_insns");
|
||||
|
||||
gdb::optional<ui_out_emit_tuple> tuple_emitter;
|
||||
gdb::optional<ui_out_emit_list> list_emitter;
|
||||
std::optional<ui_out_emit_tuple> tuple_emitter;
|
||||
std::optional<ui_out_emit_list> list_emitter;
|
||||
|
||||
last_symtab = NULL;
|
||||
last_line = 0;
|
||||
@@ -1093,7 +1093,7 @@ gdb_print_insn_1 (struct gdbarch *gdbarch, CORE_ADDR vma,
|
||||
struct disassemble_info *info)
|
||||
{
|
||||
/* Call into the extension languages to do the disassembly. */
|
||||
gdb::optional<int> length = ext_lang_print_insn (gdbarch, vma, info);
|
||||
std::optional<int> length = ext_lang_print_insn (gdbarch, vma, info);
|
||||
if (length.has_value ())
|
||||
return *length;
|
||||
|
||||
@@ -1125,7 +1125,7 @@ gdb_disassembler::print_insn (CORE_ADDR memaddr,
|
||||
this output. */
|
||||
if (length > 0 && use_ext_lang_for_styling ())
|
||||
{
|
||||
gdb::optional<std::string> ext_contents;
|
||||
std::optional<std::string> ext_contents;
|
||||
ext_contents = ext_lang_colorize_disasm (m_buffer.string (), arch ());
|
||||
if (ext_contents.has_value ())
|
||||
m_buffer = std::move (*ext_contents);
|
||||
|
||||
29
gdb/disasm.h
29
gdb/disasm.h
@@ -26,12 +26,6 @@ struct gdbarch;
|
||||
struct ui_out;
|
||||
struct ui_file;
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#define LIBOPCODE_CALLBACK_NOEXCEPT noexcept
|
||||
#else
|
||||
#define LIBOPCODE_CALLBACK_NOEXCEPT
|
||||
#endif
|
||||
|
||||
/* A wrapper around a disassemble_info and a gdbarch. This is the core
|
||||
set of data that all disassembler sub-classes will need. This class
|
||||
doesn't actually implement the disassembling process, that is something
|
||||
@@ -58,27 +52,18 @@ struct gdb_disassemble_info
|
||||
protected:
|
||||
|
||||
/* Types for the function callbacks within m_di. The actual function
|
||||
signatures here are taken from include/dis-asm.h. The noexcept macro
|
||||
expands to 'noexcept' for C++17 and later, otherwise, it expands to
|
||||
nothing. This is because including noexcept was ignored for function
|
||||
types before C++17, but both GCC and Clang warn that the noexcept
|
||||
will become relevant when you switch to C++17, and this warning
|
||||
causes the build to fail. */
|
||||
signatures here are taken from include/dis-asm.h. */
|
||||
using read_memory_ftype
|
||||
= int (*) (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *)
|
||||
LIBOPCODE_CALLBACK_NOEXCEPT;
|
||||
noexcept;
|
||||
using memory_error_ftype
|
||||
= void (*) (int, bfd_vma, struct disassemble_info *)
|
||||
LIBOPCODE_CALLBACK_NOEXCEPT;
|
||||
= void (*) (int, bfd_vma, struct disassemble_info *) noexcept;
|
||||
using print_address_ftype
|
||||
= void (*) (bfd_vma, struct disassemble_info *)
|
||||
LIBOPCODE_CALLBACK_NOEXCEPT;
|
||||
= void (*) (bfd_vma, struct disassemble_info *) noexcept;
|
||||
using fprintf_ftype
|
||||
= int (*) (void *, const char *, ...)
|
||||
LIBOPCODE_CALLBACK_NOEXCEPT;
|
||||
= int (*) (void *, const char *, ...) noexcept;
|
||||
using fprintf_styled_ftype
|
||||
= int (*) (void *, enum disassembler_style, const char *, ...)
|
||||
LIBOPCODE_CALLBACK_NOEXCEPT;
|
||||
= int (*) (void *, enum disassembler_style, const char *, ...) noexcept;
|
||||
|
||||
/* Constructor, many fields in m_di are initialized from GDBARCH. The
|
||||
remaining arguments are function callbacks that are written into m_di.
|
||||
@@ -275,7 +260,7 @@ private:
|
||||
negative value (which indicates an error), then, if this variable has
|
||||
a value, we report a memory error to the user, otherwise, we report a
|
||||
non-memory error. */
|
||||
gdb::optional<CORE_ADDR> m_err_memaddr;
|
||||
std::optional<CORE_ADDR> m_err_memaddr;
|
||||
|
||||
/* The stream to which disassembler output will be written. */
|
||||
ui_file *m_dest;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "dwarf2.h"
|
||||
#include "dwarf2/types.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
|
||||
/* Blocks are a bunch of untyped bytes. */
|
||||
struct dwarf_block
|
||||
|
||||
@@ -266,9 +266,9 @@ cooked_index_shard::handle_gnat_encoded_entry (cooked_index_entry *entry,
|
||||
std::string canonical = ada_decode (entry->name, false, false);
|
||||
if (canonical.empty ())
|
||||
return {};
|
||||
std::vector<gdb::string_view> names = split_name (canonical.c_str (),
|
||||
std::vector<std::string_view> names = split_name (canonical.c_str (),
|
||||
split_style::DOT_STYLE);
|
||||
gdb::string_view tail = names.back ();
|
||||
std::string_view tail = names.back ();
|
||||
names.pop_back ();
|
||||
|
||||
const cooked_index_entry *parent = nullptr;
|
||||
@@ -333,7 +333,7 @@ cooked_index_shard::do_finalize ()
|
||||
auto eq_entry = [] (const void *a, const void *b) -> int
|
||||
{
|
||||
const cooked_index_entry *ae = (const cooked_index_entry *) a;
|
||||
const gdb::string_view *sv = (const gdb::string_view *) b;
|
||||
const std::string_view *sv = (const std::string_view *) b;
|
||||
return (strlen (ae->canonical) == sv->length ()
|
||||
&& strncasecmp (ae->canonical, sv->data (), sv->length ()) == 0);
|
||||
};
|
||||
@@ -466,12 +466,7 @@ cooked_index::start_writing_index (dwarf2_per_bfd *per_bfd)
|
||||
started, because it may call 'wait'. */
|
||||
m_write_future
|
||||
= gdb::thread_pool::g_thread_pool->post_task ([this, per_bfd,
|
||||
#if __cplusplus >= 201402L
|
||||
ctx = std::move (ctx)
|
||||
#else
|
||||
ctx
|
||||
#endif
|
||||
] ()
|
||||
ctx = std::move (ctx)] ()
|
||||
{
|
||||
maybe_write_index (per_bfd, ctx);
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "symtab.h"
|
||||
#include "hashtab.h"
|
||||
#include "dwarf2/index-common.h"
|
||||
#include "gdbsupport/gdb_string_view.h"
|
||||
#include <string_view>
|
||||
#include "quick-symbol.h"
|
||||
#include "gdbsupport/gdb_obstack.h"
|
||||
#include "addrmap.h"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "buildsym.h"
|
||||
#include "dwarf2/comp-unit-head.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "language.h"
|
||||
|
||||
/* Type used for delaying computation of method physnames.
|
||||
@@ -101,7 +101,7 @@ struct dwarf2_cu
|
||||
struct comp_unit_head header;
|
||||
|
||||
/* Base address of this compilation unit. */
|
||||
gdb::optional<unrelocated_addr> base_address;
|
||||
std::optional<unrelocated_addr> base_address;
|
||||
|
||||
/* The language we are debugging. */
|
||||
const struct language_defn *language_defn = nullptr;
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
|
||||
/* The DW_AT_addr_base (DW_AT_GNU_addr_base) attribute if present.
|
||||
Note this value comes from the Fission stub CU/TU's DIE. */
|
||||
gdb::optional<ULONGEST> addr_base;
|
||||
std::optional<ULONGEST> addr_base;
|
||||
|
||||
/* The DW_AT_GNU_ranges_base attribute, if present.
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
files, the value is implicitly zero. For DWARF 5 version DWO files, the
|
||||
value is often implicit and is the size of the header of
|
||||
.debug_str_offsets section (8 or 4, depending on the address size). */
|
||||
gdb::optional<ULONGEST> str_offsets_base;
|
||||
std::optional<ULONGEST> str_offsets_base;
|
||||
|
||||
/* Mark used when releasing cached dies. */
|
||||
bool m_mark : 1;
|
||||
|
||||
@@ -59,7 +59,7 @@ struct die_info
|
||||
/* Return the address base of the compile unit, which, if exists, is
|
||||
stored either at the attribute DW_AT_GNU_addr_base, or
|
||||
DW_AT_addr_base. */
|
||||
gdb::optional<ULONGEST> addr_base ()
|
||||
std::optional<ULONGEST> addr_base ()
|
||||
{
|
||||
for (unsigned i = 0; i < num_attrs; ++i)
|
||||
if (attrs[i].name == DW_AT_addr_base
|
||||
@@ -73,7 +73,7 @@ struct die_info
|
||||
complaint (_("address base attribute (offset %s) as wrong form"),
|
||||
sect_offset_str (sect_off));
|
||||
}
|
||||
return gdb::optional<ULONGEST> ();
|
||||
return std::optional<ULONGEST> ();
|
||||
}
|
||||
|
||||
/* Return the base address of the compile unit into the .debug_ranges section,
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <unordered_map>
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
struct comp_unit;
|
||||
|
||||
@@ -2126,7 +2127,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
|
||||
struct gdbarch *gdbarch = objfile->arch ();
|
||||
|
||||
/* Build a minimal decoding of the DWARF2 compilation unit. */
|
||||
auto unit = gdb::make_unique<comp_unit> (objfile);
|
||||
auto unit = std::make_unique<comp_unit> (objfile);
|
||||
|
||||
if (objfile->separate_debug_objfile_backlink == NULL)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
std::string build_id_str;
|
||||
|
||||
/* Captured value of dwz build id. */
|
||||
gdb::optional<std::string> dwz_build_id_str;
|
||||
std::optional<std::string> dwz_build_id_str;
|
||||
};
|
||||
|
||||
/* Class to manage the access to the DWARF index cache. */
|
||||
|
||||
@@ -58,7 +58,7 @@ dwarf5_djb_hash (const char *str_)
|
||||
/* See dwarf-index-common.h. */
|
||||
|
||||
uint32_t
|
||||
dwarf5_djb_hash (gdb::string_view str)
|
||||
dwarf5_djb_hash (std::string_view str)
|
||||
{
|
||||
/* Note: tolower here ignores UTF-8, which isn't fully compliant.
|
||||
See http://dwarfstd.org/ShowIssue.php?issue=161027.1. */
|
||||
|
||||
@@ -54,6 +54,6 @@ uint32_t dwarf5_djb_hash (const char *str_);
|
||||
|
||||
/* Symbol name hashing function as specified by DWARF-5. */
|
||||
|
||||
uint32_t dwarf5_djb_hash (gdb::string_view str_);
|
||||
uint32_t dwarf5_djb_hash (std::string_view str_);
|
||||
|
||||
#endif /* DWARF_INDEX_COMMON_H */
|
||||
|
||||
@@ -1473,7 +1473,7 @@ struct index_wip_file
|
||||
FILENAME_TEMP is unlinked, because on MS-Windows one cannot
|
||||
delete a file that is still open. So, we wrap the unlinker in an
|
||||
optional and emplace it once we know the file name. */
|
||||
gdb::optional<gdb::unlinker> unlink_file;
|
||||
std::optional<gdb::unlinker> unlink_file;
|
||||
|
||||
gdb_file_up out_file;
|
||||
};
|
||||
@@ -1496,7 +1496,7 @@ write_dwarf_index (dwarf2_per_bfd *per_bfd, const char *dir,
|
||||
? INDEX5_SUFFIX : INDEX4_SUFFIX);
|
||||
|
||||
index_wip_file objfile_index_wip (dir, basename, index_suffix);
|
||||
gdb::optional<index_wip_file> dwz_index_wip;
|
||||
std::optional<index_wip_file> dwz_index_wip;
|
||||
|
||||
if (dwz_basename != NULL)
|
||||
dwz_index_wip.emplace (dir, dwz_basename, index_suffix);
|
||||
|
||||
@@ -160,8 +160,8 @@ read_formatted_entries (dwarf2_per_objfile *per_objfile, bfd *abfd,
|
||||
ULONGEST form = read_unsigned_leb128 (abfd, format, &bytes_read);
|
||||
format += bytes_read;
|
||||
|
||||
gdb::optional<const char *> string;
|
||||
gdb::optional<unsigned int> uint;
|
||||
std::optional<const char *> string;
|
||||
std::optional<unsigned int> uint;
|
||||
|
||||
switch (form)
|
||||
{
|
||||
|
||||
@@ -444,7 +444,7 @@ dwarf_decode_macro_bytes (dwarf2_per_objfile *per_objfile,
|
||||
unsigned int offset_size,
|
||||
struct dwarf2_section_info *str_section,
|
||||
struct dwarf2_section_info *str_offsets_section,
|
||||
gdb::optional<ULONGEST> str_offsets_base,
|
||||
std::optional<ULONGEST> str_offsets_base,
|
||||
htab_t include_hash, struct dwarf2_cu *cu)
|
||||
{
|
||||
struct objfile *objfile = per_objfile->objfile;
|
||||
@@ -805,7 +805,7 @@ dwarf_decode_macros (dwarf2_per_objfile *per_objfile,
|
||||
const struct line_header *lh, unsigned int offset_size,
|
||||
unsigned int offset, struct dwarf2_section_info *str_section,
|
||||
struct dwarf2_section_info *str_offsets_section,
|
||||
gdb::optional<ULONGEST> str_offsets_base,
|
||||
std::optional<ULONGEST> str_offsets_base,
|
||||
int section_is_gnu, struct dwarf2_cu *cu)
|
||||
{
|
||||
bfd *abfd;
|
||||
|
||||
@@ -30,7 +30,7 @@ extern void dwarf_decode_macros (dwarf2_per_objfile *per_objfile,
|
||||
unsigned int offset,
|
||||
dwarf2_section_info *str_section,
|
||||
dwarf2_section_info *str_offsets_section,
|
||||
gdb::optional<ULONGEST> str_offsets_base,
|
||||
std::optional<ULONGEST> str_offsets_base,
|
||||
int section_is_gnu, struct dwarf2_cu *cu);
|
||||
|
||||
#endif /* GDB_DWARF2_MACRO_H */
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "mapped-index.h"
|
||||
#include "read.h"
|
||||
#include "stringify.h"
|
||||
#include <memory>
|
||||
|
||||
/* A description of the mapped .debug_names.
|
||||
Uninitialized map has CU_COUNT 0. */
|
||||
@@ -462,7 +463,7 @@ create_cus_from_debug_names (dwarf2_per_bfd *per_bfd,
|
||||
bool
|
||||
dwarf2_read_debug_names (dwarf2_per_objfile *per_objfile)
|
||||
{
|
||||
auto map = gdb::make_unique<mapped_debug_names> ();
|
||||
auto map = std::make_unique<mapped_debug_names> ();
|
||||
mapped_debug_names dwz_map;
|
||||
struct objfile *objfile = per_objfile->objfile;
|
||||
dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "gdbsupport/gdb-checked-static-cast.h"
|
||||
#include "mapped-index.h"
|
||||
#include "read.h"
|
||||
#include <memory>
|
||||
|
||||
/* When true, do not reject deprecated .gdb_index sections. */
|
||||
static bool use_deprecated_index_sections = false;
|
||||
@@ -181,7 +182,7 @@ struct dw2_symtab_iterator
|
||||
dwarf2_per_objfile *per_objfile;
|
||||
/* If set, only look for symbols that match that block. Valid values are
|
||||
GLOBAL_BLOCK and STATIC_BLOCK. */
|
||||
gdb::optional<block_enum> block_index;
|
||||
std::optional<block_enum> block_index;
|
||||
/* The kind of symbol we're looking for. */
|
||||
domain_enum domain;
|
||||
/* The list of CUs from the index entry of the symbol,
|
||||
@@ -203,7 +204,7 @@ struct dw2_symtab_iterator
|
||||
static void
|
||||
dw2_symtab_iter_init (struct dw2_symtab_iterator *iter,
|
||||
dwarf2_per_objfile *per_objfile,
|
||||
gdb::optional<block_enum> block_index,
|
||||
std::optional<block_enum> block_index,
|
||||
domain_enum domain, offset_type namei,
|
||||
mapped_gdb_index &index)
|
||||
{
|
||||
@@ -828,7 +829,7 @@ dwarf2_read_gdb_index
|
||||
if (main_index_contents.empty ())
|
||||
return 0;
|
||||
|
||||
auto map = gdb::make_unique<mapped_gdb_index> ();
|
||||
auto map = std::make_unique<mapped_gdb_index> ();
|
||||
if (!read_gdb_index_from_buffer (objfile_name (objfile),
|
||||
use_deprecated_index_sections,
|
||||
main_index_contents, map.get (), &cu_list,
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
#include "build-id.h"
|
||||
#include "namespace.h"
|
||||
#include "gdbsupport/function-view.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "gdbsupport/underlying.h"
|
||||
#include "gdbsupport/hash_enum.h"
|
||||
#include "filename-seen-cache.h"
|
||||
@@ -95,6 +95,7 @@
|
||||
#include "split-name.h"
|
||||
#include "gdbsupport/parallel-for.h"
|
||||
#include "gdbsupport/thread-pool.h"
|
||||
#include <memory>
|
||||
|
||||
/* When == 1, print basic high level tracing messages.
|
||||
When > 1, be more verbose.
|
||||
@@ -4079,7 +4080,7 @@ read_cutu_die_from_dwo (dwarf2_cu *cu,
|
||||
/* Return the signature of the compile unit, if found. In DWARF 4 and before,
|
||||
the signature is in the DW_AT_GNU_dwo_id attribute. In DWARF 5 and later, the
|
||||
signature is part of the header. */
|
||||
static gdb::optional<ULONGEST>
|
||||
static std::optional<ULONGEST>
|
||||
lookup_dwo_id (struct dwarf2_cu *cu, struct die_info* comp_unit_die)
|
||||
{
|
||||
if (cu->header.version >= 5)
|
||||
@@ -4087,7 +4088,7 @@ lookup_dwo_id (struct dwarf2_cu *cu, struct die_info* comp_unit_die)
|
||||
struct attribute *attr;
|
||||
attr = dwarf2_attr (comp_unit_die, DW_AT_GNU_dwo_id, cu);
|
||||
if (attr == nullptr || !attr->form_is_unsigned ())
|
||||
return gdb::optional<ULONGEST> ();
|
||||
return std::optional<ULONGEST> ();
|
||||
return attr->as_unsigned ();
|
||||
}
|
||||
|
||||
@@ -4120,7 +4121,7 @@ lookup_dwo_unit (dwarf2_cu *cu, die_info *comp_unit_die, const char *dwo_name)
|
||||
dwo_unit = lookup_dwo_type_unit (cu, dwo_name, comp_dir);
|
||||
else
|
||||
{
|
||||
gdb::optional<ULONGEST> signature = lookup_dwo_id (cu, comp_unit_die);
|
||||
std::optional<ULONGEST> signature = lookup_dwo_id (cu, comp_unit_die);
|
||||
|
||||
if (!signature.has_value ())
|
||||
error (_("Dwarf Error: missing dwo_id for dwo_name %s"
|
||||
@@ -4535,7 +4536,7 @@ allocate_type_unit_groups_table ()
|
||||
static std::unique_ptr<type_unit_group>
|
||||
create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct)
|
||||
{
|
||||
auto tu_group = gdb::make_unique<type_unit_group> ();
|
||||
auto tu_group = std::make_unique<type_unit_group> ();
|
||||
|
||||
tu_group->hash.dwo_unit = cu->dwo_unit;
|
||||
tu_group->hash.line_sect_off = line_offset_struct;
|
||||
@@ -7980,7 +7981,7 @@ create_dwo_cu_reader (const struct die_reader_specs *reader,
|
||||
sect_offset sect_off = cu->per_cu->sect_off;
|
||||
struct dwarf2_section_info *section = cu->per_cu->section;
|
||||
|
||||
gdb::optional<ULONGEST> signature = lookup_dwo_id (cu, comp_unit_die);
|
||||
std::optional<ULONGEST> signature = lookup_dwo_id (cu, comp_unit_die);
|
||||
if (!signature.has_value ())
|
||||
{
|
||||
complaint (_("Dwarf Error: debug entry at offset %s is missing"
|
||||
@@ -10784,7 +10785,7 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
|
||||
struct objfile *objfile = per_objfile->objfile;
|
||||
bfd *obfd = objfile->obfd.get ();
|
||||
/* Base address selection entry. */
|
||||
gdb::optional<unrelocated_addr> base;
|
||||
std::optional<unrelocated_addr> base;
|
||||
const gdb_byte *buffer;
|
||||
bool overflow = false;
|
||||
ULONGEST addr_index;
|
||||
@@ -10990,7 +10991,7 @@ dwarf2_ranges_process (unsigned offset, struct dwarf2_cu *cu, dwarf_tag tag,
|
||||
unsigned int addr_size = cu_header->addr_size;
|
||||
CORE_ADDR mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
|
||||
/* Base address selection entry. */
|
||||
gdb::optional<unrelocated_addr> base;
|
||||
std::optional<unrelocated_addr> base;
|
||||
unsigned int dummy;
|
||||
const gdb_byte *buffer;
|
||||
|
||||
@@ -16186,8 +16187,8 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
|
||||
bool is_declaration = false;
|
||||
sect_offset origin_offset {};
|
||||
|
||||
gdb::optional<unrelocated_addr> low_pc;
|
||||
gdb::optional<unrelocated_addr> high_pc;
|
||||
std::optional<unrelocated_addr> low_pc;
|
||||
std::optional<unrelocated_addr> high_pc;
|
||||
bool high_pc_relative = false;
|
||||
|
||||
for (int i = 0; i < abbrev->num_attrs; ++i)
|
||||
@@ -16883,9 +16884,9 @@ cooked_index_functions::expand_symtabs_matching
|
||||
|
||||
for (enum language lang : unique_styles)
|
||||
{
|
||||
std::vector<gdb::string_view> name_vec
|
||||
std::vector<std::string_view> name_vec
|
||||
= lookup_name_without_params.split_name (lang);
|
||||
std::string last_name = gdb::to_string (name_vec.back ());
|
||||
std::string last_name (name_vec.back ());
|
||||
|
||||
for (const cooked_index_entry *entry : table->find (last_name,
|
||||
completing))
|
||||
@@ -17564,7 +17565,7 @@ dwarf2_per_objfile::read_line_string (const gdb_byte *buf,
|
||||
|
||||
static unrelocated_addr
|
||||
read_addr_index_1 (dwarf2_per_objfile *per_objfile, unsigned int addr_index,
|
||||
gdb::optional<ULONGEST> addr_base, int addr_size)
|
||||
std::optional<ULONGEST> addr_base, int addr_size)
|
||||
{
|
||||
struct objfile *objfile = per_objfile->objfile;
|
||||
bfd *abfd = objfile->obfd.get ();
|
||||
@@ -17617,7 +17618,7 @@ dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
|
||||
unsigned int addr_index)
|
||||
{
|
||||
struct dwarf2_cu *cu = per_objfile->get_cu (per_cu);
|
||||
gdb::optional<ULONGEST> addr_base;
|
||||
std::optional<ULONGEST> addr_base;
|
||||
int addr_size;
|
||||
|
||||
/* We need addr_base and addr_size.
|
||||
@@ -21388,7 +21389,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
|
||||
|
||||
struct dwarf2_section_info *str_offsets_section;
|
||||
struct dwarf2_section_info *str_section;
|
||||
gdb::optional<ULONGEST> str_offsets_base;
|
||||
std::optional<ULONGEST> str_offsets_base;
|
||||
|
||||
if (cu->dwo_unit != nullptr)
|
||||
{
|
||||
|
||||
@@ -747,7 +747,7 @@ struct dwarf2_per_objfile
|
||||
dwarf2_cu *sym_cu = nullptr;
|
||||
|
||||
/* CUs that are queued to be read. */
|
||||
gdb::optional<std::queue<dwarf2_queue_item>> queue;
|
||||
std::optional<std::queue<dwarf2_queue_item>> queue;
|
||||
|
||||
private:
|
||||
/* Hold the corresponding compunit_symtab for each CU or TU. This
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "auxv.h"
|
||||
#include "mdebugread.h"
|
||||
#include "ctfread.h"
|
||||
#include "gdbsupport/gdb_string_view.h"
|
||||
#include <string_view>
|
||||
#include "gdbsupport/scoped_fd.h"
|
||||
#include "debuginfod-support.h"
|
||||
#include "dwarf2/public.h"
|
||||
@@ -197,7 +197,7 @@ elf_locate_sections (asection *sectp, struct elfinfo *ei)
|
||||
|
||||
static struct minimal_symbol *
|
||||
record_minimal_symbol (minimal_symbol_reader &reader,
|
||||
gdb::string_view name, bool copy_name,
|
||||
std::string_view name, bool copy_name,
|
||||
unrelocated_addr address,
|
||||
enum minimal_symbol_type ms_type,
|
||||
asection *bfd_section, struct objfile *objfile)
|
||||
@@ -505,7 +505,7 @@ elf_symtab_read (minimal_symbol_reader &reader,
|
||||
&& !is_plt
|
||||
&& (elf_sym->version & VERSYM_HIDDEN) == 0)
|
||||
record_minimal_symbol (reader,
|
||||
gdb::string_view (sym->name, len),
|
||||
std::string_view (sym->name, len),
|
||||
true, unrelocated_addr (symaddr),
|
||||
ms_type, sym->section, objfile);
|
||||
else if (is_plt)
|
||||
@@ -519,7 +519,7 @@ elf_symtab_read (minimal_symbol_reader &reader,
|
||||
struct minimal_symbol *mtramp;
|
||||
|
||||
mtramp = record_minimal_symbol
|
||||
(reader, gdb::string_view (sym->name, len), true,
|
||||
(reader, std::string_view (sym->name, len), true,
|
||||
unrelocated_addr (symaddr),
|
||||
mst_solib_trampoline, sym->section, objfile);
|
||||
if (mtramp)
|
||||
|
||||
@@ -102,7 +102,7 @@ expression::uses_objfile (struct objfile *objfile) const
|
||||
struct value *
|
||||
expression::evaluate (struct type *expect_type, enum noside noside)
|
||||
{
|
||||
gdb::optional<enable_thread_stack_temporaries> stack_temporaries;
|
||||
std::optional<enable_thread_stack_temporaries> stack_temporaries;
|
||||
if (target_has_execution () && inferior_ptid != null_ptid
|
||||
&& language_defn->la_language == language_cplus
|
||||
&& !thread_stack_temporaries_enabled_p (inferior_thread ()))
|
||||
|
||||
@@ -692,7 +692,7 @@ void
|
||||
gdb_rl_deprep_term_function (void)
|
||||
{
|
||||
#ifdef RL_STATE_EOF
|
||||
gdb::optional<scoped_restore_tmpl<int>> restore_eof_found;
|
||||
std::optional<scoped_restore_tmpl<int>> restore_eof_found;
|
||||
|
||||
if (RL_ISSTATE (RL_STATE_EOF))
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "serial.h"
|
||||
#include "gdbthread.h"
|
||||
#include "ui.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
|
||||
static void
|
||||
print_flush (void)
|
||||
@@ -38,7 +38,7 @@ print_flush (void)
|
||||
if (deprecated_error_begin_hook)
|
||||
deprecated_error_begin_hook ();
|
||||
|
||||
gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
std::optional<target_terminal::scoped_restore_terminal_state> term_state;
|
||||
if (target_supports_terminal_ours ())
|
||||
{
|
||||
term_state.emplace ();
|
||||
|
||||
@@ -256,13 +256,13 @@ struct extension_language_ops
|
||||
CONTENTS is the contents of the file. This should either return
|
||||
colorized (using ANSI terminal escapes) version of the contents,
|
||||
or an empty option. */
|
||||
gdb::optional<std::string> (*colorize) (const std::string &name,
|
||||
std::optional<std::string> (*colorize) (const std::string &name,
|
||||
const std::string &contents);
|
||||
|
||||
/* Colorize a single line of disassembler output, CONTENT. This should
|
||||
either return colorized (using ANSI terminal escapes) version of the
|
||||
contents, or an empty optional. */
|
||||
gdb::optional<std::string> (*colorize_disasm) (const std::string &content,
|
||||
std::optional<std::string> (*colorize_disasm) (const std::string &content,
|
||||
gdbarch *gdbarch);
|
||||
|
||||
/* Print a single instruction from ADDRESS in architecture GDBARCH. INFO
|
||||
@@ -276,7 +276,7 @@ struct extension_language_ops
|
||||
If no instruction can be disassembled then return an empty value and
|
||||
other extension languages will get a chance to perform the
|
||||
disassembly. */
|
||||
gdb::optional<int> (*print_insn) (struct gdbarch *gdbarch,
|
||||
std::optional<int> (*print_insn) (struct gdbarch *gdbarch,
|
||||
CORE_ADDR address,
|
||||
struct disassemble_info *info);
|
||||
};
|
||||
|
||||
@@ -939,10 +939,10 @@ xmethod_worker::get_result_type (value *object, gdb::array_view<value *> args)
|
||||
|
||||
/* See extension.h. */
|
||||
|
||||
gdb::optional<std::string>
|
||||
std::optional<std::string>
|
||||
ext_lang_colorize (const std::string &filename, const std::string &contents)
|
||||
{
|
||||
gdb::optional<std::string> result;
|
||||
std::optional<std::string> result;
|
||||
|
||||
for (const struct extension_language_defn *extlang : extension_languages)
|
||||
{
|
||||
@@ -959,10 +959,10 @@ ext_lang_colorize (const std::string &filename, const std::string &contents)
|
||||
|
||||
/* See extension.h. */
|
||||
|
||||
gdb::optional<std::string>
|
||||
std::optional<std::string>
|
||||
ext_lang_colorize_disasm (const std::string &content, gdbarch *gdbarch)
|
||||
{
|
||||
gdb::optional<std::string> result;
|
||||
std::optional<std::string> result;
|
||||
|
||||
for (const struct extension_language_defn *extlang : extension_languages)
|
||||
{
|
||||
@@ -979,7 +979,7 @@ ext_lang_colorize_disasm (const std::string &content, gdbarch *gdbarch)
|
||||
|
||||
/* See extension.h. */
|
||||
|
||||
gdb::optional<int>
|
||||
std::optional<int>
|
||||
ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address,
|
||||
struct disassemble_info *info)
|
||||
{
|
||||
@@ -988,7 +988,7 @@ ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address,
|
||||
if (extlang->ops == nullptr
|
||||
|| extlang->ops->print_insn == nullptr)
|
||||
continue;
|
||||
gdb::optional<int> length
|
||||
std::optional<int> length
|
||||
= extlang->ops->print_insn (gdbarch, address, info);
|
||||
if (length.has_value ())
|
||||
return length;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "mi/mi-cmds.h"
|
||||
#include "gdbsupport/array-view.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
|
||||
struct breakpoint;
|
||||
struct command_line;
|
||||
@@ -316,7 +316,7 @@ extern void get_matching_xmethod_workers
|
||||
either a colorized (using ANSI terminal escapes) version of the
|
||||
source code, or an empty value if colorizing could not be done. */
|
||||
|
||||
extern gdb::optional<std::string> ext_lang_colorize
|
||||
extern std::optional<std::string> ext_lang_colorize
|
||||
(const std::string &filename, const std::string &contents);
|
||||
|
||||
/* Try to colorize a single line of disassembler output, CONTENT for
|
||||
@@ -324,7 +324,7 @@ extern gdb::optional<std::string> ext_lang_colorize
|
||||
escapes) version of CONTENT, or an empty value if colorizing could not
|
||||
be done. */
|
||||
|
||||
extern gdb::optional<std::string> ext_lang_colorize_disasm
|
||||
extern std::optional<std::string> ext_lang_colorize_disasm
|
||||
(const std::string &content, gdbarch *gdbarch);
|
||||
|
||||
/* Calls extension_language_ops::print_insn for each extension language,
|
||||
@@ -334,7 +334,7 @@ extern gdb::optional<std::string> ext_lang_colorize_disasm
|
||||
All arguments are forwarded to extension_language_ops::print_insn, see
|
||||
that function for a full description. */
|
||||
|
||||
extern gdb::optional<int> ext_lang_print_insn
|
||||
extern std::optional<int> ext_lang_print_insn
|
||||
(struct gdbarch *gdbarch, CORE_ADDR address, struct disassemble_info *info);
|
||||
|
||||
#if GDB_SELF_TEST
|
||||
|
||||
@@ -306,7 +306,7 @@ protected:
|
||||
|
||||
/* Set and reset to handle removing intermediate values from the
|
||||
value chain. */
|
||||
gdb::optional<scoped_value_mark> m_mark;
|
||||
std::optional<scoped_value_mark> m_mark;
|
||||
};
|
||||
|
||||
/* A class used by FORTRAN_VALUE_SUBARRAY when repacking Fortran array
|
||||
|
||||
@@ -99,7 +99,7 @@ fbsd_nat_target::have_pending_event (ptid_t filter)
|
||||
|
||||
/* See fbsd-nat.h. */
|
||||
|
||||
gdb::optional<fbsd_nat_target::pending_event>
|
||||
std::optional<fbsd_nat_target::pending_event>
|
||||
fbsd_nat_target::take_pending_event (ptid_t filter)
|
||||
{
|
||||
for (auto it = m_pending_events.begin (); it != m_pending_events.end (); it++)
|
||||
@@ -1663,7 +1663,7 @@ fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
|
||||
target_options_to_string (target_options).c_str ());
|
||||
|
||||
/* If there is a valid pending event, return it. */
|
||||
gdb::optional<pending_event> event = take_pending_event (ptid);
|
||||
std::optional<pending_event> event = take_pending_event (ptid);
|
||||
if (event.has_value ())
|
||||
{
|
||||
/* Stop any other inferiors currently running. */
|
||||
@@ -1899,7 +1899,7 @@ fbsd_nat_target::detach_fork_children (inferior *inf)
|
||||
|
||||
while (1)
|
||||
{
|
||||
gdb::optional<pending_event> event = take_pending_event (ptid);
|
||||
std::optional<pending_event> event = take_pending_event (ptid);
|
||||
if (!event.has_value ())
|
||||
break;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef FBSD_NAT_H
|
||||
#define FBSD_NAT_H
|
||||
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "inf-ptrace.h"
|
||||
#include "regcache.h"
|
||||
#include "regset.h"
|
||||
@@ -262,7 +262,7 @@ private:
|
||||
FILTER. If there is a matching event, the event is removed from
|
||||
the pending list and returned. */
|
||||
|
||||
gdb::optional<pending_event> take_pending_event (ptid_t filter);
|
||||
std::optional<pending_event> take_pending_event (ptid_t filter);
|
||||
|
||||
/* List of pending events. */
|
||||
|
||||
|
||||
@@ -650,10 +650,10 @@ find_signalled_thread (struct thread_info *info, void *data)
|
||||
the data is prefixed with a 32-bit integer size to match the format
|
||||
used in FreeBSD NT_PROCSTAT_* notes. */
|
||||
|
||||
static gdb::optional<gdb::byte_vector>
|
||||
static std::optional<gdb::byte_vector>
|
||||
fbsd_make_note_desc (enum target_object object, uint32_t structsize)
|
||||
{
|
||||
gdb::optional<gdb::byte_vector> buf =
|
||||
std::optional<gdb::byte_vector> buf =
|
||||
target_read_alloc (current_inferior ()->top_target (), object, NULL);
|
||||
if (!buf || buf->empty ())
|
||||
return {};
|
||||
@@ -735,7 +735,7 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
|
||||
|
||||
/* Auxiliary vector. */
|
||||
uint32_t structsize = gdbarch_ptr_bit (gdbarch) / 4; /* Elf_Auxinfo */
|
||||
gdb::optional<gdb::byte_vector> note_desc =
|
||||
std::optional<gdb::byte_vector> note_desc =
|
||||
fbsd_make_note_desc (TARGET_OBJECT_AUXV, structsize);
|
||||
if (note_desc && !note_desc->empty ())
|
||||
{
|
||||
@@ -2340,7 +2340,7 @@ fbsd_vdso_range (struct gdbarch *gdbarch, struct mem_range *range)
|
||||
else
|
||||
{
|
||||
/* Fetch the list of address space entries from the running target. */
|
||||
gdb::optional<gdb::byte_vector> buf =
|
||||
std::optional<gdb::byte_vector> buf =
|
||||
target_read_alloc (current_inferior ()->top_target (),
|
||||
TARGET_OBJECT_FREEBSD_VMMAP, nullptr);
|
||||
if (!buf || buf->empty ())
|
||||
|
||||
@@ -302,7 +302,7 @@ gdb_bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size,
|
||||
const char *target)
|
||||
{
|
||||
std::unique_ptr<target_buffer> buffer
|
||||
= gdb::make_unique<target_buffer> (addr, size);
|
||||
= std::make_unique<target_buffer> (addr, size);
|
||||
|
||||
return gdb_bfd_openr_iovec (buffer->filename (), target,
|
||||
[&] (bfd *nbfd)
|
||||
|
||||
@@ -210,10 +210,10 @@ struct thread_suspend_state
|
||||
|
||||
- If the thread is running, then this field has its value removed by
|
||||
calling stop_pc.reset() (see thread_info::set_executing()).
|
||||
Attempting to read a gdb::optional with no value is undefined
|
||||
Attempting to read a std::optional with no value is undefined
|
||||
behaviour and will trigger an assertion error when _GLIBCXX_DEBUG is
|
||||
defined, which should make error easier to track down. */
|
||||
gdb::optional<CORE_ADDR> stop_pc;
|
||||
std::optional<CORE_ADDR> stop_pc;
|
||||
};
|
||||
|
||||
/* Base class for target-specific thread data. */
|
||||
@@ -645,7 +645,7 @@ extern void delete_thread_silent (struct thread_info *thread);
|
||||
available. If SILENT, then don't inform the CLI about the
|
||||
exit. */
|
||||
extern void set_thread_exited (thread_info *tp,
|
||||
gdb::optional<ULONGEST> exit_code = {},
|
||||
std::optional<ULONGEST> exit_code = {},
|
||||
bool silent = false);
|
||||
|
||||
/* Delete a step_resume_breakpoint from the thread database. */
|
||||
@@ -1042,7 +1042,7 @@ extern bool switch_to_thread_if_alive (thread_info *thr);
|
||||
exception if !FLAGS.SILENT and !FLAGS.CONT and CMD fails. */
|
||||
|
||||
extern void thread_try_catch_cmd (thread_info *thr,
|
||||
gdb::optional<int> ada_task,
|
||||
std::optional<int> ada_task,
|
||||
const char *cmd, int from_tty,
|
||||
const qcs_flags &flags);
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "gmp-utils.h"
|
||||
#include "rust-lang.h"
|
||||
#include "ada-lang.h"
|
||||
#include <memory>
|
||||
|
||||
/* The value of an invalid conversion badness. */
|
||||
#define INVALID_CONVERSION 100
|
||||
@@ -1045,7 +1046,7 @@ has_static_range (const struct range_bounds *bounds)
|
||||
|
||||
/* See gdbtypes.h. */
|
||||
|
||||
gdb::optional<LONGEST>
|
||||
std::optional<LONGEST>
|
||||
get_discrete_low_bound (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
@@ -1061,7 +1062,7 @@ get_discrete_low_bound (struct type *type)
|
||||
|
||||
if (type->target_type ()->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
gdb::optional<LONGEST> low_pos
|
||||
std::optional<LONGEST> low_pos
|
||||
= discrete_position (type->target_type (), low);
|
||||
|
||||
if (low_pos.has_value ())
|
||||
@@ -1112,7 +1113,7 @@ get_discrete_low_bound (struct type *type)
|
||||
|
||||
/* See gdbtypes.h. */
|
||||
|
||||
gdb::optional<LONGEST>
|
||||
std::optional<LONGEST>
|
||||
get_discrete_high_bound (struct type *type)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
@@ -1128,7 +1129,7 @@ get_discrete_high_bound (struct type *type)
|
||||
|
||||
if (type->target_type ()->code () == TYPE_CODE_ENUM)
|
||||
{
|
||||
gdb::optional<LONGEST> high_pos
|
||||
std::optional<LONGEST> high_pos
|
||||
= discrete_position (type->target_type (), high);
|
||||
|
||||
if (high_pos.has_value ())
|
||||
@@ -1191,11 +1192,11 @@ get_discrete_high_bound (struct type *type)
|
||||
bool
|
||||
get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
|
||||
{
|
||||
gdb::optional<LONGEST> low = get_discrete_low_bound (type);
|
||||
std::optional<LONGEST> low = get_discrete_low_bound (type);
|
||||
if (!low.has_value ())
|
||||
return false;
|
||||
|
||||
gdb::optional<LONGEST> high = get_discrete_high_bound (type);
|
||||
std::optional<LONGEST> high = get_discrete_high_bound (type);
|
||||
if (!high.has_value ())
|
||||
return false;
|
||||
|
||||
@@ -1243,7 +1244,7 @@ get_array_bounds (struct type *type, LONGEST *low_bound, LONGEST *high_bound)
|
||||
in which case the value of POS is unmodified.
|
||||
*/
|
||||
|
||||
gdb::optional<LONGEST>
|
||||
std::optional<LONGEST>
|
||||
discrete_position (struct type *type, LONGEST val)
|
||||
{
|
||||
if (type->code () == TYPE_CODE_RANGE)
|
||||
@@ -2534,7 +2535,7 @@ compute_variant_fields_inner (struct type *type,
|
||||
std::vector<bool> &flags)
|
||||
{
|
||||
/* Evaluate the discriminant. */
|
||||
gdb::optional<ULONGEST> discr_value;
|
||||
std::optional<ULONGEST> discr_value;
|
||||
if (part.discriminant_index != -1)
|
||||
{
|
||||
int idx = part.discriminant_index;
|
||||
@@ -2757,7 +2758,7 @@ resolve_dynamic_type_internal (struct type *type,
|
||||
if (!is_dynamic_type_internal (real_type, top_level))
|
||||
return type;
|
||||
|
||||
gdb::optional<CORE_ADDR> type_length;
|
||||
std::optional<CORE_ADDR> type_length;
|
||||
prop = TYPE_DYNAMIC_LENGTH (type);
|
||||
if (prop != NULL
|
||||
&& dwarf2_evaluate_property (prop, frame, addr_stack, &value))
|
||||
@@ -5833,7 +5834,7 @@ static const struct registry<objfile>::key<fixed_point_type_storage>
|
||||
void
|
||||
allocate_fixed_point_type_info (struct type *type)
|
||||
{
|
||||
auto up = gdb::make_unique<fixed_point_type_info> ();
|
||||
auto up = std::make_unique<fixed_point_type_info> ();
|
||||
fixed_point_type_info *info;
|
||||
|
||||
if (type->is_objfile_owned ())
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "hashtab.h"
|
||||
#include "gdbsupport/array-view.h"
|
||||
#include "gdbsupport/gdb-hashtab.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "gdbsupport/offset-type.h"
|
||||
#include "gdbsupport/enum-flags.h"
|
||||
#include "gdbsupport/underlying.h"
|
||||
@@ -2663,11 +2663,11 @@ extern bool get_discrete_bounds (struct type *type, LONGEST *lowp,
|
||||
|
||||
/* If TYPE's low bound is a known constant, return it, else return nullopt. */
|
||||
|
||||
extern gdb::optional<LONGEST> get_discrete_low_bound (struct type *type);
|
||||
extern std::optional<LONGEST> get_discrete_low_bound (struct type *type);
|
||||
|
||||
/* If TYPE's high bound is a known constant, return it, else return nullopt. */
|
||||
|
||||
extern gdb::optional<LONGEST> get_discrete_high_bound (struct type *type);
|
||||
extern std::optional<LONGEST> get_discrete_high_bound (struct type *type);
|
||||
|
||||
/* Assuming TYPE is a simple, non-empty array type, compute its upper
|
||||
and lower bound. Save the low bound into LOW_BOUND if not NULL.
|
||||
@@ -2679,7 +2679,7 @@ extern gdb::optional<LONGEST> get_discrete_high_bound (struct type *type);
|
||||
extern bool get_array_bounds (struct type *type, LONGEST *low_bound,
|
||||
LONGEST *high_bound);
|
||||
|
||||
extern gdb::optional<LONGEST> discrete_position (struct type *type,
|
||||
extern std::optional<LONGEST> discrete_position (struct type *type,
|
||||
LONGEST val);
|
||||
|
||||
extern int class_types_same_p (const struct type *, const struct type *);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "ui.h"
|
||||
#include "target.h"
|
||||
#include "guile-internal.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
|
||||
#ifdef HAVE_POLL
|
||||
#if defined (HAVE_POLL_H)
|
||||
@@ -602,7 +602,7 @@ ioscm_with_output_to_port_worker (SCM port, SCM thunk, enum oport oport,
|
||||
? &gdb_stderr : &gdb_stdout);
|
||||
|
||||
{
|
||||
gdb::optional<ui_out_redirect_pop> redirect_popper;
|
||||
std::optional<ui_out_redirect_pop> redirect_popper;
|
||||
if (oport == GDB_STDERR)
|
||||
gdb_stderr = port_file.get ();
|
||||
else
|
||||
|
||||
@@ -69,7 +69,7 @@ struct ia64_table_entry
|
||||
};
|
||||
|
||||
static struct ia64_table_entry *ktab = NULL;
|
||||
static gdb::optional<gdb::byte_vector> ktab_buf;
|
||||
static std::optional<gdb::byte_vector> ktab_buf;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2648,7 +2648,7 @@ ia64_access_mem (unw_addr_space_t as,
|
||||
}
|
||||
|
||||
/* Call low-level function to access the kernel unwind table. */
|
||||
static gdb::optional<gdb::byte_vector>
|
||||
static std::optional<gdb::byte_vector>
|
||||
getunwind_table ()
|
||||
{
|
||||
/* FIXME drow/2005-09-10: This code used to call
|
||||
|
||||
@@ -352,7 +352,7 @@ inf_child_target::fileio_unlink (struct inferior *inf, const char *filename,
|
||||
|
||||
/* Implementation of to_fileio_readlink. */
|
||||
|
||||
gdb::optional<std::string>
|
||||
std::optional<std::string>
|
||||
inf_child_target::fileio_readlink (struct inferior *inf, const char *filename,
|
||||
fileio_error *target_errno)
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
int fileio_unlink (struct inferior *inf,
|
||||
const char *filename,
|
||||
fileio_error *target_errno) override;
|
||||
gdb::optional<std::string> fileio_readlink (struct inferior *inf,
|
||||
std::optional<std::string> fileio_readlink (struct inferior *inf,
|
||||
const char *filename,
|
||||
fileio_error *target_errno) override;
|
||||
bool use_agent (bool use) override;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "ui.h"
|
||||
#include "interps.h"
|
||||
#include "skip.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "source.h"
|
||||
#include "cli/cli-style.h"
|
||||
#include "dwarf2/loc.h"
|
||||
@@ -2790,7 +2790,7 @@ notice_new_inferior (thread_info *thr, bool leave_running, int from_tty)
|
||||
enum attach_post_wait_mode mode
|
||||
= leave_running ? ATTACH_POST_WAIT_RESUME : ATTACH_POST_WAIT_NOTHING;
|
||||
|
||||
gdb::optional<scoped_restore_current_thread> restore_thread;
|
||||
std::optional<scoped_restore_current_thread> restore_thread;
|
||||
|
||||
if (inferior_ptid != null_ptid)
|
||||
restore_thread.emplace ();
|
||||
|
||||
@@ -731,10 +731,10 @@ switch_to_inferior_no_thread (inferior *inf)
|
||||
|
||||
/* See regcache.h. */
|
||||
|
||||
gdb::optional<scoped_restore_current_thread>
|
||||
std::optional<scoped_restore_current_thread>
|
||||
maybe_switch_inferior (inferior *inf)
|
||||
{
|
||||
gdb::optional<scoped_restore_current_thread> maybe_restore_thread;
|
||||
std::optional<scoped_restore_current_thread> maybe_restore_thread;
|
||||
if (inf != current_inferior ())
|
||||
{
|
||||
maybe_restore_thread.emplace ();
|
||||
|
||||
@@ -340,7 +340,7 @@ extern void switch_to_inferior_no_thread (inferior *inf);
|
||||
|
||||
If the current inferior was changed, return an RAII object that will
|
||||
restore the original current context. */
|
||||
extern gdb::optional<scoped_restore_current_thread> maybe_switch_inferior
|
||||
extern std::optional<scoped_restore_current_thread> maybe_switch_inferior
|
||||
(inferior *inf);
|
||||
|
||||
/* Info about an inferior's target description. There's one of these
|
||||
|
||||
@@ -113,9 +113,9 @@ static struct terminal_info *get_inflow_inferior_data (struct inferior *);
|
||||
we save our handlers in these two variables and set SIGINT and SIGQUIT
|
||||
to SIG_IGN. */
|
||||
|
||||
static gdb::optional<sighandler_t> sigint_ours;
|
||||
static std::optional<sighandler_t> sigint_ours;
|
||||
#ifdef SIGQUIT
|
||||
static gdb::optional<sighandler_t> sigquit_ours;
|
||||
static std::optional<sighandler_t> sigquit_ours;
|
||||
#endif
|
||||
|
||||
/* The name of the tty (from the `tty' command) that we're giving to
|
||||
|
||||
12
gdb/infrun.c
12
gdb/infrun.c
@@ -62,7 +62,7 @@
|
||||
#include "thread-fsm.h"
|
||||
#include "gdbsupport/enum-flags.h"
|
||||
#include "progspace-and-thread.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "arch-utils.h"
|
||||
#include "gdbsupport/scope-exit.h"
|
||||
#include "gdbsupport/forward-scope-exit.h"
|
||||
@@ -711,7 +711,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
|
||||
{
|
||||
/* If FOLLOW_CHILD, we leave CHILD_INF as the current inferior
|
||||
(do not restore the parent as the current inferior). */
|
||||
gdb::optional<scoped_restore_current_thread> maybe_restore;
|
||||
std::optional<scoped_restore_current_thread> maybe_restore;
|
||||
|
||||
if (!follow_child && !sched_multi)
|
||||
maybe_restore.emplace ();
|
||||
@@ -4399,7 +4399,7 @@ fetch_inferior_event ()
|
||||
debugging. If we're looking at traceframes while the target is
|
||||
running, we're going to need to get back to that mode after
|
||||
handling the event. */
|
||||
gdb::optional<scoped_restore_current_traceframe> maybe_restore_traceframe;
|
||||
std::optional<scoped_restore_current_traceframe> maybe_restore_traceframe;
|
||||
if (non_stop)
|
||||
{
|
||||
maybe_restore_traceframe.emplace ();
|
||||
@@ -4772,7 +4772,7 @@ adjust_pc_after_break (struct thread_info *thread,
|
||||
|| (target_is_non_stop_p ()
|
||||
&& moribund_breakpoint_here_p (aspace, breakpoint_pc)))
|
||||
{
|
||||
gdb::optional<scoped_restore_tmpl<int>> restore_operation_disable;
|
||||
std::optional<scoped_restore_tmpl<int>> restore_operation_disable;
|
||||
|
||||
if (record_full_is_used ())
|
||||
restore_operation_disable.emplace
|
||||
@@ -6722,7 +6722,7 @@ handle_signal_stop (struct execution_control_state *ecs)
|
||||
decr_pc = gdbarch_decr_pc_after_break (gdbarch);
|
||||
if (decr_pc != 0)
|
||||
{
|
||||
gdb::optional<scoped_restore_tmpl<int>>
|
||||
std::optional<scoped_restore_tmpl<int>>
|
||||
restore_operation_disable;
|
||||
|
||||
if (record_full_is_used ())
|
||||
@@ -8930,7 +8930,7 @@ normal_stop ()
|
||||
else if (last.kind () != TARGET_WAITKIND_NO_RESUMED)
|
||||
finish_ptid = inferior_ptid;
|
||||
|
||||
gdb::optional<scoped_finish_thread_state> maybe_finish_thread_state;
|
||||
std::optional<scoped_finish_thread_state> maybe_finish_thread_state;
|
||||
if (finish_ptid != null_ptid)
|
||||
{
|
||||
maybe_finish_thread_state.emplace
|
||||
|
||||
@@ -430,7 +430,7 @@ interps_notify_new_thread (thread_info *t)
|
||||
|
||||
void
|
||||
interps_notify_thread_exited (thread_info *t,
|
||||
gdb::optional<ULONGEST> exit_code,
|
||||
std::optional<ULONGEST> exit_code,
|
||||
int silent)
|
||||
{
|
||||
interps_notify (&interp::on_thread_exited, t, exit_code, silent);
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
|
||||
/* Notify the interpreter that thread T has exited. */
|
||||
virtual void on_thread_exited (thread_info *,
|
||||
gdb::optional<ULONGEST> exit_code,
|
||||
std::optional<ULONGEST> exit_code,
|
||||
int silent) {}
|
||||
|
||||
/* Notify the interpreter that inferior INF was added. */
|
||||
@@ -292,7 +292,7 @@ extern void interps_notify_new_thread (thread_info *t);
|
||||
|
||||
/* Notify all interpreters that thread T has exited. */
|
||||
extern void interps_notify_thread_exited (thread_info *t,
|
||||
gdb::optional<ULONGEST> exit_code,
|
||||
std::optional<ULONGEST> exit_code,
|
||||
int silent);
|
||||
|
||||
/* Notify all interpreters that inferior INF was added. */
|
||||
|
||||
@@ -76,7 +76,7 @@ maint_info_jit_cmd (const char *args, int from_tty)
|
||||
inferior *inf = current_inferior ();
|
||||
bool printed_header = false;
|
||||
|
||||
gdb::optional<ui_out_emit_table> table_emitter;
|
||||
std::optional<ui_out_emit_table> table_emitter;
|
||||
|
||||
/* Print a line for each JIT-ed objfile. */
|
||||
for (objfile *obj : inf->pspace->objfiles ())
|
||||
|
||||
@@ -641,7 +641,7 @@ default_symbol_name_matcher (const char *symbol_search_name,
|
||||
const lookup_name_info &lookup_name,
|
||||
completion_match_result *comp_match_res)
|
||||
{
|
||||
gdb::string_view name = lookup_name.name ();
|
||||
std::string_view name = lookup_name.name ();
|
||||
completion_match_for_lcd *match_for_lcd
|
||||
= (comp_match_res != NULL ? &comp_match_res->match_for_lcd : NULL);
|
||||
strncmp_iw_mode mode = (lookup_name.completion_mode ()
|
||||
|
||||
@@ -4003,7 +4003,7 @@ linux_proc_xfer_memory_partial (int pid, gdb_byte *readbuf,
|
||||
static bool
|
||||
proc_mem_file_is_writable ()
|
||||
{
|
||||
static gdb::optional<bool> writable;
|
||||
static std::optional<bool> writable;
|
||||
|
||||
if (writable.has_value ())
|
||||
return *writable;
|
||||
@@ -4424,7 +4424,7 @@ linux_nat_target::fileio_open (struct inferior *inf, const char *filename,
|
||||
|
||||
/* Implementation of to_fileio_readlink. */
|
||||
|
||||
gdb::optional<std::string>
|
||||
std::optional<std::string>
|
||||
linux_nat_target::fileio_readlink (struct inferior *inf, const char *filename,
|
||||
fileio_error *target_errno)
|
||||
{
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
int flags, int mode, int warn_if_slow,
|
||||
fileio_error *target_errno) override;
|
||||
|
||||
gdb::optional<std::string>
|
||||
std::optional<std::string>
|
||||
fileio_readlink (struct inferior *inf,
|
||||
const char *filename,
|
||||
fileio_error *target_errno) override;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "gdbcmd.h"
|
||||
#include "gdbsupport/gdb_regex.h"
|
||||
#include "gdbsupport/enum-flags.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "gcore.h"
|
||||
#include "gcore-elf.h"
|
||||
#include "solib-svr4.h"
|
||||
@@ -229,7 +229,7 @@ struct linux_info
|
||||
int vsyscall_range_p = 0;
|
||||
|
||||
/* Inferior's displaced step buffers. */
|
||||
gdb::optional<displaced_step_buffers> disp_step_bufs;
|
||||
std::optional<displaced_step_buffers> disp_step_bufs;
|
||||
};
|
||||
|
||||
/* Per-inferior data key. */
|
||||
@@ -457,13 +457,13 @@ struct mapping
|
||||
{
|
||||
ULONGEST addr;
|
||||
ULONGEST endaddr;
|
||||
gdb::string_view permissions;
|
||||
std::string_view permissions;
|
||||
ULONGEST offset;
|
||||
gdb::string_view device;
|
||||
std::string_view device;
|
||||
ULONGEST inode;
|
||||
|
||||
/* This field is guaranteed to be NULL-terminated, hence it is not a
|
||||
gdb::string_view. */
|
||||
std::string_view. */
|
||||
const char *filename;
|
||||
};
|
||||
|
||||
@@ -589,7 +589,7 @@ struct mapping_regexes
|
||||
static int
|
||||
mapping_is_anonymous_p (const char *filename)
|
||||
{
|
||||
static gdb::optional<mapping_regexes> regexes;
|
||||
static std::optional<mapping_regexes> regexes;
|
||||
static int init_regex_p = 0;
|
||||
|
||||
if (!init_regex_p)
|
||||
@@ -873,7 +873,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args,
|
||||
if (cwd_f)
|
||||
{
|
||||
xsnprintf (filename, sizeof filename, "/proc/%ld/cwd", pid);
|
||||
gdb::optional<std::string> contents
|
||||
std::optional<std::string> contents
|
||||
= target_fileio_readlink (NULL, filename, &target_errno);
|
||||
if (contents.has_value ())
|
||||
gdb_printf ("cwd = '%s'\n", contents->c_str ());
|
||||
@@ -883,7 +883,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args,
|
||||
if (exe_f)
|
||||
{
|
||||
xsnprintf (filename, sizeof filename, "/proc/%ld/exe", pid);
|
||||
gdb::optional<std::string> contents
|
||||
std::optional<std::string> contents
|
||||
= target_fileio_readlink (NULL, filename, &target_errno);
|
||||
if (contents.has_value ())
|
||||
gdb_printf ("exe = '%s'\n", contents->c_str ());
|
||||
@@ -1384,7 +1384,7 @@ parse_smaps_data (const char *data,
|
||||
|
||||
/* Decode permissions. */
|
||||
auto has_perm = [&m] (char c)
|
||||
{ return m.permissions.find (c) != gdb::string_view::npos; };
|
||||
{ return m.permissions.find (c) != std::string_view::npos; };
|
||||
read = has_perm ('r');
|
||||
write = has_perm ('w');
|
||||
exec = has_perm ('x');
|
||||
@@ -2108,7 +2108,7 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
|
||||
return NULL;
|
||||
|
||||
/* Auxillary vector. */
|
||||
gdb::optional<gdb::byte_vector> auxv =
|
||||
std::optional<gdb::byte_vector> auxv =
|
||||
target_read_alloc (current_inferior ()->top_target (),
|
||||
TARGET_OBJECT_AUXV, NULL);
|
||||
if (auxv && !auxv->empty ())
|
||||
@@ -2675,7 +2675,7 @@ linux_displaced_step_restore_all_in_ptid (inferior *parent_inf, ptid_t ptid)
|
||||
/* Helper for linux_get_hwcap and linux_get_hwcap2. */
|
||||
|
||||
static CORE_ADDR
|
||||
linux_get_hwcap_helper (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
linux_get_hwcap_helper (const std::optional<gdb::byte_vector> &auxv,
|
||||
target_ops *target, gdbarch *gdbarch, CORE_ADDR match)
|
||||
{
|
||||
CORE_ADDR field;
|
||||
@@ -2688,7 +2688,7 @@ linux_get_hwcap_helper (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
/* See linux-tdep.h. */
|
||||
|
||||
CORE_ADDR
|
||||
linux_get_hwcap (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
linux_get_hwcap (const std::optional<gdb::byte_vector> &auxv,
|
||||
target_ops *target, gdbarch *gdbarch)
|
||||
{
|
||||
return linux_get_hwcap_helper (auxv, target, gdbarch, AT_HWCAP);
|
||||
@@ -2707,7 +2707,7 @@ linux_get_hwcap ()
|
||||
/* See linux-tdep.h. */
|
||||
|
||||
CORE_ADDR
|
||||
linux_get_hwcap2 (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
linux_get_hwcap2 (const std::optional<gdb::byte_vector> &auxv,
|
||||
target_ops *target, gdbarch *gdbarch)
|
||||
{
|
||||
return linux_get_hwcap_helper (auxv, target, gdbarch, AT_HWCAP2);
|
||||
|
||||
@@ -94,7 +94,7 @@ extern int linux_is_uclinux (void);
|
||||
parse auxv entries.
|
||||
|
||||
On error, 0 is returned. */
|
||||
extern CORE_ADDR linux_get_hwcap (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
extern CORE_ADDR linux_get_hwcap (const std::optional<gdb::byte_vector> &auxv,
|
||||
struct target_ops *target, gdbarch *gdbarch);
|
||||
|
||||
/* Same as the above, but obtain all the inputs from the current inferior. */
|
||||
@@ -105,7 +105,7 @@ extern CORE_ADDR linux_get_hwcap ();
|
||||
parse auxv entries.
|
||||
|
||||
On error, 0 is returned. */
|
||||
extern CORE_ADDR linux_get_hwcap2 (const gdb::optional<gdb::byte_vector> &auxv,
|
||||
extern CORE_ADDR linux_get_hwcap2 (const std::optional<gdb::byte_vector> &auxv,
|
||||
struct target_ops *target, gdbarch *gdbarch);
|
||||
|
||||
/* Same as the above, but obtain all the inputs from the current inferior. */
|
||||
|
||||
@@ -312,7 +312,7 @@ struct thread_db_thread_info : public private_thread_info
|
||||
/* Cached thread state. */
|
||||
td_thrhandle_t th {};
|
||||
thread_t tid {};
|
||||
gdb::optional<gdb::byte_vector> thread_handle;
|
||||
std::optional<gdb::byte_vector> thread_handle;
|
||||
};
|
||||
|
||||
static thread_db_thread_info *
|
||||
|
||||
@@ -361,7 +361,7 @@ get_init_files (std::vector<std::string> *system_gdbinit,
|
||||
{
|
||||
/* Cache the file lookup object so we only actually search for the files
|
||||
once. */
|
||||
static gdb::optional<gdb_initfile_finder> init_files;
|
||||
static std::optional<gdb_initfile_finder> init_files;
|
||||
if (!init_files.has_value ())
|
||||
init_files.emplace (GDBINIT, SYSTEM_GDBINIT, SYSTEM_GDBINIT_RELOCATABLE,
|
||||
SYSTEM_GDBINIT_DIR, SYSTEM_GDBINIT_DIR_RELOCATABLE,
|
||||
@@ -381,7 +381,7 @@ get_earlyinit_files (std::string *home_gdbearlyinit)
|
||||
{
|
||||
/* Cache the file lookup object so we only actually search for the files
|
||||
once. */
|
||||
static gdb::optional<gdb_initfile_finder> init_files;
|
||||
static std::optional<gdb_initfile_finder> init_files;
|
||||
if (!init_files.has_value ())
|
||||
init_files.emplace (GDBEARLYINIT, nullptr, false, nullptr, false, false);
|
||||
|
||||
|
||||
@@ -3050,7 +3050,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
switch (p[1])
|
||||
{
|
||||
case 'S':
|
||||
pst->add_psymbol (gdb::string_view (namestring,
|
||||
pst->add_psymbol (std::string_view (namestring,
|
||||
p - namestring),
|
||||
true, VAR_DOMAIN, LOC_STATIC,
|
||||
SECT_OFF_DATA (objfile),
|
||||
@@ -3063,7 +3063,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
/* The addresses in these entries are reported
|
||||
to be wrong. See the code that reads 'G's
|
||||
for symtabs. */
|
||||
pst->add_psymbol (gdb::string_view (namestring,
|
||||
pst->add_psymbol (std::string_view (namestring,
|
||||
p - namestring),
|
||||
true, VAR_DOMAIN, LOC_STATIC,
|
||||
SECT_OFF_DATA (objfile),
|
||||
@@ -3085,7 +3085,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
&& namestring[0] != ' '))
|
||||
{
|
||||
pst->add_psymbol
|
||||
(gdb::string_view (namestring, p - namestring),
|
||||
(std::string_view (namestring, p - namestring),
|
||||
true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
|
||||
psymbol_placement::STATIC,
|
||||
unrelocated_addr (0),
|
||||
@@ -3095,7 +3095,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
{
|
||||
/* Also a typedef with the same name. */
|
||||
pst->add_psymbol
|
||||
(gdb::string_view (namestring,
|
||||
(std::string_view (namestring,
|
||||
p - namestring),
|
||||
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
|
||||
psymbol_placement::STATIC,
|
||||
@@ -3111,7 +3111,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
just :T... */
|
||||
{
|
||||
pst->add_psymbol
|
||||
(gdb::string_view (namestring,
|
||||
(std::string_view (namestring,
|
||||
p - namestring),
|
||||
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
|
||||
psymbol_placement::STATIC,
|
||||
@@ -3178,7 +3178,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
/* Note that the value doesn't matter for
|
||||
enum constants in psymtabs, just in
|
||||
symtabs. */
|
||||
pst->add_psymbol (gdb::string_view (p,
|
||||
pst->add_psymbol (std::string_view (p,
|
||||
q - p),
|
||||
true, VAR_DOMAIN,
|
||||
LOC_CONST, -1,
|
||||
@@ -3199,7 +3199,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
continue;
|
||||
case 'c':
|
||||
/* Constant, e.g. from "const" in Pascal. */
|
||||
pst->add_psymbol (gdb::string_view (namestring,
|
||||
pst->add_psymbol (std::string_view (namestring,
|
||||
p - namestring),
|
||||
true, VAR_DOMAIN, LOC_CONST, -1,
|
||||
psymbol_placement::STATIC,
|
||||
@@ -3215,7 +3215,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
function_outside_compilation_unit_complaint
|
||||
(copy.c_str ());
|
||||
}
|
||||
pst->add_psymbol (gdb::string_view (namestring,
|
||||
pst->add_psymbol (std::string_view (namestring,
|
||||
p - namestring),
|
||||
true, VAR_DOMAIN, LOC_BLOCK,
|
||||
SECT_OFF_TEXT (objfile),
|
||||
@@ -3236,7 +3236,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
function_outside_compilation_unit_complaint
|
||||
(copy.c_str ());
|
||||
}
|
||||
pst->add_psymbol (gdb::string_view (namestring,
|
||||
pst->add_psymbol (std::string_view (namestring,
|
||||
p - namestring),
|
||||
true, VAR_DOMAIN, LOC_BLOCK,
|
||||
SECT_OFF_TEXT (objfile),
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "extension.h"
|
||||
#include <ctype.h>
|
||||
#include "mi-parse.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "gdbsupport/gdb-safe-ctype.h"
|
||||
#include "inferior.h"
|
||||
#include "observable.h"
|
||||
@@ -515,7 +515,7 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
|
||||
arg->val->type ()->length ()))))
|
||||
return;
|
||||
|
||||
gdb::optional<ui_out_emit_tuple> tuple_emitter;
|
||||
std::optional<ui_out_emit_tuple> tuple_emitter;
|
||||
if (values != PRINT_NO_VALUES || what == all)
|
||||
tuple_emitter.emplace (uiout, nullptr);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "mi-getopt.h"
|
||||
#include "gdbthread.h"
|
||||
#include "mi-parse.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "inferior.h"
|
||||
|
||||
static void varobj_update_one (struct varobj *var,
|
||||
|
||||
@@ -183,7 +183,7 @@ mi_command::mi_command (const char *name, int *suppress_notification)
|
||||
|
||||
/* See mi-cmds.h. */
|
||||
|
||||
gdb::optional<scoped_restore_tmpl<int>>
|
||||
std::optional<scoped_restore_tmpl<int>>
|
||||
mi_command::do_suppress_notification () const
|
||||
{
|
||||
if (m_suppress_notification != nullptr)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#define MI_MI_CMDS_H
|
||||
|
||||
#include "gdbsupport/function-view.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "mi/mi-main.h"
|
||||
|
||||
enum print_values {
|
||||
@@ -180,12 +180,12 @@ struct mi_command
|
||||
|
||||
/* If this command was created with a suppress notifications pointer,
|
||||
then this function will set the suppress flag and return a
|
||||
gdb::optional with its value set to an object that will restore the
|
||||
std::optional with its value set to an object that will restore the
|
||||
previous value of the suppress notifications flag.
|
||||
|
||||
If this command was created without a suppress notifications points,
|
||||
then this function returns an empty gdb::optional. */
|
||||
gdb::optional<scoped_restore_tmpl<int>> do_suppress_notification () const;
|
||||
then this function returns an empty std::optional. */
|
||||
std::optional<scoped_restore_tmpl<int>> do_suppress_notification () const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ mi_interp::on_new_thread (thread_info *t)
|
||||
|
||||
void
|
||||
mi_interp::on_thread_exited (thread_info *t,
|
||||
gdb::optional<ULONGEST> /* exit_code */,
|
||||
std::optional<ULONGEST> /* exit_code */,
|
||||
int /* silent */)
|
||||
{
|
||||
target_terminal::scoped_restore_terminal_state term_state;
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
void on_command_error () override;
|
||||
void on_user_selected_context_changed (user_selected_what selection) override;
|
||||
void on_new_thread (thread_info *t) override;
|
||||
void on_thread_exited (thread_info *t, gdb::optional<ULONGEST> exit_code,
|
||||
void on_thread_exited (thread_info *t, std::optional<ULONGEST> exit_code,
|
||||
int silent) override;
|
||||
void on_inferior_added (inferior *inf) override;
|
||||
void on_inferior_appeared (inferior *inf) override;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user