Skip to content

Commit 952b6db

Browse files
committed
readme: make gdb and tmux awesomer
1 parent 766ba92 commit 952b6db

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.adoc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ Advantages: saves time and disk space.
502502

503503
Limitations:
504504

505-
* can't GDB step debug the kernel, since the source and cross toolchain with GDB are not available. Buildroot cannot easily use a host toolchain: <<prebuilt-toolchain>>.
505+
* can't <<gdb,GDB step debug the kernel>>, since the source and cross toolchain with GDB are not available. Buildroot cannot easily use a host toolchain: <<prebuilt-toolchain>>.
506506
+
507507
Maybe we could work around this by just downloading the kernel source somehow, and using a host prebuilt GDB, but we felt that it would be too messy and unreliable.
508508
* can't create new modules or modify the existing ones, since no cross toolchain
@@ -623,7 +623,7 @@ dmesg
623623

624624
=== GDB step debug kernel boot
625625

626-
`-d` makes QEMU wait for a GDB connection, otherwise we could accidentally go past the point we want to break at:
626+
`--debug-guest` makes QEMU wait for a GDB connection, otherwise we could accidentally go past the point we want to break at:
627627

628628
....
629629
./run --debug-guest
@@ -644,9 +644,9 @@ or at a given line:
644644
Now QEMU will stop there, and you can use the normal GDB commands:
645645

646646
....
647-
l
648-
n
649-
c
647+
list
648+
next
649+
continue
650650
....
651651

652652
See also:
@@ -705,8 +705,6 @@ When you hit `Ctrl-C`, if we happen to be inside kernel code at that point, whic
705705

706706
=== tmux
707707

708-
https://unix.stackexchange.com/questions/152738/how-to-split-a-new-window-and-run-a-command-in-this-new-window-using-tmux/432111#432111
709-
710708
tmux just makes things even more fun by allowing us to see both terminals at once without dragging windows around!
711709

712710
First start `tmux` with:
@@ -753,9 +751,11 @@ See the tmux manual for further details:
753751
man tmux
754752
....
755753

754+
Bibliography: https://unix.stackexchange.com/questions/152738/how-to-split-a-new-window-and-run-a-command-in-this-new-window-using-tmux/432111#432111
755+
756756
==== tmux gem5
757757

758-
If you are using gem5 instead of QEMU, `-u` has a different effect: it opens the gem5 terminal instead of the debugger:
758+
If you are using gem5 instead of QEMU, `--tmux` has a different effect: it opens the gem5 terminal instead of the debugger:
759759

760760
....
761761
./run --gem5 --tmux
@@ -768,7 +768,7 @@ From inside tmux, you can do that with `Ctrl-B C` or `Ctrl-B %`.
768768
To see the debugger by default instead of the terminal, run:
769769

770770
....
771-
./tmu ./rungdb;./run --debug-guest --gem5
771+
./tmu ./rungdb && ./run --debug-guest --gem5
772772
....
773773

774774
=== GDB step debug kernel module
@@ -813,10 +813,10 @@ loading @0xffffffffc0000000: ../kernel_modules-1.0//timer.ko
813813
That's `lx-symbols` working! Now simply:
814814

815815
....
816-
b lkmc_timer_callback
817-
c
818-
c
819-
c
816+
break lkmc_timer_callback
817+
continue
818+
continue
819+
continue
820820
....
821821

822822
and we now control the callback from GDB!
@@ -7400,8 +7400,8 @@ This is of course trivial since they are just regular userland programs on the h
74007400
Then you could:
74017401

74027402
....
7403-
b edu_mmio_read
7404-
c
7403+
break edu_mmio_read
7404+
continue
74057405
....
74067406

74077407
And in QEMU:

0 commit comments

Comments
 (0)