This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Fix "list ambiguous_variable"
On 09/06/2017 07:41 PM, Keith Seitz wrote:
> On 09/04/2017 11:47 AM, Pedro Alves wrote:
>> The "list" command allows specifying the name of variables as
>> argument, not just functions, so that users can type "list
>> a_global_variable".
>>
>> That support is a broken when it comes to ambiguous locations though.
>
> Very nice!
>
> FWIW, I have only one trivial nit (below).
>
> Keith
>
> PS. Out of curiosity, I hacked up a test program with multiple symbols named "ambiguous," both functions and variables. Well done!
Awesome. :-)
>
> (gdb) set listsize 3
> (gdb) list ambiguous
> file: "amb1.c", line number: 5, symbol: "ambiguous"
> 4
> 5 static int ambiguous = 0;
> 6
> file: "amb2.c", line number: 3, symbol: "ambiguous"
> 2 ambiguous (void)
> 3 {
> 4 return 0;
> file: "amb3.c", line number: 3, symbol: "ambiguous"
> 2 ambiguous (void)
> 3 {
> 4 return 0;
> file: "amb4.c", line number: 1, symbol: "ambiguous"
> 1 static int ambiguous = 0;
> 2
> 3 int
>
>> - /* The minimal symbol might point to a function descriptor;
>> - resolve it to the actual code address instead. */
>> - pc = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc, ¤t_target);
>> - if (pc != sal.pc)
>> - sal = find_pc_sect_line (pc, NULL, 0);
>> + /* The minimal symbol might point to a function descriptor;
>> + resolve it to the actual code address instead. */
>> + pc = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc, ¤t_target);
>
> This line exceeds the 80-char line length limit.
Indeed it does. Fixed before pushing (both patches).
Thanks for the review!
--
Pedro Alves