Re: RFC: next/finish/etc -vs- exceptions

Tom Tromey
2010-11-30T18:23:37Z

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> continuation_free_args is NULL here but I think the breakpoint
Jan> should get deleted even if there is some premature thread deletion.
Jan> But maybe just all the breakpoints specific for that thread
Jan> (clear_thread_inferior_resources) should be deleted which would
Jan> also solve this problem?

It turns out there is a bug here in CVS gdb, with longjmp breakpoints.

Consider the appended program. Set a breakpoint in thr_func, run, then
"next". I get:

(gdb) n
Warning:
Cannot insert breakpoint 0.
Error accessing memory address 0x83f4375: Input/output error.

0x00757b01 in __libc_siglongjmp (env=0xb7fd8444, val=1) at longjmp.c:30
30 {

I'm looking into it some more.

Tom

#include <pthread.h>

void throwit () {
// throw 1;
pthread_exit ((void*) "lo");
}

void *
thr_func (void *)
{
try {
throwit ();
}
catch (int x) {
return (void*) "hi bob";
}

return NULL;
}

int main ()
{
pthread_t thread;
void *r;

pthread_create (&thread, NULL, thr_func, NULL);

pthread_join (thread, &r);
}