public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix partial symbols
@ 2020-11-28 18:01 Bernd Edlinger
  2020-11-29 19:43 ` Andrew Burgess
  0 siblings, 1 reply; 7+ messages in thread
From: Bernd Edlinger @ 2020-11-28 18:01 UTC (permalink / raw)
  To: gdb-patches, Tom Tromey

[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]

Hi,

this fixes a regression in partial symbols.

The bug was introduced with this patch:

commit 529908cbd0afc2524044b7df3626c09d0bdae12d
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Sep 29 18:49:08 2020 -0600

    Remove DW_UNSND
    
    This removes DW_UNSND, replacing uses with either as_unsigned or
    constant_value, depending primarily on whether or not the form is
    already known to be appropriate.
    
    gdb/ChangeLog
    2020-09-29  Tom Tromey  <tom@tromey.com>
    
        * dwarf2/read.c (lookup_dwo_id, get_type_unit_group)
        (read_file_scope, dwarf2_get_pc_bounds)
        (dwarf2_record_block_ranges, dwarf2_add_field, get_alignment)
        (read_structure_type, handle_struct_member_die)
        (read_enumeration_type, read_array_type, read_set_type)
        (read_tag_pointer_type, read_tag_reference_type)
        (read_subroutine_type, read_base_type, read_subrange_type)
        (read_full_die_1, partial_die_info::read)
        (partial_die_info::read, by, new_symbol)
        (dwarf2_const_value_data, dwarf2_const_value_attr)
        (dump_die_shallow, dwarf2_fetch_constant_bytes)
        (prepare_one_comp_unit): Update.
        * dwarf2/attribute.h (DW_UNSND): Remove.

Due to the broken handling of DW_AT_ranges
in partial_die_info::read only a subset of the
complete locations is found when I set a breakpoint
on an inline function.

Is it OK for trunk?


Thanks
Bernd.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-partial-symbols.patch --]
[-- Type: text/x-patch; name="0001-Fix-partial-symbols.patch", Size: 1016 bytes --]

From a2db347c00b4dac744f49a7e0d4b9689a861dc66 Mon Sep 17 00:00:00 2001
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
Date: Sat, 28 Nov 2020 17:29:18 +0100
Subject: [PATCH] Fix partial symbols

attr.constant_value does not work for DW_FORM_rnglistx at least.

Fixes: 529908cbd0a ("Remove DW_UNSND")

2020-11-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* dwarf2/read.c (partial_die_info::read): Fix DW_AT_ranges.
---
 gdb/dwarf2/read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 601a571..28244e5 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -19660,7 +19660,7 @@ struct type *
 	    /* It would be nice to reuse dwarf2_get_pc_bounds here,
 	       but that requires a full DIE, so instead we just
 	       reimplement it.  */
-	    unsigned int ranges_offset = (attr.constant_value (0)
+	    unsigned int ranges_offset = (attr.as_unsigned ()
 					  + (need_ranges_base
 					     ? cu->ranges_base
 					     : 0));
-- 
1.9.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-03 15:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-28 18:01 [PATCH] Fix partial symbols Bernd Edlinger
2020-11-29 19:43 ` Andrew Burgess
2020-11-30 15:53   ` Bernd Edlinger
2020-11-30 19:26     ` [PATCH] Skip .cold functions in search_minsyms_for_name Bernd Edlinger
2020-12-18 15:57       ` [PING] " Bernd Edlinger
2020-12-18 16:23     ` [PATCHv2] Fix partial symbols Bernd Edlinger
2021-01-03 15:36       ` [PATCH v3] " Bernd Edlinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).