1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:17:36 +00:00

Everywhere: Replace a bundle of dbg with dbgln.

These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
This commit is contained in:
asynts 2021-01-17 20:28:43 +01:00 committed by Andreas Kling
parent 24888457d5
commit fb8d3635d9
9 changed files with 99 additions and 69 deletions

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/Debug.h>
#include <AK/LogStream.h>
#include <AK/MappedFile.h>
#include <AK/QuickSort.h>
@ -35,8 +36,6 @@
#include <stdio.h>
#include <string.h>
//#define DISASM_DUMP
int main(int argc, char** argv)
{
const char* path = nullptr;
@ -100,10 +99,10 @@ int main(int argc, char** argv)
return a.size < b.size;
return a.name < b.name;
});
#ifdef DISASM_DUMP
for (size_t i = 0; i < symbols.size(); ++i)
dbg() << symbols[i].name << ": " << (void*)(uintptr_t)symbols[i].value << ", " << symbols[i].size;
#endif
if constexpr (debug_disasm_dump) {
for (size_t i = 0; i < symbols.size(); ++i)
dbgln("{}: {:p}, {}", symbols[i].name, symbols[i].value, symbols[i].size);
}
}
}

View file

@ -121,8 +121,8 @@ static bool mount_all()
int fd = get_source_fd(filename);
dbg() << "Mounting " << filename << "(" << fstype << ")"
<< " on " << mountpoint;
dbgln("Mounting {} ({}) on {}", filename, fstype, mountpoint);
int rc = mount(fd, mountpoint, fstype, flags);
if (rc != 0) {
fprintf(stderr, "Failed to mount %s (FD: %d) (%s) on %s: %s\n", filename, fd, fstype, mountpoint, strerror(errno));

View file

@ -1832,7 +1832,7 @@ static void rsa_test_encrypt()
if (memcmp(buf.data(), "hellohellohellohellohellohellohellohellohello123-", 49))
FAIL(Invalid encryption);
else {
dbg() << "out size " << buf.size() << " values: " << StringView { (char*)buf.data(), buf.size() };
dbgln("out size {} values {}", buf.size(), StringView { (char*)buf.data(), buf.size() });
PASS;
}
@ -1999,7 +1999,8 @@ static void rsa_test_encrypt_decrypt()
"9527497237087650398000977129550904920919162360737979403539302312977329868395261515707123424679295515888026193056908173564681660256268221509339074678416049"_bigint,
"39542231845947188736992321577701849924317746648774438832456325878966594812143638244746284968851807975097653255909707366086606867657273809465195392910913"_bigint,
"65537"_bigint);
dbg() << "Output size: " << rsa.output_size();
dbgln("Output size: {}", rsa.output_size());
u8 enc_buffer[rsa.output_size()];
u8 dec_buffer[rsa.output_size()];
@ -2012,7 +2013,7 @@ static void rsa_test_encrypt_decrypt()
rsa.encrypt(enc, dec);
rsa.decrypt(dec, enc);
dbg() << "enc size " << enc.size() << " dec size " << dec.size();
dbgln("enc size {} dec size {}", enc.size(), dec.size());
if (memcmp(enc.data(), "WellHelloFriendsWellHelloFriendsWellHelloFriendsWellHelloFriends", 64) != 0) {
FAIL(Could not encrypt then decrypt);