Re: [Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-20 Thread Adrian Prantl
> On Mar 20, 2017, at 9:59 AM, Jakub Jelinek wrote: > > On Mon, Mar 20, 2017 at 09:23:36AM -0700, Adrian Prantl wrote: >> >>> On Mar 17, 2017, at 2:49 PM, David Anderson wrote: >>> >>> On 03/17/2017 01:18 PM, Adrian Prantl wrote: Are these two expressions equivalent? 1. DW_OP_breg1

Re: [Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-20 Thread Jakub Jelinek
On Mon, Mar 20, 2017 at 09:23:36AM -0700, Adrian Prantl wrote: > > > On Mar 17, 2017, at 2:49 PM, David Anderson wrote: > > > > On 03/17/2017 01:18 PM, Adrian Prantl wrote: > >> Are these two expressions equivalent? > >> 1. DW_OP_breg1 0 DW_OP_breg2 0 DW_OP_plus DW_OP_stack_value > >> 2. DW_OP_r

Re: [Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-20 Thread David Anderson
On 03/17/2017 09:07 AM, I wrote > Now this is interesting wording. Because it says 'described location'. > I think there is a strong case for arguing that a register name does > describe a 'thing' that held a value. And it says 'register location > description' which is precisely 2.6.1.1.3 whic

Re: [Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-20 Thread Adrian Prantl
> On Mar 17, 2017, at 2:49 PM, David Anderson wrote: > > On 03/17/2017 01:18 PM, Adrian Prantl wrote: >> Are these two expressions equivalent? >> 1. DW_OP_breg1 0 DW_OP_breg2 0 DW_OP_plus DW_OP_stack_value >> 2. DW_OP_reg1DW_OP_reg2DW_OP_plus DW_OP_stack_value > > In DW4 (DW5 has same t

Re: [Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-20 Thread Adrian Prantl
> On Mar 17, 2017, at 3:26 PM, David Anderson wrote: > > On 03/17/2017 02:54 PM, Adrian Prantl wrote: >> Would you say that the example in Appendix D, pg 291, line 23 >> DW_OP_entry_value 1 DW_OP_reg1 DW_OP_stack_value >> is incorrect, because DW_OP_ref is not allowed outside of a register >>

Re: [Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-17 Thread David Anderson
On 03/17/2017 02:54 PM, Adrian Prantl wrote: > Would you say that the example in Appendix D, pg 291, line 23 > DW_OP_entry_value 1 DW_OP_reg1 DW_OP_stack_value > is incorrect, because DW_OP_ref is not allowed outside of a register location > description? DW5 2.5.1.7: DW_OP_entry_value The DW_O

Re: [Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-17 Thread Adrian Prantl
> On Mar 17, 2017, at 2:49 PM, David Anderson wrote: > > On 03/17/2017 01:18 PM, Adrian Prantl wrote: >> Are these two expressions equivalent? >> 1. DW_OP_breg1 0 DW_OP_breg2 0 DW_OP_plus DW_OP_stack_value >> 2. DW_OP_reg1DW_OP_reg2DW_OP_plus DW_OP_stack_value > > In DW4 (DW5 has same t

Re: [Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-17 Thread David Anderson
On 03/17/2017 01:18 PM, Adrian Prantl wrote: > Are these two expressions equivalent? > 1. DW_OP_breg1 0 DW_OP_breg2 0 DW_OP_plus DW_OP_stack_value > 2. DW_OP_reg1DW_OP_reg2DW_OP_plus DW_OP_stack_value In DW4 (DW5 has same text) These operations name a register location. To fetch the conten

[Dwarf-Discuss] Semantics of DW_OP_(b)reg

2017-03-17 Thread Adrian Prantl
I have a couple of questions regarding the semantics of DW_OP_reg(x) and DW_OP_breg(x). LLVM's DWARF expression generator (which was written with DWARF 2 in mind) treats DW_OP_breg as synonymous with DW_OP_reg DW_OP_deref, but I get the impression that that may not be correct in DWARF 4+. Howeve