This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: next/finish/etc -vs- exceptions
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 30 Nov 2010 11:23:27 -0700
- Subject: Re: RFC: next/finish/etc -vs- exceptions
- References: <m38w2a236l.fsf@fleche.redhat.com> <20101125075847.GA19270@host0.dyn.jankratochvil.net>
>>>>> "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);
}