mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-26 20:26:53 +00:00
Meta: Pass ladybird.py extra arguments to the target process
Let's behave a bit more like the run command here. This allows us to run `ladybird.py profile js zlib.js`, for example.
This commit is contained in:
parent
afda3aba14
commit
f8d414ec37
Notes:
github-actions[bot]
2025-08-17 23:44:59 +00:00
Author: https://github.com/trflynn89
Commit: f8d414ec37
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5890
Reviewed-by: https://github.com/gmta ✅
1 changed files with 6 additions and 4 deletions
|
@ -90,7 +90,7 @@ def main():
|
|||
parents=[preset_parser, compiler_parser, target_parser],
|
||||
)
|
||||
profile_parser.add_argument(
|
||||
"args", nargs=argparse.REMAINDER, help="Additional arguments passed through to the build system"
|
||||
"args", nargs=argparse.REMAINDER, help="Additional arguments passed through to the application"
|
||||
)
|
||||
|
||||
install_parser = subparsers.add_parser(
|
||||
|
@ -168,8 +168,8 @@ def main():
|
|||
debug_main(platform.host_system, build_dir, args.target, args.debugger, args.cmd)
|
||||
elif args.command == "profile":
|
||||
build_dir = configure_main(platform, args.preset, args.cc, args.cxx)
|
||||
build_main(build_dir, args.jobs, args.target, args.args)
|
||||
profile_main(platform.host_system, build_dir, args.target)
|
||||
build_main(build_dir, args.jobs, args.target)
|
||||
profile_main(platform.host_system, build_dir, args.target, args.args)
|
||||
elif args.command == "install":
|
||||
build_dir = configure_main(platform, args.preset, args.cc, args.cxx)
|
||||
build_main(build_dir, args.jobs, args.target, args.args)
|
||||
|
@ -400,7 +400,7 @@ def debug_main(host_system: HostSystem, build_dir: Path, target: str, debugger:
|
|||
run_command(gdb_args, exit_on_failure=True)
|
||||
|
||||
|
||||
def profile_main(host_system: HostSystem, build_dir: Path, target: str):
|
||||
def profile_main(host_system: HostSystem, build_dir: Path, target: str, args: list[str]):
|
||||
if not shutil.which("valgrind"):
|
||||
print("Please install valgrind", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
@ -412,6 +412,8 @@ def profile_main(host_system: HostSystem, build_dir: Path, target: str):
|
|||
else:
|
||||
valgrind_args.append(str(build_dir.joinpath("bin", target)))
|
||||
|
||||
valgrind_args.extend(args)
|
||||
|
||||
run_command(valgrind_args, exit_on_failure=True)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue