size_t m_len;
static int read_memory (bfd_vma memaddr, gdb_byte *myaddr,
- unsigned int len, struct disassemble_info *info)
+ unsigned int len,
+ struct disassemble_info *info) noexcept
{
gdb_disassembler_test *self
= static_cast<gdb_disassembler_test *>(info->application_data);
static int read_memory (bfd_vma memaddr, gdb_byte *myaddr,
unsigned int len,
- struct disassemble_info *info)
+ struct disassemble_info *info) noexcept
{
/* Always return an error. */
return -1;
int
gdb_disassembler_memory_reader::dis_asm_read_memory
(bfd_vma memaddr, gdb_byte *myaddr, unsigned int len,
- struct disassemble_info *info)
+ struct disassemble_info *info) noexcept
{
return target_read_code (memaddr, myaddr, len);
}
/* Wrapper of memory_error. */
void
-gdb_disassembler::dis_asm_memory_error (int err, bfd_vma memaddr,
- struct disassemble_info *info)
+gdb_disassembler::dis_asm_memory_error
+ (int err, bfd_vma memaddr, struct disassemble_info *info) noexcept
{
gdb_disassembler *self
= static_cast<gdb_disassembler *>(info->application_data);
/* Wrapper of print_address. */
void
-gdb_disassembler::dis_asm_print_address (bfd_vma addr,
- struct disassemble_info *info)
+gdb_disassembler::dis_asm_print_address
+ (bfd_vma addr, struct disassemble_info *info) noexcept
{
gdb_disassembler *self
= static_cast<gdb_disassembler *>(info->application_data);
int
gdb_printing_disassembler::fprintf_func (void *dis_info,
- const char *format, ...)
+ const char *format, ...) noexcept
{
ui_file *stream = stream_from_gdb_disassemble_info (dis_info);
/* See disasm.h. */
int
-gdb_printing_disassembler::fprintf_styled_func (void *dis_info,
- enum disassembler_style style,
- const char *format, ...)
+gdb_printing_disassembler::fprintf_styled_func
+ (void *dis_info, enum disassembler_style style,
+ const char *format, ...) noexcept
{
ui_file *stream = stream_from_gdb_disassemble_info (dis_info);
gdb_printing_disassembler *dis = (gdb_printing_disassembler *) dis_info;
/* See disasm.h. */
int
-gdb_non_printing_disassembler::null_fprintf_func (void *stream,
- const char *format, ...)
+gdb_non_printing_disassembler::null_fprintf_func
+ (void *stream, const char *format, ...) noexcept
{
return 0;
}
int
gdb_non_printing_disassembler::null_fprintf_styled_func
- (void *stream, enum disassembler_style style, const char *format, ...)
+ (void *stream, enum disassembler_style style,
+ const char *format, ...) noexcept
{
return 0;
}
protected:
- /* Types for the function callbacks within m_di. */
+ /* Types for the function callbacks within m_di. It would be nice if
+ these function types were all defined to include the noexcept
+ keyword, as every implementation of these must be noexcept. However,
+ using noexcept within a function typedef like this is a C++17
+ feature, trying to do this for earlier C++ versions results in a
+ warning from GCC/Clang, and the noexcept isn't checked. After we
+ move to C++17 these should be updated to add noexcept. */
using read_memory_ftype = decltype (disassemble_info::read_memory_func);
using memory_error_ftype = decltype (disassemble_info::memory_error_func);
using print_address_ftype = decltype (disassemble_info::print_address_func);
/* Callback used as the disassemble_info's fprintf_func callback. The
DIS_INFO pointer is a pointer to a gdb_printing_disassembler object.
Content is written to the m_stream extracted from DIS_INFO. */
- static int fprintf_func (void *dis_info, const char *format, ...)
+ static int fprintf_func (void *dis_info, const char *format, ...) noexcept
ATTRIBUTE_PRINTF(2,3);
/* Callback used as the disassemble_info's fprintf_styled_func callback.
object. Content is written to the m_stream extracted from DIS_INFO. */
static int fprintf_styled_func (void *dis_info,
enum disassembler_style style,
- const char *format, ...)
+ const char *format, ...) noexcept
ATTRIBUTE_PRINTF(3,4);
/* Return true if the disassembler is considered inside a comment, false
/* Callback used as the disassemble_info's fprintf_func callback, this
doesn't write anything to STREAM, but just returns 0. */
- static int null_fprintf_func (void *stream, const char *format, ...)
+ static int null_fprintf_func (void *stream, const char *format, ...) noexcept
ATTRIBUTE_PRINTF(2,3);
/* Callback used as the disassemble_info's fprintf_styled_func callback,
, this doesn't write anything to STREAM, but just returns 0. */
static int null_fprintf_styled_func (void *stream,
enum disassembler_style style,
- const char *format, ...)
+ const char *format, ...) noexcept
ATTRIBUTE_PRINTF(3,4);
};
/* Implements the read_memory_func disassemble_info callback. */
static int dis_asm_read_memory (bfd_vma memaddr, gdb_byte *myaddr,
unsigned int len,
- struct disassemble_info *info);
+ struct disassemble_info *info) noexcept;
};
/* A non-printing disassemble_info management class. The disassemble_info
static bool use_ext_lang_colorization_p;
static void dis_asm_memory_error (int err, bfd_vma memaddr,
- struct disassemble_info *info);
+ struct disassemble_info *info) noexcept;
static void dis_asm_print_address (bfd_vma addr,
- struct disassemble_info *info);
+ struct disassemble_info *info) noexcept;
/* Return true if we should use the extension language to apply
disassembler styling. This requires disassembler styling to be on
static int
gdbscm_disasm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
unsigned int length,
- struct disassemble_info *dinfo)
+ struct disassemble_info *dinfo) noexcept
{
gdbscm_disassembler *self
= static_cast<gdbscm_disassembler *> (dinfo->application_data);
/* Callbacks used by disassemble_info. */
static void memory_error_func (int status, bfd_vma memaddr,
- struct disassemble_info *info);
+ struct disassemble_info *info) noexcept;
static void print_address_func (bfd_vma addr,
- struct disassemble_info *info);
+ struct disassemble_info *info) noexcept;
static int read_memory_func (bfd_vma memaddr, gdb_byte *buff,
unsigned int len,
- struct disassemble_info *info);
+ struct disassemble_info *info) noexcept;
/* Return a reference to an optional that contains the address at which a
memory error occurred. The optional will only have a value if a
int
gdbpy_disassembler::read_memory_func (bfd_vma memaddr, gdb_byte *buff,
unsigned int len,
- struct disassemble_info *info)
+ struct disassemble_info *info) noexcept
{
gdbpy_disassembler *dis
= static_cast<gdbpy_disassembler *> (info->application_data);
void
gdbpy_disassembler::memory_error_func (int status, bfd_vma memaddr,
- struct disassemble_info *info)
+ struct disassemble_info *info) noexcept
{
gdbpy_disassembler *dis
= static_cast<gdbpy_disassembler *> (info->application_data);
void
gdbpy_disassembler::print_address_func (bfd_vma addr,
- struct disassemble_info *info)
+ struct disassemble_info *info) noexcept
{
gdbpy_disassembler *dis
= static_cast<gdbpy_disassembler *> (info->application_data);