Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chb/app/CHVersion.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
chbversion: str = "0.3.0-20260802"
chbversion: str = "0.3.0-20260811"

minimum_required_chb_version = "0.6.0_20260802"
10 changes: 6 additions & 4 deletions chb/arm/ARMCallOpcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -297,8 +297,9 @@ def ast_call_prov(
if finfo.has_call_target(iaddr):
calltarget = finfo.call_target(iaddr)
if calltarget.is_unknown:
chklogger.logger.error(
"BL: Indirect call not yet handled at address %s", iaddr)
chklogger.diagnostic(
DC.UNSUPPORTED,
"Indirect call not yet handled at address %s", iaddr)

if finfo.has_call_target_info(iaddr):
ctinfo = finfo.call_target_info(iaddr)
Expand Down Expand Up @@ -509,7 +510,8 @@ def ast_call_prov(
hl_arg = astree.mk_address_of(
astree.mk_vinfo_lval(vinfo))
else:
chklogger.logger.error(
chklogger.diagnostic(
DC.USERDATA,
("Unknown global address %s as call "
+ "argument at address %s"),
hexgaddr, iaddr)
Expand Down
12 changes: 7 additions & 5 deletions chb/arm/ARMOpcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -440,8 +440,9 @@ def ast_prov(
List[AST.ASTInstruction], List[AST.ASTInstruction]]:
"""Return default; should be overridden by instruction opcodes."""

chklogger.logger.error(
"no lifting support available for instruction %s at address %s",
chklogger.diagnostic(
DC.UNSUPPORTED,
"No lifting support available for instruction %s at address %s",
self.mnemonic, iaddr)
instrs = self.ast(astree, iaddr, bytestring, xdata)
return (instrs, instrs)
Expand Down Expand Up @@ -497,8 +498,9 @@ def ast_cc_condition_prov(
return (hl_astcond, ll_astcond)

else:
chklogger.logger.error(
"No condition found at address %s", iaddr)
chklogger.diagnostic(
DC.UNSUPPORTED,
"Conditional branch without inferred condition %s", iaddr)
hl_astcond = astree.mk_temp_lval_expression()
return (hl_astcond, ll_astcond)

Expand Down
8 changes: 5 additions & 3 deletions chb/arm/opcodes/ARMAdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -260,7 +260,8 @@ def ast_prov(
annotations: List[str] = [iaddr, "ADD"]

if xdata.is_aggregate_jumptable:
chklogger.logger.warning(
chklogger.diagnostic(
DC.UNSUPPORTED,
"ADD: aggregate jumptable at address %s not yet handled",
iaddr)
return ([], [])
Expand Down Expand Up @@ -306,7 +307,8 @@ def has_cast() -> bool:
xrhs = xd.result

else:
chklogger.logger.error(
chklogger.diagnostic(
DC.INTERNAL,
"ADD: Encountered error value for rhs at address %s", iaddr)
return ([], [ll_assign])

Expand Down
9 changes: 5 additions & 4 deletions chb/arm/opcodes/ARMBranch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2025 Aarno Labs LLC
# Copyright (c) 2021-2026 Aarno Labs LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -50,7 +50,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -374,8 +374,9 @@ def default(condition: XXpr) -> AST.ASTExpr:
else:
condition = xd.txpr
else:
chklogger.logger.error(
"Bcc: conditional branch without branch conditions "
chklogger.diagnostic(
DC.UNSUPPORTED,
"Conditional branch without inferred branch condition "
+ "at address %s", iaddr)
hl_astcond = astree.mk_temp_lval_expression()
return (hl_astcond, ll_astcond)
Expand Down
7 changes: 4 additions & 3 deletions chb/arm/opcodes/ARMLoadMultipleIncrementAfter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2025 Aarno Labs LLC
# Copyright (c) 2021-2026 Aarno Labs LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -40,7 +40,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC

if TYPE_CHECKING:
from chb.arm.ARMDictionary import ARMDictionary
Expand Down Expand Up @@ -282,7 +282,8 @@ def ast_prov(
rhsexprs = xd.memrhss

else:
chklogger.logger.error(
chklogger.diagnostic(
DC.INTERNAL,
"LDM: Error value encountered at address %s", iaddr)
return ([], [])

Expand Down
10 changes: 6 additions & 4 deletions chb/arm/opcodes/ARMLoadRegister.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2025 Aarno Labs LLC
# Copyright (c) 2021-2026 Aarno Labs LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -42,7 +42,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -255,7 +255,8 @@ def has_cast() -> bool:
lhs = xd.vrt

if str(lhs) == "PC":
chklogger.logger.error(
chklogger.diagnostic(
DC.UNSUPPORTED,
"LDR: Indirect call via Load to PC not yet handled at %s",
iaddr)
return ([], (ll_pre + [ll_assign] + ll_post))
Expand All @@ -279,7 +280,8 @@ def has_cast() -> bool:
hl_rhs = XU.xmemory_dereference_lval_expr(
xaddr, xdata, iaddr, astree)

chklogger.logger.warning(
chklogger.diagnostic(
DC.INTERNAL,
"LDR: Unable to use a C expression for rhs. Fall back to "
+ "native byte-based address: %s to form rhs %s at address %s",
str(xaddr), str(hl_rhs), iaddr)
Expand Down
10 changes: 6 additions & 4 deletions chb/arm/opcodes/ARMLoadRegisterByte.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2025 Aarno Labs LLC
# Copyright (c) 2021-2026 Aarno Labs LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -42,7 +42,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -278,13 +278,15 @@ def has_cast() -> bool:
hl_rhs = XU.xmemory_dereference_lval_expr(
xaddr, xdata, iaddr, astree)

chklogger.logger.warning(
chklogger.diagnostic(
DC.INTERNAL,
"LDRB: Unable to use a C expression for rhs. Fall back to "
+ "native byte-based address: %s to form rhs %s at address %s",
str(xaddr), str(hl_rhs), iaddr)

else:
chklogger.logger.error(
chklogger.diagnostic(
DC.INTERNAL,
"LDRB: both memory value and address values are error values "
+ "at address %s: ", iaddr)
return ([], (ll_pre + [ll_assign] + ll_post))
Expand Down
10 changes: 6 additions & 4 deletions chb/arm/opcodes/ARMLoadRegisterHalfword.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2025 Aarno Labs LLC
# Copyright (c) 2021-2026 Aarno Labs LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -42,7 +42,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC

if TYPE_CHECKING:
from chb.arm.ARMDictionary import ARMDictionary
Expand Down Expand Up @@ -271,13 +271,15 @@ def has_cast() -> bool:
hl_rhs = XU.xmemory_dereference_lval_expr(
xaddr, xdata, iaddr, astree)

chklogger.logger.warning(
chklogger.diagnostic(
DC.INTERNAL,
"LDRH: Unable to use a C expression for rhs. Fall back to "
+ "native byte-based address: %s to form rhs %s at address %s",
str(xaddr), str(hl_rhs), iaddr)

else:
chklogger.logger.error(
chklogger.diagnostic(
DC.INTERNAL,
"LDRH: both memory value and address values are error values "
+ "at address %s: ", iaddr)
return ([], (ll_pre + [ll_assign] + ll_post))
Expand Down
5 changes: 3 additions & 2 deletions chb/arm/opcodes/ARMMove.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -518,7 +518,8 @@ def ast_prov_ternary_assign(
xd = ARMMoveXData(xdata)

if xd.is_nondet_ternary_assign:
chklogger.logger.warning(
chklogger.diagnostic(
DC.INTERNAL,
"Ternary assignment without associated predicate at address %s",
iaddr)
return ([], [ll_assign])
Expand Down
9 changes: 5 additions & 4 deletions chb/arm/opcodes/ARMPop.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2025 Aarno Labs LLC
# Copyright (c) 2021-2026 Aarno Labs LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -40,7 +40,7 @@
import chb.invariants.XXprUtil as XU

import chb.util.fileutil as UF
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC
from chb.util.IndexedTable import IndexedTableValue

if TYPE_CHECKING:
Expand Down Expand Up @@ -236,8 +236,9 @@ def ast_prov(

xd = ARMPopXData(xdata)
if not xd.is_ok:
chklogger.logger.error(
"Encountered error value at address %s", iaddr)
chklogger.diagnostic(
DC.INTERNAL,
"POP: Encountered error value at address %s", iaddr)
return ([], [])

splhs = xd.splhs
Expand Down
10 changes: 6 additions & 4 deletions chb/arm/opcodes/ARMStoreMultipleIncrementAfter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2025 Aarno Labs LLC
# Copyright (c) 2021-2026 Aarno Labs LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -40,7 +40,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -511,7 +511,8 @@ def ast_prov(
elif xd.are_memlhss_ok:
memlhss = xd.memlhss
else:
chklogger.logger.error(
chklogger.diagnostic(
DC.INTERNAL,
"STM: Error value encountered in LHSs at address %s", iaddr)
return ([], [])

Expand All @@ -520,7 +521,8 @@ def ast_prov(
elif xd.are_rrhss_ok:
regrhss = xd.rhss
else:
chklogger.logger.error(
chklogger.diagnostic(
DC.INTERNAL,
"STM: Error value encountered in RHSs at address %s", iaddr)
return ([], [])

Expand Down
7 changes: 4 additions & 3 deletions chb/arm/opcodes/ARMStoreMultipleIncrementBefore.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2025 Aarno Labs LLC
# Copyright (c) 2021-2026 Aarno Labs LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -40,7 +40,7 @@

import chb.util.fileutil as UF
from chb.util.IndexedTable import IndexedTableValue
from chb.util.loggingutil import chklogger
from chb.util.loggingutil import chklogger, DiagnosticCategory as DC


if TYPE_CHECKING:
Expand Down Expand Up @@ -135,7 +135,8 @@ def ast_prov(

xd = ARMStoreMultipleIncrementBeforeXData(xdata)
if not xd.is_ok:
chklogger.logger.error(
chklogger.diagnostic(
DC.INTERNAL,
"STMIB: Error value encountered at address %s", iaddr)
return ([], [])

Expand Down
Loading