Re: [patch] s390*: watchpoints regression [repost]

Jan Kratochvil
2011-12-17T19:45:13Z

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

On Sat, 17 Dec 2011 20:40:13 +0100, Pedro Alves wrote:
> In the loop that runs through the shell, fork-child.c:startup_inferior,
> nothing inserts breakpoints/watchpoints. So nothing ends up
> setting lwp->arch_private->debug_registers_changed, and so we should
> not be setting DR_CONTROL to 0 for the wrapper shell. Do you
> actually see it happen?

I see it happenning. [attached]

./gdb -nx ./gdb -ex 'watch gdb_stdin' -ex r
Reading symbols from /home/jkratoch/redhat/gdb-clean/gdb/gdb...done.
Hardware watchpoint 1: gdb_stdin
Starting program: /home/jkratoch/redhat/gdb-clean/gdb/gdb
DR_CONTROL set 0x0
lrwxrwxrwx 1 jkratoch jkratoch 0 Dec 17 19:41 /proc/12542/exe -> /bin/bash
DR_CONTROL set 0x90101
lrwxrwxrwx 1 jkratoch jkratoch 0 Dec 17 19:41 /proc/12542/exe -> /home/jkratoch/redhat/gdb-clean/gdb/gdb
DR_CONTROL set 0x90100
...

Thanks,
Jan

[-- Attachment #2: wrapper-debug.patch --]
[-- Type: text/plain, Size: 452 bytes --]

--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -403,6 +403,11 @@ amd64_linux_prepare_to_resume (struct lwp_info *lwp)
clear_status = 1;
}

+printf("DR_CONTROL set 0x%lx\n",(long)state->dr_control_mirror);
+{char buf[100];
+sprintf(buf,"ls -l /proc/%d/exe", (int)lwp->ptid.pid);
+system(buf);
+}
amd64_linux_dr_set (lwp->ptid, DR_CONTROL, state->dr_control_mirror);

lwp->arch_private->debug_registers_changed = 0;