This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] Remove unused arguments to few functions in dwarf2loc.c and gdbtypes.c.
- From: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>
- To: 'Joel Brobecker' <brobecker at adacore dot com>, Siva Chandra <sivachandra at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 30 Apr 2014 14:44:56 +0000
- Subject: RE: [PATCH] Remove unused arguments to few functions in dwarf2loc.c and gdbtypes.c.
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gxgi2H1=73zH0wR9KxMCAPasx5F2auC6tBRmw-Kw9rORg at mail dot gmail dot com> <20140429141520 dot GD4420 at adacore dot com>
> > I did some digging as to why the unused args could be useful at all.
> > For example, one function touched by the attached patch is
> > dwarf2loc:dwarf2_evaluate_property. Before this patch, this function
> > required an (eventually) unused argument of type CORE_ADDR. I think
> > the intention there was correct: A dynamic property is probably
> > embedded in the value and hence the value address is required to
> > evaluate it. However, the patch that added this function added c99 vla
> > support. I think the array lengths for VLAs are not embedded in the
> > (array) object but somewhere else (the stack frame for example).
> > Hence, the value address is not required. Am I missing something
> > here?
>
Indeed. As you described the parameter is used to pass the address of the object
currently evaluated. The opcode DW_OP_push_object_address consumes the address.
I decided to extract the implementation of the mentioned opcode and
DW_AT_data_location into two separate patches so ease reviewing, as they are not
specific to C99-vla. Looks like I forgot to remove the bit while refactoring.
Thanks for taking care! The two pending patches will be send to the ML next week.
-Sanimir
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052