@@ -177,7 +177,8 @@ R restart -H disable highlighting\n\
177177x sse radix -j enables jit\n\
178178t sse type -m disables memory safety\n\
179179T sse size -N natural scroll wheel\n\
180- B pop breakpoint -s system call logging\n\
180+ b push breakpoint -s system call logging\n\
181+ B pop breakpoint\n\
181182p profiling mode -C PATH chroot directory\n\
182183ctrl-t turbo -B PATH alternate BIOS image\n\
183184alt-t slowmo -z zoom\n\
@@ -887,6 +888,14 @@ static void BreakAtNextInstruction(void) {
887888 PushBreakpoint (& breakpoints , & b );
888889}
889890
891+ static void BreakAtCurrentInstruction (void ) {
892+ struct Breakpoint b ;
893+ if (IsAtBreakpoint (& breakpoints , m -> ip ) != -1 ) return ;
894+ memset (& b , 0 , sizeof (b ));
895+ b .addr = m -> ip ;
896+ PushBreakpoint (& breakpoints , & b );
897+ }
898+
890899static int DrainInput (int fd ) {
891900 char buf [32 ];
892901 struct pollfd fds [1 ];
@@ -3033,6 +3042,7 @@ static void HandleKeyboard(const char *k) {
30333042 CASE ('d' , OnDown ());
30343043 CASE ('V' , ++ verbose );
30353044 CASE ('p' , showprofile = !showprofile );
3045+ CASE ('b' , BreakAtCurrentInstruction ());
30363046 CASE ('B' , PopBreakpoint (& breakpoints ));
30373047 CASE ('M' , ToggleMouseTracking ());
30383048 CASE ('\r' , OnEnter ());
0 commit comments