This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix error when gdb connect to a stub that tracepoint is running[0/2]


Hi,

I found some error when I try to let GDB connect to a stub that have a tracepoint and it support insert tracepoint when trace is running, for example:
(gdb) info tracepoints
Num Type Disp Enb Address What
1 tracepoint keep y 0x0000000000400557 in main at 1.c:15
collect $reg
(gdb) set disconnected-tracing on
(gdb) tstart
(gdb) disconnect
Trace is running and will continue after detach; detach anyway? (y or n) y
Ending remote debugging.
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Error in re-setting breakpoint 1: Target returns error code '01'.
Target returns error code '01'.
(gdb) disconnect
You can't do that when your target is `exec'
(gdb) quit
gdb ./a.out
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x00007ffff7ddcaf0 in ?? () from /lib64/ld-linux-x86-64.so.2
Trace is already running on the target.
Tracepoint 1 at 0x400557: file 1.c, line 15.
Target returns error code '01'.



This is because GDB try to insert this tracepoint to gdb stub part because this stub support inserted tracepoint when it running. but this behaveior have 2 trouble:
1. stub already have a treacepoint same with gdb part, if GDB try to re-inserted it, we will got a error.
2. Even if gdb part doesn't have this tracepoint, when it got this tracepoint from gdbstub part, it will try to insert this tracepoint to gdbstub when create_breakpoint.


So I fix this issue with 2 patches.

Thanks,
Hui


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]