[PATCH v5 1/5] gdb: protect some 'regcache_read_pc' calls

Aktemur, Tankut Baris tankut.baris.aktemur@intel.com
Mon Apr 20 20:13:34 GMT 2020


On Thursday, April 16, 2020 6:12 PM Pedro Alves wrote:
> On 4/6/20 4:45 PM, Tankut Baris Aktemur via Gdb-patches wrote:
> 
> > --- a/gdb/regcache.c
> > +++ b/gdb/regcache.c
> > @@ -1220,6 +1220,24 @@ regcache_read_pc (struct regcache *regcache)
> >    return pc_val;
> >  }
> >
> > +/* See gdbsupport/common-regcache.h.  */
> > +
> > +CORE_ADDR
> > +regcache_read_pc_protected (regcache *regcache)
> > +{
> > +  CORE_ADDR pc;
> > +  try
> > +    {
> > +      pc = regcache_read_pc (regcache);
> > +    }
> > +  catch (const gdb_exception &ex)
> 
> This swallows Ctrl-C/QUIT, which is usually not a good idea.
> Let's default to catching gdb_exception_error instead.

I replaced gdb_exception with gdb_exception_error.  I'm not sending another revision
for this.

Thanks.
Baris


 

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


More information about the Gdb-patches mailing list