* watchpoint hangs.
@ 2010-01-02 20:55 Guillaume Yziquel
2010-01-02 20:59 ` Jan Kratochvil
0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Yziquel @ 2010-01-02 20:55 UTC (permalink / raw)
To: gdb
Hi.
I've been experiencing the following problem on amd64, Linux Debian,
with version
> yziquel@seldon:~$ gdb --version
> GNU gdb (GDB) 7.0-debian
Here it goes:
> yziquel@seldon:~/git/ocaml-monetdb5$ make gdb-native
> ocamlfind ocamlopt -g -o test/monetdb_sql.native -I . test/monetdb_sql.ml monetDB5.cmxa
> ocamlfind ocamlc -g -o test/monetdb_sql.byte test/monetdb_sql.ml monetDB5.cma
> gdb -nx -silent test/monetdb_sql.native
> Reading symbols from /home/yziquel/git/ocaml-monetdb5/test/monetdb_sql.native...(no debugging symbols found)...done.
> (gdb) set breakpoint pending on
> (gdb) break mal_init
> Breakpoint 1 at 0x403d70
> (gdb) run
> Starting program: /home/yziquel/git/ocaml-monetdb5/test/monetdb_sql.native
> [Thread debugging using libthread_db enabled]
> [New Thread 0x2aaaaf359910 (LWP 6752)]
> [Switching to Thread 0x2aaaaf359910 (LWP 6752)]
>
> Breakpoint 1, mal_init () at mal.c:52
> 52 MT_lock_init( &mal_contextLock, "mal_contextLock");
> (gdb) continue
> Continuing.
> !MALException:malInclude:could not open file: sql
> Done!
> [Thread 0x2aaaaf359910 (LWP 6752) exited]
>
> Program exited normally.
> (gdb)
OK. Fine. But when I add a watchpoint, it hangs:
> yziquel@seldon:~/git/ocaml-monetdb5$ make gdb-native
> ocamlfind ocamlopt -g -o test/monetdb_sql.native -I . test/monetdb_sql.ml monetDB5.cmxa
> ocamlfind ocamlc -g -o test/monetdb_sql.byte test/monetdb_sql.ml monetDB5.cma
> gdb -nx -silent test/monetdb_sql.native
> Reading symbols from /home/yziquel/git/ocaml-monetdb5/test/monetdb_sql.native...(no debugging symbols found)...done.
> (gdb) set breakpoint pending on
> (gdb) break mal_init
> Breakpoint 1 at 0x403d70
> (gdb) run
> Starting program: /home/yziquel/git/ocaml-monetdb5/test/monetdb_sql.native
> [Thread debugging using libthread_db enabled]
> [New Thread 0x2aaaaf359910 (LWP 7063)]
> [Switching to Thread 0x2aaaaf359910 (LWP 7063)]
>
> Breakpoint 1, mal_init () at mal.c:52
> 52 MT_lock_init( &mal_contextLock, "mal_contextLock");
> (gdb) print box
> $1 = {0x0 <repeats 64 times>}
> (gdb) watch box
> Watchpoint 2: box
> (gdb) continue
> Continuing.
And it eats up 90% of one of my CPU from now on...
All the best,
--
Guillaume Yziquel
http://yziquel.homelinux.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: watchpoint hangs.
2010-01-02 20:55 watchpoint hangs Guillaume Yziquel
@ 2010-01-02 20:59 ` Jan Kratochvil
2010-01-03 23:44 ` Guillaume Yziquel
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-01-02 20:59 UTC (permalink / raw)
To: Guillaume Yziquel; +Cc: gdb
On Sat, 02 Jan 2010 21:55:24 +0100, Guillaume Yziquel wrote:
> >(gdb) print box
> >$1 = {0x0 <repeats 64 times>}
> >(gdb) watch box
> >Watchpoint 2: box
> >(gdb) continue
> >Continuing.
>
> And it eats up 90% of one of my CPU from now on...
As it printed "Watchpoint" and not "Hardware watchpoint" it means it had to
use software watchpoint for some reason. Therefore it needs to singlestep the
code which should work but it is very very slow.
On amd64 (x86_64) there are only 4 hardware watch registers with 8 bytes range
each, that is 32 bytes of maximum hardware-watchable bytes of memory.
According to "{0x0 <repeats 64 times>}" your requested memory range is
probably larger.
Try to reduce the watched memory range in your specific debugging case.
Regards,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: watchpoint hangs.
2010-01-02 20:59 ` Jan Kratochvil
@ 2010-01-03 23:44 ` Guillaume Yziquel
0 siblings, 0 replies; 3+ messages in thread
From: Guillaume Yziquel @ 2010-01-03 23:44 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb
Jan Kratochvil a écrit :
> On Sat, 02 Jan 2010 21:55:24 +0100, Guillaume Yziquel wrote:
>
>>> (gdb) print box
>>> $1 = {0x0 <repeats 64 times>}
>>> (gdb) watch box
>>> Watchpoint 2: box
>>> (gdb) continue
>>> Continuing.
>>
>> And it eats up 90% of one of my CPU from now on...
>
> As it printed "Watchpoint" and not "Hardware watchpoint" it means it had to
> use software watchpoint for some reason. Therefore it needs to singlestep the
> code which should work but it is very very slow.
>
> On amd64 (x86_64) there are only 4 hardware watch registers with 8 bytes range
> each, that is 32 bytes of maximum hardware-watchable bytes of memory.
>
> According to "{0x0 <repeats 64 times>}" your requested memory range is
> probably larger.
>
> Try to reduce the watched memory range in your specific debugging case.
>
> Regards,
> Jan
Thank you so much. This has helped tremendously. Symbol collision issue
detected and solved.
By the way, completely off-topic: moving to git is indeed a very very
worthwile solution. It takes quite some pain at the beginning, but it's
totally worth it.
--
Guillaume Yziquel
http://yziquel.homelinux.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-03 23:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-02 20:55 watchpoint hangs Guillaume Yziquel
2010-01-02 20:59 ` Jan Kratochvil
2010-01-03 23:44 ` Guillaume Yziquel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox