* PATCH: Fix DW_OP_deref for DW_TAG_formal_parameter [not found] ` <20030731154821.GA10106@nevyn.them.org> @ 2003-07-31 16:13 ` H. J. Lu 2003-07-31 16:22 ` Daniel Jacobowitz 0 siblings, 1 reply; 6+ messages in thread From: H. J. Lu @ 2003-07-31 16:13 UTC (permalink / raw) To: GDB; +Cc: GDB [-- Attachment #1: Type: text/plain, Size: 1306 bytes --] On Thu, Jul 31, 2003 at 11:48:21AM -0400, Daniel Jacobowitz wrote: > On Thu, Jul 31, 2003 at 08:44:05AM -0700, H. J. Lu wrote: > > On Wed, Jul 30, 2003 at 08:27:53PM -0400, Daniel Jacobowitz wrote: > > > On Wed, Jul 30, 2003 at 05:23:06PM -0700, H. J. Lu wrote: > > > > On Wed, Jul 30, 2003 at 05:56:12PM -0400, Daniel Jacobowitz wrote: > > > > > On Wed, Jul 30, 2003 at 02:54:21PM -0700, H. J. Lu wrote: > > > > > > Does DW_OP_deref work correctly with gdb? > > > > > > > > > > That depends on the context. Things that use decode_locdesc, probably > > > > > not. As we find time, things are being converted to the full > > > > > expression evaluator. Location descriptions and frame bases should > > > > > work. > > > > > > > > I don't think it does. Intel Fortran compiler generartes DW_OP_deref. > > > > I got > > > > > > Location descriptions for parameters may not work fully. Feel free to > > > fix it, or to investigate the reasons why more thoroughly - search for > > > LOC_COMPUTED_ARG, but I don't even think we generate those yet. > > > > > > Please look more closely at what I suggested, and at how DW_OP_deref > works for DW_TAG_variable (as opposed to DW_TAG_formal_parameter). All > of the above should be turned into LOC_COMPUTED_ARG. > Thanks. This patch works for me. H.J. [-- Attachment #2: gdb-arg.patch --] [-- Type: text/plain, Size: 1133 bytes --] 2003-07-31 H.J. Lu <hongjiu.lu@intel.com> * dwarf2read.c (new_symbol): Mark DW_TAG_formal_parameter with DW_OP_deref with LOC_COMPUTED_ARG. --- gdb/dwarf2read.c.arg 2003-07-30 21:38:25.000000000 -0700 +++ gdb/dwarf2read.c 2003-07-31 09:06:53.000000000 -0700 @@ -5231,9 +5231,9 @@ new_symbol (struct die_info *die, struct SYMBOL_VALUE (sym) = DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym)); } - else if (offreg) + else if (isderef) { - if (isderef) + if (offreg) { if (basereg != frame_base_reg) dwarf2_complex_location_expr_complaint (); @@ -5241,10 +5241,16 @@ new_symbol (struct die_info *die, struct } else { - SYMBOL_CLASS (sym) = LOC_BASEREG_ARG; - SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg); + dwarf2_symbol_mark_computed (attr, sym, + cu_header, objfile); + SYMBOL_CLASS (sym) = LOC_COMPUTED_ARG; } } + else if (offreg) + { + SYMBOL_CLASS (sym) = LOC_BASEREG_ARG; + SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg); + } else { SYMBOL_CLASS (sym) = LOC_ARG; ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix DW_OP_deref for DW_TAG_formal_parameter 2003-07-31 16:13 ` PATCH: Fix DW_OP_deref for DW_TAG_formal_parameter H. J. Lu @ 2003-07-31 16:22 ` Daniel Jacobowitz 2003-07-31 16:39 ` H. J. Lu 2003-07-31 16:51 ` Daniel Jacobowitz 0 siblings, 2 replies; 6+ messages in thread From: Daniel Jacobowitz @ 2003-07-31 16:22 UTC (permalink / raw) To: H. J. Lu; +Cc: GDB On Thu, Jul 31, 2003 at 09:12:59AM -0700, H. J. Lu wrote: > On Thu, Jul 31, 2003 at 11:48:21AM -0400, Daniel Jacobowitz wrote: > > On Thu, Jul 31, 2003 at 08:44:05AM -0700, H. J. Lu wrote: > > > On Wed, Jul 30, 2003 at 08:27:53PM -0400, Daniel Jacobowitz wrote: > > > > On Wed, Jul 30, 2003 at 05:23:06PM -0700, H. J. Lu wrote: > > > > > On Wed, Jul 30, 2003 at 05:56:12PM -0400, Daniel Jacobowitz wrote: > > > > > > On Wed, Jul 30, 2003 at 02:54:21PM -0700, H. J. Lu wrote: > > > > > > > Does DW_OP_deref work correctly with gdb? > > > > > > > > > > > > That depends on the context. Things that use decode_locdesc, probably > > > > > > not. As we find time, things are being converted to the full > > > > > > expression evaluator. Location descriptions and frame bases should > > > > > > work. > > > > > > > > > > I don't think it does. Intel Fortran compiler generartes DW_OP_deref. > > > > > I got > > > > > > > > Location descriptions for parameters may not work fully. Feel free to > > > > fix it, or to investigate the reasons why more thoroughly - search for > > > > LOC_COMPUTED_ARG, but I don't even think we generate those yet. > > > > > > > > > > Please look more closely at what I suggested, and at how DW_OP_deref > > works for DW_TAG_variable (as opposed to DW_TAG_formal_parameter). All > > of the above should be turned into LOC_COMPUTED_ARG. > > > > Thanks. This patch works for me. Could you test this alternative? The goal is to eliminate calls to decode_locdesc. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer 2003-07-31 Daniel Jacobowitz <drow@mvista.com> * dwarf2read.c (new_symbol): Use var_decode_location for parameters. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.98 diff -u -p -r1.98 dwarf2read.c --- dwarf2read.c 22 Jul 2003 15:41:59 -0000 1.98 +++ dwarf2read.c 31 Jul 2003 16:21:04 -0000 @@ -5207,32 +5207,10 @@ new_symbol (struct die_info *die, struct attr = dwarf_attr (die, DW_AT_location); if (attr) { - SYMBOL_VALUE (sym) = - decode_locdesc (DW_BLOCK (attr), objfile, cu_header); - if (isreg) - { - SYMBOL_CLASS (sym) = LOC_REGPARM; - SYMBOL_VALUE (sym) = - DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym)); - } - else if (offreg) - { - if (isderef) - { - if (basereg != frame_base_reg) - dwarf2_complex_location_expr_complaint (); - SYMBOL_CLASS (sym) = LOC_REF_ARG; - } - else - { - SYMBOL_CLASS (sym) = LOC_BASEREG_ARG; - SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg); - } - } - else - { - SYMBOL_CLASS (sym) = LOC_ARG; - } + var_decode_location (attr, sym, objfile, cu_header); + /* FIXME drow/2003-07-31: Is LOC_COMPUTED_ARG necessary? */ + if (SYMBOL_CLASS (sym) == LOC_COMPUTED) + SYMBOL_CLASS (sym) = LOC_COMPUTED_ARG; } attr = dwarf_attr (die, DW_AT_const_value); if (attr) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix DW_OP_deref for DW_TAG_formal_parameter 2003-07-31 16:22 ` Daniel Jacobowitz @ 2003-07-31 16:39 ` H. J. Lu 2003-07-31 16:51 ` Daniel Jacobowitz 1 sibling, 0 replies; 6+ messages in thread From: H. J. Lu @ 2003-07-31 16:39 UTC (permalink / raw) To: GDB On Thu, Jul 31, 2003 at 12:22:07PM -0400, Daniel Jacobowitz wrote: > On Thu, Jul 31, 2003 at 09:12:59AM -0700, H. J. Lu wrote: > > On Thu, Jul 31, 2003 at 11:48:21AM -0400, Daniel Jacobowitz wrote: > > > On Thu, Jul 31, 2003 at 08:44:05AM -0700, H. J. Lu wrote: > > > > On Wed, Jul 30, 2003 at 08:27:53PM -0400, Daniel Jacobowitz wrote: > > > > > On Wed, Jul 30, 2003 at 05:23:06PM -0700, H. J. Lu wrote: > > > > > > On Wed, Jul 30, 2003 at 05:56:12PM -0400, Daniel Jacobowitz wrote: > > > > > > > On Wed, Jul 30, 2003 at 02:54:21PM -0700, H. J. Lu wrote: > > > > > > > > Does DW_OP_deref work correctly with gdb? > > > > > > > > > > > > > > That depends on the context. Things that use decode_locdesc, probably > > > > > > > not. As we find time, things are being converted to the full > > > > > > > expression evaluator. Location descriptions and frame bases should > > > > > > > work. > > > > > > > > > > > > I don't think it does. Intel Fortran compiler generartes DW_OP_deref. > > > > > > I got > > > > > > > > > > Location descriptions for parameters may not work fully. Feel free to > > > > > fix it, or to investigate the reasons why more thoroughly - search for > > > > > LOC_COMPUTED_ARG, but I don't even think we generate those yet. > > > > > > > > > > > > > > Please look more closely at what I suggested, and at how DW_OP_deref > > > works for DW_TAG_variable (as opposed to DW_TAG_formal_parameter). All > > > of the above should be turned into LOC_COMPUTED_ARG. > > > > > > > Thanks. This patch works for me. > > Could you test this alternative? The goal is to eliminate calls to > decode_locdesc. > Yes, it works. Thanks. H.J. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix DW_OP_deref for DW_TAG_formal_parameter 2003-07-31 16:22 ` Daniel Jacobowitz 2003-07-31 16:39 ` H. J. Lu @ 2003-07-31 16:51 ` Daniel Jacobowitz 2003-07-31 20:12 ` Jim Blandy 1 sibling, 1 reply; 6+ messages in thread From: Daniel Jacobowitz @ 2003-07-31 16:51 UTC (permalink / raw) To: GDB; +Cc: jimb, ezannoni Hi Elena, hi Jim, Since this patch fixes HJ's problem, I'm submitting it for approval. It cuts out another user of decode_locdesc. Why Fortran has arguments passed by DW_OP_deref is something I don't really want to think about... one of many things I don't like about Fortran :) On Thu, Jul 31, 2003 at 12:22:07PM -0400, Daniel Jacobowitz wrote: > On Thu, Jul 31, 2003 at 09:12:59AM -0700, H. J. Lu wrote: > > On Thu, Jul 31, 2003 at 11:48:21AM -0400, Daniel Jacobowitz wrote: > > > On Thu, Jul 31, 2003 at 08:44:05AM -0700, H. J. Lu wrote: > > > > On Wed, Jul 30, 2003 at 08:27:53PM -0400, Daniel Jacobowitz wrote: > > > > > On Wed, Jul 30, 2003 at 05:23:06PM -0700, H. J. Lu wrote: > > > > > > On Wed, Jul 30, 2003 at 05:56:12PM -0400, Daniel Jacobowitz wrote: > > > > > > > On Wed, Jul 30, 2003 at 02:54:21PM -0700, H. J. Lu wrote: > > > > > > > > Does DW_OP_deref work correctly with gdb? > > > > > > > > > > > > > > That depends on the context. Things that use decode_locdesc, probably > > > > > > > not. As we find time, things are being converted to the full > > > > > > > expression evaluator. Location descriptions and frame bases should > > > > > > > work. > > > > > > > > > > > > I don't think it does. Intel Fortran compiler generartes DW_OP_deref. > > > > > > I got > > > > > > > > > > Location descriptions for parameters may not work fully. Feel free to > > > > > fix it, or to investigate the reasons why more thoroughly - search for > > > > > LOC_COMPUTED_ARG, but I don't even think we generate those yet. > > > > > > > > > > > > > > Please look more closely at what I suggested, and at how DW_OP_deref > > > works for DW_TAG_variable (as opposed to DW_TAG_formal_parameter). All > > > of the above should be turned into LOC_COMPUTED_ARG. > > > > > > > Thanks. This patch works for me. > > Could you test this alternative? The goal is to eliminate calls to > decode_locdesc. > 2003-07-31 Daniel Jacobowitz <drow@mvista.com> > > * dwarf2read.c (new_symbol): Use var_decode_location for parameters. > > Index: dwarf2read.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > retrieving revision 1.98 > diff -u -p -r1.98 dwarf2read.c > --- dwarf2read.c 22 Jul 2003 15:41:59 -0000 1.98 > +++ dwarf2read.c 31 Jul 2003 16:21:04 -0000 > @@ -5207,32 +5207,10 @@ new_symbol (struct die_info *die, struct > attr = dwarf_attr (die, DW_AT_location); > if (attr) > { > - SYMBOL_VALUE (sym) = > - decode_locdesc (DW_BLOCK (attr), objfile, cu_header); > - if (isreg) > - { > - SYMBOL_CLASS (sym) = LOC_REGPARM; > - SYMBOL_VALUE (sym) = > - DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym)); > - } > - else if (offreg) > - { > - if (isderef) > - { > - if (basereg != frame_base_reg) > - dwarf2_complex_location_expr_complaint (); > - SYMBOL_CLASS (sym) = LOC_REF_ARG; > - } > - else > - { > - SYMBOL_CLASS (sym) = LOC_BASEREG_ARG; > - SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg); > - } > - } > - else > - { > - SYMBOL_CLASS (sym) = LOC_ARG; > - } > + var_decode_location (attr, sym, objfile, cu_header); > + /* FIXME drow/2003-07-31: Is LOC_COMPUTED_ARG necessary? */ > + if (SYMBOL_CLASS (sym) == LOC_COMPUTED) > + SYMBOL_CLASS (sym) = LOC_COMPUTED_ARG; > } > attr = dwarf_attr (die, DW_AT_const_value); > if (attr) > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix DW_OP_deref for DW_TAG_formal_parameter 2003-07-31 16:51 ` Daniel Jacobowitz @ 2003-07-31 20:12 ` Jim Blandy 2003-07-31 21:08 ` Daniel Jacobowitz 0 siblings, 1 reply; 6+ messages in thread From: Jim Blandy @ 2003-07-31 20:12 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: GDB, ezannoni Looks good to me. Please commit it. Daniel Jacobowitz <drow@mvista.com> writes: > Hi Elena, hi Jim, > > Since this patch fixes HJ's problem, I'm submitting it for approval. > It cuts out another user of decode_locdesc. Why Fortran has arguments > passed by DW_OP_deref is something I don't really want to think > about... one of many things I don't like about Fortran :) > > > 2003-07-31 Daniel Jacobowitz <drow@mvista.com> > > > > * dwarf2read.c (new_symbol): Use var_decode_location for parameters. > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix DW_OP_deref for DW_TAG_formal_parameter 2003-07-31 20:12 ` Jim Blandy @ 2003-07-31 21:08 ` Daniel Jacobowitz 0 siblings, 0 replies; 6+ messages in thread From: Daniel Jacobowitz @ 2003-07-31 21:08 UTC (permalink / raw) To: GDB Done, thanks! Now if only I had time to finish the job. On Thu, Jul 31, 2003 at 03:14:20PM -0500, Jim Blandy wrote: > > Looks good to me. Please commit it. > > Daniel Jacobowitz <drow@mvista.com> writes: > > > Hi Elena, hi Jim, > > > > Since this patch fixes HJ's problem, I'm submitting it for approval. > > It cuts out another user of decode_locdesc. Why Fortran has arguments > > passed by DW_OP_deref is something I don't really want to think > > about... one of many things I don't like about Fortran :) > > > > > 2003-07-31 Daniel Jacobowitz <drow@mvista.com> > > > > > > * dwarf2read.c (new_symbol): Use var_decode_location for parameters. > > > > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-07-31 21:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20030730215421.GA26408@lucon.org>
[not found] ` <20030730215612.GB15640@nevyn.them.org>
[not found] ` <20030731002306.GA28960@lucon.org>
[not found] ` <20030731002753.GA18866@nevyn.them.org>
[not found] ` <20030731154405.GA11592@lucon.org>
[not found] ` <20030731154821.GA10106@nevyn.them.org>
2003-07-31 16:13 ` PATCH: Fix DW_OP_deref for DW_TAG_formal_parameter H. J. Lu
2003-07-31 16:22 ` Daniel Jacobowitz
2003-07-31 16:39 ` H. J. Lu
2003-07-31 16:51 ` Daniel Jacobowitz
2003-07-31 20:12 ` Jim Blandy
2003-07-31 21:08 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox