(gdb) frame 1 <--- switch to frame 1 #1 0x08048455 in main () at try1.c:10 10 display(x, xptr); (gdb) print x $5 = 5 <--- we have access to variables in frame 1 (gdb) print xptr $6 = (int *) 0xbffffb34 <--- we have access to variables in frame 1 (gdb) pr...
Ø 函数info_threads_command是被命令info threads调用的,就是显示thread_list列表的信息。 Ø 函数thread_command是被命令thread调用,切换当前线程最终调用的函数是switch_to_thread,这个函数会先将当前调试线程变量inferior_ptid,然后对寄存器和frame缓冲进行刷新。 Ø 函数thread_apply_command被命令thread apply调用...
switch (request) { case PTRACE_SINGLESTEP: { /* set the trap flag. */ long tmp; ... tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG; put_stack_long(child, EFL_OFFSET, tmp); child->exit_code = data; /* give it a chance to run. */ wake_up_process(child); ret = 0;...
sys_ptrace() 函数的主体是一个 switch 语句,会传入的 request 参数不同进行不同的操作,如下: asmlinkage int sys_ptrace(long request, long pid, long addr, long data){struct task_struct *child;struct user *dummy = NULL;int i, ret;...read_lock(&tasklist_lock);child = find_task_by_pid(pid...
finish -- Execute until selected stack frame returns handle -- Specify how to handle signals inferior -- Use thiscommandto switch between inferiors interrupt -- Interrupt the execution of the debugged program jump -- Continue program being debugged at specified line or addresskill-- Kill executi...
switch (request) { case PTRACE_SINGLESTEP: { /* set the trap flag. */ long tmp; ... tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG; put_stack_long(child, EFL_OFFSET, tmp); child->exit_code = data; /* give it a chance to run. */ wake_up_process(child); ret = 0...
We are only interested in our own code here, so we want to switch to stack frame 3 and see where the program crashed: (gdb) frame 3 #3 0x80484b2 in main (argc=1, argv=0xbffffaf4) at segfault.c:10 10 fgets(buf, 1024, stdin) ...
函数 thread_command 是被命令 thread 调用,切换当前线程最 终调用的函数是 switch_to_thread,这个函数会先将当前调试线程变 量 inferior_ptid,然后对寄存器和 frame 缓冲进行刷新。 函数 thread_apply_command 被命令 thread apply 调用,这个 函数的实际实现其实很简单,就是先切换当前线为指定线程,然后调 用函数 ...
For instance, the GDB command to display the host threads and switch to host thread 1 are, respectively: (cuda-gdb) info threads (cuda-gdb) thread 1 To display the CUDA threads and switch to cuda thread 1, the user only has to type: (cuda-gdb) info cuda threads (cuda-gdb) cuda ...
GDB may be used with a Tandem ST2000 phone switch, running Tandem's STDBUG protocol. To connect your ST2000 to the host system, see the manufacturer's manual. Once the ST2000 is physically attached, you can run: target st2000devspeed ...