From cbe820a2e0bb3c22e6bfab56729b3951236e3ac1 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Thu, 7 May 2026 22:33:46 +0800 Subject: [PATCH] log.level help: Don't show `0:DEBUG` on Release builds (#6319) * log.level help: Don't show `0:DEBUG` on Release builds * Use `choco install python310` instead --- .appveyor.yml | 2 +- librz/core/canalysis.c | 2 +- librz/core/cconfig.c | 8 ++++++-- test/db/formats/elf/sections | 24 ------------------------ test/db/formats/elf/tiny | 24 ++++++++++++++++++++++++ 5 files changed, 32 insertions(+), 28 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 8cdda9f5d0..30ee85fe1a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -61,7 +61,7 @@ init: # Required software for building install: # Install Python 3.10 - - cmd: if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( choco install python --version=3.10.11 ) + - cmd: if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( choco install python310 ) # Update environment variables - ps: $env:RZ_VERSION = (& (Join-Path $env:PYTHON python.exe) sys\\version.py ) - ps: $env:DIST_FOLDER = "rizin-$env:builder-$env:RZ_VERSION" diff --git a/librz/core/canalysis.c b/librz/core/canalysis.c index dbe8ad4bc7..b7fdf51840 100644 --- a/librz/core/canalysis.c +++ b/librz/core/canalysis.c @@ -1438,7 +1438,7 @@ RZ_API int rz_core_analysis_fcn(RzCore *core, ut64 at, ut64 from, int reftype, i if (core->io->va) { if (!rz_io_is_valid_offset(core->io, at, !aopt->noncode)) { - RZ_LOG_DEBUG("address not mapped or not executable at 0x%08" PFMT64x "\n", at); + RZ_LOG_VERBOSE("Address not mapped or not executable at 0x%" PFMT64x ".\n", at); return false; } } diff --git a/librz/core/cconfig.c b/librz/core/cconfig.c index ebd0d25c9b..0851c6d99b 100644 --- a/librz/core/cconfig.c +++ b/librz/core/cconfig.c @@ -3352,8 +3352,12 @@ RZ_API int rz_core_config_init(RzCore *core) { /* log */ // RZ_LOGLEVEL / log.level p = rz_sys_getenv("RZ_LOGLEVEL"); - SETICB("log.level", p ? atoi(p) : RZ_DEFAULT_LOGLVL, cb_log_config_level, "Target log level/severity" - " (0:DEBUG, 1:VERBOSE, 2:INFO, 3:WARN, 4:ERROR, 5:FATAL)"); + const char *log_level_help = "Target log level/severity (" +#if RZ_BUILD_DEBUG + "0:DEBUG, " +#endif + "1:VERBOSE, 2:INFO, 3:WARN, 4:ERROR, 5:FATAL)"; + SETICB("log.level", p ? atoi(p) : RZ_DEFAULT_LOGLVL, cb_log_config_level, log_level_help); free(p); #if RZ_BUILD_DEBUG diff --git a/test/db/formats/elf/sections b/test/db/formats/elf/sections index 49f7d72d58..c63ce844b7 100644 --- a/test/db/formats/elf/sections +++ b/test/db/formats/elf/sections @@ -150,30 +150,6 @@ WARNING: Failed to initialize section string table. EOF RUN -NAME=elf warnings -FILE=bins/elf/analysis/tiny.elf -CMDS=iSS -EXPECT=< binary size (45 bytes). -WARNING: phdr entry: p_offset (0x0) and p_vaddr (0x10000) are not congruent for p_align (0xc0312ab3). -WARNING: The segment 0 at 0x4 seems to be invalid. -WARNING: ELF header e_shstrndx value (0) >= number of sections (0). -WARNING: Failed to initialize section string table. -EOF -RUN - NAME=disable segments checks FILE=bins/elf/analysis/tiny.elf ARGS=-e elf.checks.segments=false diff --git a/test/db/formats/elf/tiny b/test/db/formats/elf/tiny index 76747b299e..a56120b16c 100644 --- a/test/db/formats/elf/tiny +++ b/test/db/formats/elf/tiny @@ -4,6 +4,10 @@ CMDS=< binary size (45 bytes). +WARNING: phdr entry: p_offset (0x0) and p_vaddr (0x10000) are not congruent for p_align (0xc0312ab3). +WARNING: The segment 0 at 0x4 seems to be invalid. +WARNING: ELF header e_shstrndx value (0) >= number of sections (0). +WARNING: Failed to initialize section string table. +ERROR: Failed to read chunk of size 0x101 at 0x10020 for disassembly. +VERBOSE: Address not mapped or not executable at 0x10020. EOF RUN