Skip to content
Merged
2 changes: 1 addition & 1 deletion cmake/Modules/AddWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(TARGET_ADD_WARNINGS TARGET)
-Wunused
-Woverloaded-virtual
-pedantic
#-Wconversion
-Wconversion
#-Wsign-conversion
#-Wnull-dereference
-Wdouble-promotion
Expand Down
24 changes: 12 additions & 12 deletions edb.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
<project_license>GPL-2.0</project_license>
<name>edb</name>
<summary>Reverse engineer's debugger</summary>
<!--
<!--
<developer id="io.github.eteran">
<name>edb-debugger</name>
</developer>
-->
-->
<developer_name>edb-debugger</developer_name>
<description>
<p>edb is a cross platform x86/x86-64 debugger. It was inspired by OllyDbg,
but aims to function on x86 and x86-64 as well as multiple OS's.
</p>
<p>Linux is the only officially supported platform at the moment, but FreeBSD,
OpenBSD, OSX and Windows ports are underway with varying degrees of functionality.
</p>
<p>edb is a cross platform x86/x86-64 debugger. It was inspired by OllyDbg,
but aims to function on x86 and x86-64 as well as multiple OS's.
</p>
<p>Linux is the only officially supported platform at the moment, but FreeBSD,
OpenBSD, OSX and Windows ports are underway with varying degrees of functionality.
</p>
</description>
<screenshots>
<screenshot type="default" width="1121" height="839">
<image>http://codef00.com/img/debugger.png</image>
<caption>Main Window, with disassembly, data, stack and registers</caption>
</screenshot>
<image>http://codef00.com/img/debugger.png</image>
<caption>Main Window, with disassembly, data, stack and registers</caption>
</screenshot>
</screenshots>
<update_contact>evan.teran_at_gmail.com</update_contact>
<url type="homepage">https://github.com/eteran/edb-debugger</url>
Expand All @@ -36,7 +36,7 @@
<content_attribute id="social-info">mild</content_attribute>
</content_rating>
<releases>
<release version="1.5.0" date="2024-03-22"></release>
<release version="1.5.0" date="2024-03-22"></release>
<release version="1.4.0" date="2023-06-30"></release>
</releases>
</component>
2 changes: 1 addition & 1 deletion include/BasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class EDB_EXPORT BasicBlock {
[[nodiscard]] bool empty() const;

public:
void swap(BasicBlock &other);
void swap(BasicBlock &other) noexcept;

public:
[[nodiscard]] QString toString() const;
Expand Down
2 changes: 1 addition & 1 deletion include/BinaryString.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class EDB_EXPORT BinaryString : public QWidget {
};

public:
BinaryString(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
explicit BinaryString(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~BinaryString() override;

private Q_SLOTS:
Expand Down
2 changes: 1 addition & 1 deletion include/ByteShiftArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class EDB_EXPORT ByteShiftArray {
ByteShiftArray &shl();
ByteShiftArray &shr();
void clear();
void swap(ByteShiftArray &other);
void swap(ByteShiftArray &other) noexcept;

public:
ByteShiftArray &operator<<(uint8_t x);
Expand Down
2 changes: 1 addition & 1 deletion include/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class EDB_EXPORT Configuration : public QObject {
Q_OBJECT
public:
Configuration(QObject *parent = nullptr);
explicit Configuration(QObject *parent = nullptr);
~Configuration() override;

public:
Expand Down
2 changes: 1 addition & 1 deletion include/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class EDB_EXPORT Function {
[[nodiscard]] int referenceCount() const;

public:
void swap(Function &other);
void swap(Function &other) noexcept;

private:
int referenceCount_ = 0;
Expand Down
2 changes: 1 addition & 1 deletion include/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
class Register;
class QString;

namespace DebuggerCorePlugin {

Check warning on line 18 in include/State.h

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this namespace to match the regular expression: ^[a-z][a-z_0-9]*$

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh9WD0Hd6Uj2xv4k&open=AZ0Ekh9WD0Hd6Uj2xv4k&pullRequest=888
class DebuggerCore;
class PlatformThread;
}

// NOTE(eteran): the purpose of this class is simply to give IState objects
// value semantics, so it tends to nearly replicate that interface.
class EDB_EXPORT State {

Check failure on line 25 in include/State.h

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this class' destructor, copy constructor, move constructor, copy assignment operator and move assignment operator so that the class follows the rule of Zero.

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh9WD0Hd6Uj2xv4l&open=AZ0Ekh9WD0Hd6Uj2xv4l&pullRequest=888

// TODO(eteran): I don't like needing to do this
// need to revisit the IState/State/PlatformState stuff...
Expand All @@ -38,7 +38,7 @@
~State();

public:
void swap(State &other);
void swap(State &other) noexcept;

public:
[[nodiscard]] bool empty() const;
Expand Down
11 changes: 10 additions & 1 deletion include/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ namespace v1 {
EDB_EXPORT bool debuggeeIs32Bit();
}

// TODO(eteran): honestly, this whole file is filled with conversions, so the warnings about conversions are not really helpful.
// Of course, we should audit the code to make sure that all conversions are intentional and safe. For now, suppress the warnings
// about conversions in this file as it's just too loud when they are enabled.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"

namespace detail {

template <class Integer>
Expand Down Expand Up @@ -225,7 +232,7 @@ class value_type {
}

public:
void swap(value_type &other) {
void swap(value_type &other) noexcept {
using std::swap;
swap(value_, other.value_);
}
Expand Down Expand Up @@ -854,6 +861,8 @@ static_assert(sizeof(value_type80) * 8 == 80, "value_type80 size is broken!");

}

#pragma GCC diagnostic pop

// GPR on x86
using value8 = detail::value_type<uint8_t>;
using value16 = detail::value_type<uint16_t>;
Expand Down
6 changes: 3 additions & 3 deletions include/edb.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

struct ExpressionError;

namespace RegisterViewModelBase {

Check warning on line 43 in include/edb.h

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this namespace to match the regular expression: ^[a-z][a-z_0-9]*$

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh8RD0Hd6Uj2xv4g&open=AZ0Ekh8RD0Hd6Uj2xv4g&pullRequest=888
class Model;
}

Expand All @@ -62,7 +62,7 @@
EDB_EXPORT extern IDebugger *debugger_core;
EDB_EXPORT extern QWidget *debugger_ui;

// the symbol mananger
// the symbol manager
EDB_EXPORT ISymbolManager &symbol_manager();

// the memory region manager
Expand All @@ -74,7 +74,7 @@
// widgets
EDB_EXPORT QAbstractScrollArea *disassembly_widget();

// breakpoint managment
// breakpoint management
EDB_EXPORT std::shared_ptr<IBreakpoint> find_breakpoint(address_t address);
EDB_EXPORT std::shared_ptr<IBreakpoint> find_triggered_breakpoint(address_t address);
EDB_EXPORT QString get_breakpoint_condition(address_t address);
Expand Down Expand Up @@ -175,7 +175,7 @@

// these are here and not members of state because
// they may require using the debugger core plugin and
// we don't want to force a dependancy between the two
// we don't want to force a dependency between the two
EDB_EXPORT void pop_value(State *state);
EDB_EXPORT void push_value(State *state, reg_t value);

Expand Down
8 changes: 4 additions & 4 deletions include/util/Container.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ namespace util {

template <class T, size_t N, class U = T>
constexpr void shl(std::array<T, N> &buffer, U value = T()) {
static_assert(std::is_convertible_v<T, U>, "U must be convertible to the type contained in the array!");
static_assert(std::is_convertible_v<U, T>, "U must be convertible to the type contained in the array!");
std::rotate(buffer.begin(), buffer.begin() + 1, buffer.end());
buffer[N - 1] = value;
buffer[N - 1] = static_cast<T>(value);
}

template <class T, size_t N, class U = T>
constexpr void shr(std::array<T, N> &buffer, U value = T()) {
static_assert(std::is_convertible_v<T, U>, "U must be convertible to the type contained in the array!");
static_assert(std::is_convertible_v<U, T>, "U must be convertible to the type contained in the array!");
std::rotate(buffer.rbegin(), buffer.rbegin() + 1, buffer.rend());
buffer[0] = value;
buffer[0] = static_cast<T>(value);
}

template <class T, size_t N>
Expand Down
2 changes: 1 addition & 1 deletion include/util/Math.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int percentage(N1 regions_finished, N2 regions_total, N3 bytes_done, N4 bytes_to
const auto region_step = 1.0f / static_cast<float>(regions_total) * 100.0f;

// how many regions are done?
const float regions_complete = region_step * regions_finished;
const float regions_complete = region_step * static_cast<float>(regions_finished);

// how much of the current region is done?
const float region_percent = region_step * static_cast<float>(bytes_done) / static_cast<float>(bytes_total);
Expand Down
4 changes: 2 additions & 2 deletions lib/libELF/include/libELF/elf_syminfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ constexpr auto ELF32_ST_INFO(T1 bind, T2 type) {
/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */
template <class T>
constexpr uint8_t ELF64_ST_BIND(T val) {
return ELF32_ST_BIND(val);
return static_cast<uint8_t>(ELF32_ST_BIND(val));
}

template <class T>
constexpr uint8_t ELF64_ST_TYPE(T val) {
return ELF32_ST_TYPE(val);
return static_cast<uint8_t>(ELF32_ST_TYPE(val));
}

template <class T1, class T2>
Expand Down
14 changes: 7 additions & 7 deletions plugins/Analyzer/AnalyzerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <QPixmap>
#include <QScrollBar>

namespace AnalyzerPlugin {

Check warning on line 27 in plugins/Analyzer/AnalyzerWidget.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this namespace to match the regular expression: ^[a-z][a-z_0-9]*$

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh4ID0Hd6Uj2xv4E&open=AZ0Ekh4ID0Hd6Uj2xv4E&pullRequest=888

/**
* @brief AnalyzerWidget::AnalyzerWidget
Expand Down Expand Up @@ -72,7 +72,7 @@
const QSet<edb::address_t> specified_functions = edb::v1::analyzer()->specifiedFunctions();
const IAnalyzer::FunctionMap functions = edb::v1::analyzer()->functions(region);

const auto byte_width = static_cast<float>(width()) / region->size();
const auto byte_width = static_cast<double>(width()) / static_cast<double>(region->size());

if (!cache_ || width() != cache_->width() || height() != cache_->height() || cacheNumFuncs_ != functions.size()) {

Expand All @@ -85,8 +85,8 @@
for (auto it = functions.begin(); it != functions.end(); ++it) {
const Function &f = it.value();

const auto first_offset = static_cast<int>((f.entryAddress() - region->start()) * byte_width);
const auto last_offset = static_cast<int>((f.endAddress() - region->start()) * byte_width);
const auto first_offset = static_cast<int>(static_cast<double>(f.entryAddress() - region->start()) * byte_width);
const auto last_offset = static_cast<int>(static_cast<double>(f.endAddress() - region->start()) * byte_width);

if (!specified_functions.contains(f.entryAddress())) {
painter.fillRect(first_offset, 0, last_offset - first_offset, height(), QBrush(Qt::darkGreen));
Expand All @@ -97,7 +97,7 @@

// highlight header of binary (probably not going to be too noticeable but just in case)
if (std::unique_ptr<IBinary> binary_info = edb::v1::get_binary_info(region)) {
painter.fillRect(0, 0, static_cast<int>(binary_info->headerSize() * byte_width), height(), QBrush(Qt::darkBlue));
painter.fillRect(0, 0, static_cast<int>(static_cast<double>(binary_info->headerSize()) * byte_width), height(), QBrush(Qt::darkBlue));
}
}

Expand All @@ -108,7 +108,7 @@
if (auto scroll_area = qobject_cast<QAbstractScrollArea *>(edb::v1::disassembly_widget())) {
if (QScrollBar *scrollbar = scroll_area->verticalScrollBar()) {
QFontMetrics fm(font());
const auto offset = static_cast<int>(scrollbar->value() * byte_width);
const auto offset = static_cast<int>(static_cast<double>(scrollbar->value()) * byte_width);

const QString triangle(QChar(0x25b4));

Expand Down Expand Up @@ -148,12 +148,12 @@
if (const std::shared_ptr<IRegion> region = edb::v1::current_cpu_view_region()) {
const IAnalyzer::FunctionMap functions = edb::v1::analyzer()->functions(region);
if (region->size() != 0 && !functions.empty()) {
const auto byte_width = static_cast<float>(width()) / region->size();
const auto byte_width = static_cast<double>(width()) / static_cast<double>(region->size());

const edb::address_t start = region->start();
const edb::address_t end = region->end();

edb::address_t offset = start + static_cast<int>(event->x() / byte_width);
edb::address_t offset = start + static_cast<std::uint64_t>(event->x() / byte_width);

const edb::address_t address = qBound<edb::address_t>(start, offset, end - 1);
edb::v1::jump_to_address(address);
Expand Down
4 changes: 2 additions & 2 deletions plugins/Backtrace/DialogBacktrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <QPushButton>
#include <QTableWidget>

namespace BacktracePlugin {

Check warning on line 18 in plugins/Backtrace/DialogBacktrace.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this namespace to match the regular expression: ^[a-z][a-z_0-9]*$

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh63D0Hd6Uj2xv4a&open=AZ0Ekh63D0Hd6Uj2xv4a&pullRequest=888
namespace {

// Default values in the table
Expand Down Expand Up @@ -157,7 +157,7 @@
for (size_t i = 0; i < size; i++) {

// Create the row to insert info
table_->insertRow(i);
table_->insertRow(static_cast<int>(i));

// Get the stack frame so that we can insert its info
CallStack::StackFrame *frame = call_stack[i];
Expand Down Expand Up @@ -192,7 +192,7 @@
flags |= Qt::ItemIsEnabled | Qt::ItemIsSelectable;
item->setFlags(flags);

table_->setItem(i, j, item);
table_->setItem(static_cast<int>(i), j, item);
}
}

Expand Down
8 changes: 4 additions & 4 deletions plugins/BinaryInfo/symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
static constexpr uint32_t elf_r_sym(uint32_t x) { return ELF32_R_SYM(x); }
static constexpr uint32_t elf_r_type(uint32_t x) { return ELF32_R_TYPE(x); }
static constexpr uint8_t elf_st_type(uint8_t x) { return ELF32_ST_TYPE(x); }
static constexpr uint8_t elf_st_bind(uint8_t x) { return ELF32_ST_BIND(x); }
static constexpr uint8_t elf_st_bind(uint8_t x) { return static_cast<uint8_t>(ELF32_ST_BIND(x)); }

struct symbol {
elf_addr address;
Expand Down Expand Up @@ -68,7 +68,7 @@
static constexpr uint64_t elf_r_sym(uint64_t x) { return ELF64_R_SYM(x); }
static constexpr uint64_t elf_r_type(uint64_t x) { return ELF64_R_TYPE(x); }
static constexpr uint8_t elf_st_type(uint8_t x) { return ELF64_ST_TYPE(x); }
static constexpr uint8_t elf_st_bind(uint8_t x) { return ELF64_ST_BIND(x); }
static constexpr uint8_t elf_st_bind(uint8_t x) { return static_cast<uint8_t>(ELF64_ST_BIND(x)); }

struct symbol {
elf_addr address;
Expand Down Expand Up @@ -221,7 +221,7 @@
}

auto section_entries_count = section->sh_entsize ? section->sh_size / section->sh_entsize : 0;
switch (section->sh_type) {

Check failure on line 224 in plugins/BinaryInfo/symbols.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a "default" case to this switch statement.

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh31D0Hd6Uj2xv4B&open=AZ0Ekh31D0Hd6Uj2xv4B&pullRequest=888
case SHT_RELA: {
elf_addr n = 0;
auto relocation = reinterpret_cast<elf_rela *>(base + section->sh_offset);
Expand All @@ -241,7 +241,7 @@
auto symbol_tab = reinterpret_cast<elf_sym *>(base + linked->sh_offset);
auto string_tab = reinterpret_cast<const char *>(base + sections_begin[linked->sh_link].sh_offset);

const elf_addr symbol_address = base_address + (n * M::plt_entry_size);
const auto symbol_address = static_cast<elf_addr>(base_address + (n * M::plt_entry_size));

const char *sym_name = &section_strings[section->sh_name];
if (strlen(sym_name) > (sizeof(".rela.") - 1) && memcmp(sym_name, ".rela.", (sizeof(".rela.") - 1)) == 0) {
Expand Down Expand Up @@ -280,7 +280,7 @@
auto symbol_tab = reinterpret_cast<elf_sym *>(base + linked->sh_offset);
auto string_tab = reinterpret_cast<const char *>(base + sections_begin[linked->sh_link].sh_offset);

const elf_addr symbol_address = base_address + (n * M::plt_entry_size);
const auto symbol_address = static_cast<elf_addr>(base_address + (n * M::plt_entry_size));

const char *sym_name = &section_strings[section->sh_name];
if (strlen(sym_name) > (sizeof(".rel.") - 1) && memcmp(sym_name, ".rel.", (sizeof(".rel.") - 1)) == 0) {
Expand All @@ -306,7 +306,7 @@
// collect regular symbols
for (const elf_shdr *section = sections_begin; section != sections_end; ++section) {

switch (section->sh_type) {

Check failure on line 309 in plugins/BinaryInfo/symbols.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a "default" case to this switch statement.

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh31D0Hd6Uj2xv4C&open=AZ0Ekh31D0Hd6Uj2xv4C&pullRequest=888
case SHT_SYMTAB:
case SHT_DYNSYM: {
auto symbol_tab = reinterpret_cast<elf_sym *>(base + section->sh_offset);
Expand Down Expand Up @@ -343,7 +343,7 @@
// collect unnamed symbols
for (const elf_shdr *section = sections_begin; section != sections_end; ++section) {

switch (section->sh_type) {

Check failure on line 346 in plugins/BinaryInfo/symbols.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a "default" case to this switch statement.

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh31D0Hd6Uj2xv4D&open=AZ0Ekh31D0Hd6Uj2xv4D&pullRequest=888
case SHT_SYMTAB:
case SHT_DYNSYM: {
auto symbol_tab = reinterpret_cast<elf_sym *>(base + section->sh_offset);
Expand Down
4 changes: 3 additions & 1 deletion plugins/CheckVersion/CheckVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <QSettings>
#include <QUrl>

namespace CheckVersionPlugin {

Check warning on line 24 in plugins/CheckVersion/CheckVersion.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this namespace to match the regular expression: ^[a-z][a-z_0-9]*$

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh6jD0Hd6Uj2xv4Z&open=AZ0Ekh6jD0Hd6Uj2xv4Z&pullRequest=888

/**
* @brief CheckVersion::CheckVersion
Expand Down Expand Up @@ -100,8 +100,10 @@

if (!proxy_str.isEmpty()) {
const QUrl proxy_url = QUrl::fromUserInput(proxy_str);
const int port = proxy_url.port(80);
const auto qport = static_cast<quint16>(qBound(0, port, 65535));

proxy = QNetworkProxy(QNetworkProxy::HttpProxy, proxy_url.host(), proxy_url.port(80), proxy_url.userName(), proxy_url.password());
proxy = QNetworkProxy(QNetworkProxy::HttpProxy, proxy_url.host(), qport, proxy_url.userName(), proxy_url.password());
}

#else
Expand Down
6 changes: 3 additions & 3 deletions plugins/DebuggerCore/unix/linux/PlatformProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,19 @@
if (edb::v1::debuggeeIs64Bit()) {
elf64_auxv_t entry;
while (auxv.read(reinterpret_cast<char *>(&entry), sizeof(entry))) {
switch (entry.a_type) {

Check failure on line 230 in plugins/DebuggerCore/unix/linux/PlatformProcess.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a "default" case to this switch statement.

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh3JD0Hd6Uj2xv38&open=AZ0Ekh3JD0Hd6Uj2xv38&pullRequest=888
case AT_PHDR:
*phdr_memaddr = entry.a_un.a_val;
break;
case AT_PHNUM:
*num_phdr = entry.a_un.a_val;
*num_phdr = static_cast<int>(entry.a_un.a_val);
break;
}
}
} else if (edb::v1::debuggeeIs32Bit()) {
elf32_auxv_t entry;
while (auxv.read(reinterpret_cast<char *>(&entry), sizeof(entry))) {
switch (entry.a_type) {

Check failure on line 242 in plugins/DebuggerCore/unix/linux/PlatformProcess.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a "default" case to this switch statement.

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh3JD0Hd6Uj2xv39&open=AZ0Ekh3JD0Hd6Uj2xv39&pullRequest=888
case AT_PHDR:
*phdr_memaddr = entry.a_un.a_val;
break;
Expand Down Expand Up @@ -389,8 +389,8 @@

Patch patch;
patch.address = address;
patch.origBytes.resize(len);
patch.newBytes = QByteArray(static_cast<const char *>(buf), len);
patch.origBytes.resize(static_cast<int>(len));
patch.newBytes = QByteArray(static_cast<const char *>(buf), static_cast<int>(len));

size_t read_ret = readBytes(address, patch.origBytes.data(), len);
if (read_ret != len) {
Expand Down Expand Up @@ -579,7 +579,7 @@
const QString map_file(QStringLiteral("/proc/%1/maps").arg(pid_));

// hash the region file to see if it changed or not
{

Check warning on line 582 in plugins/DebuggerCore/unix/linux/PlatformProcess.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Extract this nested code block into a separate function.

See more on https://sonarcloud.io/project/issues?id=eteran_edb-debugger&issues=AZ0Ekh3JD0Hd6Uj2xv3-&open=AZ0Ekh3JD0Hd6Uj2xv3-&pullRequest=888
static size_t totalHash = 0;

std::ifstream mf(map_file.toStdString());
Expand Down
2 changes: 1 addition & 1 deletion plugins/DebuggerCore/unix/linux/PlatformThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int PlatformThread::priority() const {
struct user_stat thread_stat;
int n = get_user_task_stat(process_->pid(), tid_, &thread_stat);
if (n >= 18) {
return thread_stat.priority;
return static_cast<int>(thread_stat.priority);
}

return 0;
Expand Down
Loading
Loading