Skip to content

Commit 045034b

Browse files
committed
CMD: allow for printing data sections
1 parent ea5dc1a commit 045034b

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

chb/app/CHVersion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
chbversion: str = "0.3.0-20250826"
1+
chbversion: str = "0.3.0-20250902"

chb/cmdline/AnalysisManager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ def disassemble(
221221
collectdiagnostics: bool = True,
222222
preamble_cutoff: int = 12,
223223
save_asm: str = "yes",
224-
save_asm_cfg_info: bool = False) -> None:
224+
save_asm_cfg_info: bool = False,
225+
print_datasections: List[str] = []) -> None:
225226
cwd = os.getcwd()
226227
chklogger.logger.debug("change directory to %s", self.path)
227228
os.chdir(self.path) # temporary change in directory
@@ -258,6 +259,8 @@ def disassemble(
258259
cmd.extend(["-so_library", s])
259260
for ifile in self.ifilenames:
260261
cmd.extend(["-ifile", ifile])
262+
for ds in print_datasections:
263+
cmd.extend(["-print_datasection", ds])
261264
if save_xml:
262265
cmd.append("-save_disassembly_status_in_xml")
263266
cmd.extend(["-disassemble", self.filename])

chb/cmdline/chkx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,11 @@ def parse() -> argparse.Namespace:
482482
+ "listed in the userdata function entry points"),
483483
nargs="*",
484484
default=[])
485+
analyzecmd.add_argument(
486+
"--print_datasections",
487+
nargs="*",
488+
default=[],
489+
help="names or addresses of data sections to be included in assembly listing")
485490
analyzecmd.add_argument(
486491
"--gc_compact",
487492
type=int,

chb/cmdline/commandutil.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ def analyzecmd(args: argparse.Namespace) -> NoReturn:
399399
failonfunctionfailure: bool = args.fail_on_function_failure
400400
save_asm: bool = args.save_asm
401401
save_asm_cfg_info: bool = args.save_asm_cfg_info
402+
print_datasections: List[str] = args.print_datasections
402403
thumb: List[str] = args.thumb
403404
preamble_cutoff: int = args.preamble_cutoff
404405
iterations: int = args.iterations
@@ -552,7 +553,8 @@ def analyzecmd(args: argparse.Namespace) -> NoReturn:
552553
verbose=verbose,
553554
collectdiagnostics=collectdiagnostics,
554555
preamble_cutoff=preamble_cutoff,
555-
save_asm_cfg_info=save_asm_cfg_info)
556+
save_asm_cfg_info=save_asm_cfg_info,
557+
print_datasections=print_datasections)
556558
except subprocess.CalledProcessError as e:
557559
print_error(str(e.output))
558560
print_error(str(e))

0 commit comments

Comments
 (0)