Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Kevin Buettner <kevinb@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/8] Record explicit block ranges from dwarf2read.c
Date: Wed, 01 Aug 2018 01:41:00 -0000	[thread overview]
Message-ID: <bc82771e-b881-d56a-f401-193ca3230e11@ericsson.com> (raw)
In-Reply-To: <20180625234434.5c3913fa@pinnacle.lan>

On 2018-06-26 02:44 AM, Kevin Buettner wrote:
> This change sets BLOCK_RANGES for the block under consideration by
> calling make_blockranges().  This action is performed in
> dwarf2_record_block_ranges().
> 
> It should be noted that dwarf2_record_block_ranges() already does some
> recording of the range via a call to record_block_range().  The ranges
> recorded in that fashion end up in the address map associated with the
> blockvector for the compilation unit's symtab.  Given an address, the
> addrmap provides a fast way of finding the block containing that
> address.  The address map does not, however, provide a convenient way
> of determining which address ranges make up a particular block.
> 
> While reading a set of ranges, a vector of pairs is used to collect
> the starting and ending addresses for each range in the block.  Once
> all of the ranges for a block have been collected, make_blockranges()
> is called to fill in BLOCK_RANGES for the block.
> 
> The ranges are stored for the block in the order that they're read
> from the debug info.  For DWARF, the starting address of the first
> range of the block will be the entry pc in cases where DW_AT_entry_pc
> is not present.  (Well, that would ideally be the case.  At the moment
> DW_AT_entry_pc is not being handled.)
> 
> gdb/ChangeLog:
>     
>     	* dwarf2read.c (dwarf2_record_block_ranges): Fill in BLOCK_RANGES
>     	for block.
> ---
>  gdb/dwarf2read.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
> index 4ad0527..2f0f9b9 100644
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -14722,6 +14722,7 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block,
>        unsigned long offset = (DW_UNSND (attr)
>  			      + (need_ranges_base ? cu->ranges_base : 0));
>  
> +      std::vector<std::pair<CORE_ADDR, CORE_ADDR>> blockvec;
>        dwarf2_ranges_process (offset, cu,
>  	[&] (CORE_ADDR start, CORE_ADDR end)
>  	{
> @@ -14730,7 +14731,10 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block,
>  	  start = gdbarch_adjust_dwarf2_addr (gdbarch, start);
>  	  end = gdbarch_adjust_dwarf2_addr (gdbarch, end);
>  	  record_block_range (block, start, end - 1);
> +	  blockvec.push_back (std::make_pair (start, end));

A real small nit, using

  blockvec.emplace_back (start, end);

would avoid some unnecessary copying.  Otherwise, it LGTM.

Simon


  reply	other threads:[~2018-08-01  1:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26  6:32 [PATCH 0/8] Non-contiguous address range support Kevin Buettner
2018-06-26  6:42 ` [PATCH 1/8] Add block range data structure for blocks with non-contiguous address ranges Kevin Buettner
2018-08-01  1:36   ` Simon Marchi
2018-08-01 23:57     ` Kevin Buettner
2018-08-01  1:40   ` Simon Marchi
2018-06-26  6:44 ` [PATCH 2/8] Record explicit block ranges from dwarf2read.c Kevin Buettner
2018-08-01  1:41   ` Simon Marchi [this message]
2018-06-26  6:47 ` [PATCH 3/8] Add support for non-contiguous blocks to find_pc_partial_function Kevin Buettner
2018-07-19 18:52   ` Kevin Buettner
2018-08-01  2:01     ` Simon Marchi
2018-08-01 23:40       ` Kevin Buettner
2018-06-26  6:49 ` [PATCH 4/8] Disassemble blocks with non-contiguous ranges Kevin Buettner
2018-08-01  2:08   ` Simon Marchi
2018-06-26  6:51 ` [PATCH 5/8] Use BLOCK_ENTRY_PC in place of most uses of BLOCK_START Kevin Buettner
2018-08-01  2:22   ` Simon Marchi
2018-08-02  0:07     ` Kevin Buettner
2018-06-26  6:53 ` [PATCH 6/8] Use BLOCK_ENTRY_PC to find function entry pc in infrun.c Kevin Buettner
2018-08-01  2:28   ` Simon Marchi
2018-06-26  6:55 ` [PATCH 7/8] Relocate block range start and end addresses Kevin Buettner
2018-08-01  2:30   ` Simon Marchi
2018-06-26  6:57 ` [PATCH 8/8] Test case for functions with non-contiguous ranges Kevin Buettner
2018-08-01  2:56   ` Simon Marchi
2018-07-11 15:27 ` [PATCH 0/8] Non-contiguous address range support Kevin Buettner
2018-07-11 15:32   ` Keith Seitz
2018-07-12 19:12 ` Simon Marchi
2018-07-17  2:00   ` Kevin Buettner
2018-07-19 15:55     ` Simon Marchi
2018-07-19 19:07       ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc82771e-b881-d56a-f401-193ca3230e11@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox