This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix dwarf register column to gdb register mapping


> When I enabled the dwarf debugging support in gdb before i caused
> various errors and warnings about incorrect cfi. Do you still see that
> with this enabled? Is it compiler dependent? Because of those warnings
> and errors I had disabled the dwarf stuff on hppa before.

Investigating some more, I see there's a problem with the floating
point registers.  A break on wack_double demonstrates the problem
on both hppa64-hpux and hppa-linux:

Starting program: /home/dave/xxx 

Breakpoint 1, wack_double (u=warning: Unmapped DWARF Register #108 encountered.

../../src/gdb/regcache.c:164: internal-error: register_type: Assertion `regnum >= 0 && regnum < descr->nr_cooked_registers' failed.

Same problem for a break on add_double.

.debug_frame for wack_double appears ok when I dump it with readelf -wf:

0000002c 00000020 00000000 FDE cie=00000000 pc=00000028..0000008c
  DW_CFA_advance_loc: 8 to 00000030
  DW_CFA_register: r3 in r1
  DW_CFA_offset_extended_sf: r2 at cfa-20
  DW_CFA_advance_loc: 4 to 00000034
  DW_CFA_def_cfa_register: r3
  DW_CFA_advance_loc: 4 to 00000038
  DW_CFA_offset: r3 at cfa+0
  DW_CFA_advance_loc: 8 to 00000040
  DW_CFA_offset: r49 at cfa+20
  DW_CFA_offset: r48 at cfa+16
  DW_CFA_nop
  DW_CFA_nop

It gets the correct columns for the floating register saves.  So, I
think it's gdb which has the problem.  It's possible it is confused
by the fact that the stores are done using r1.

I'm going to look at the effect of disabling dwarf register numbers
on hppa64-hpux.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

double
add_double (register double u, register double v)
{
  return u + v;
}

double
wack_double (register double u, register double v)
{
  register double l = u, r = v;
  l = add_double (l, r);
  return l + r;
}

int
main ()
{
  wack_double (-1, -2);
  return 0;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]