mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 11:41:35 +01:00
run: add --terminal and explain gem5 pdb
This commit is contained in:
24
README.adoc
24
README.adoc
@@ -6982,6 +6982,30 @@ In graphic mode, make sure that you never click inside the QEMU graphic while de
|
|||||||
|
|
||||||
You can still send key presses to QEMU however even without the mouse capture, just either click on the title bar, or alt tab to give it focus.
|
You can still send key presses to QEMU however even without the mouse capture, just either click on the title bar, or alt tab to give it focus.
|
||||||
|
|
||||||
|
==== Debug gem5 Python scripts
|
||||||
|
|
||||||
|
Start pdb at the first instruction:
|
||||||
|
|
||||||
|
....
|
||||||
|
./run -g -G='--pdb' --terminal
|
||||||
|
....
|
||||||
|
|
||||||
|
Requires `--terminal` as we must be on foreground.
|
||||||
|
|
||||||
|
Alternatively, you can add to the point of the code where you want to break the usual:
|
||||||
|
|
||||||
|
....
|
||||||
|
import ipdb; ipdb.set_trace()
|
||||||
|
....
|
||||||
|
|
||||||
|
and then run with:
|
||||||
|
|
||||||
|
....
|
||||||
|
./run -g --terminal
|
||||||
|
....
|
||||||
|
|
||||||
|
TODO test PyCharm: https://stackoverflow.com/questions/51982735/writing-gem5-configuration-scripts-with-pycharm
|
||||||
|
|
||||||
=== Tracing
|
=== Tracing
|
||||||
|
|
||||||
QEMU can log several different events.
|
QEMU can log several different events.
|
||||||
|
|||||||
10
run
10
run
@@ -123,6 +123,14 @@ rare and don't affect performance, because `./configure
|
|||||||
`pr_manager_run`, and I don't know how to get rid of them.
|
`pr_manager_run`, and I don't know how to get rid of them.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
init_group.add_argument(
|
||||||
|
'--terminal', default=False, action='store_true',
|
||||||
|
help='''Output to the terminal, don't pipe to tee as the default.
|
||||||
|
Does not save the output to a file, but allows you to use debuggers.
|
||||||
|
Set automatically by --debug-vm, but you still need this option to debug
|
||||||
|
gem5 Python scripts.
|
||||||
|
'''
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-U', '--tmux-args', default='',
|
'-U', '--tmux-args', default='',
|
||||||
help='Pass extra parameters to the program running on the `-u` tmux split'
|
help='Pass extra parameters to the program running on the `-u` tmux split'
|
||||||
@@ -374,7 +382,7 @@ if args.tmux:
|
|||||||
])
|
])
|
||||||
|
|
||||||
cmd += extra_emulator_args
|
cmd += extra_emulator_args
|
||||||
if debug_vm:
|
if debug_vm or args.terminal:
|
||||||
out_file = None
|
out_file = None
|
||||||
else:
|
else:
|
||||||
out_file = common.termout_file
|
out_file = common.termout_file
|
||||||
|
|||||||
Reference in New Issue
Block a user