On 14/03/2017 11:08, Roman Pen wrote:
> For sure under corefile debugging it is not possible to invoke
> any syscalls, like arch_prctl(), so avoid doing that.  That will
> simplify the script.

Is the issue that start_thread only works in the main thread stack (i.e.
not on coroutines)?

> +    num = gdb.selected_thread().num
> +    thr = gdb.execute('info thread %d' % num, to_string=True)

What versions of gdb support gdb.execute?  Also, what happens if
localization is in effect?

Paolo

> +    thr = thr.split('\n')[1]
>      try:
> -        return f.read_var("arg")
> -    except ValueError:
> -        return get_fs_base()
> +        return re.search('Thread ([0-9a-zx]+)', thr).group(1)
> +    except:
> +        raise ValueError("Unable to find pthread address in 'info thread %d' 
> output.\n"
> +                         "Probably version mismatch of libthread_db.so 
> library?" %
> +                         num)

Reply via email to