Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] Add DWARF index cache
Date: Wed, 25 Jul 2018 20:20:00 -0000	[thread overview]
Message-ID: <0f83c762eff29bd89fe5f5a5f83dbe3a@polymtl.ca> (raw)
In-Reply-To: <87in5317b1.fsf@tromey.com>

On 2018-07-25 14:47, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@ericsson.com> writes:
> 
> Simon> - The cache is disabled by default.  I think once it's been out 
> there
> Simon>   and tested for a while, it could be turned on by default, so 
> that
> Simon>   everybody can enjoy it.
> 
> I think the patch to enable it should also come with a patch to disable
> it in the test suite, since otherwise "make check" is going to fill up
> the cache and maybe have other unintended consequences.

Indeed, the default behavior should probably be to test without the 
index cache.  I also made a board file to test using the index cache.  
It overrides the gdb_load proc to load the binary file twice in GDB (the 
first time to populate the cache, the second time to read from it).  I 
don't think it's very useful, so I didn't include in this series.

> Simon> +static void
> Simon> +set_index_cache_command (const char *arg, int from_tty)
> Simon> +{
> Simon> +  printf_unfiltered ("\
> Simon> +Missing arguments.  See \"help set index-cache\" for help.\n");
> 
> This probably needs _().  I think there were a couple other
> (non-debug-print) cases of this as well.

Right, will fix.

> Simon> +  printf_unfiltered ("The index cache is currently %s.\n",
> Simon> +		   global_index_cache.enabled () ? "enabled" : "disabled");
> 
> Like here.
> 
> Simon> +static void
> Simon> +test_mkdir_recursive ()
> Simon> +{
> Simon> +  char base[] = "/tmp/gdb-selftests-XXXXXX";
> Simon> +
> Simon> +  if (mkdtemp (base) == NULL)
> Simon> +    perror_with_name ("mkdtemp");
> Simon> +
> Simon> +  std::string dir = string_printf ("%s/a/b", base);
> Simon> +  SELF_CHECK (create_dir_and_check (dir.c_str ()));
> Simon> +
> Simon> +  dir = string_printf ("%s/a/b/c//d/e/", base);
> Simon> +  SELF_CHECK (create_dir_and_check (dir.c_str ()));
> 
> It would be nice to clean up afterward.

I'll try to do that.

> Simon> diff --git a/gdb/dwarf-index-write.h b/gdb/dwarf-index-write.h
> [...]
> Simon> +void write_psymtabs_to_index (struct dwarf2_per_objfile
> *dwarf2_per_objfile,
> Simon> +			      const char *dir, const char *basename,
> Simon> +			      dw_index_kind index_kind);
> 
> I tend to prefer the explicit "extern" but I don't know if there's an
> official style.

Actually, the official style is to use extern (I still don't know why).  
I can add it.

> This patch seems fine to me and I like this feature -- I would use it
> for sure.
> 
> I think it needs a doc + NEWS patch.

Oh you're right.  I forgot it when "upgrading" the patchset from RFC to 
RFA.

> I think it would be good to file bugs for the future features you
> mentioned in the email.

Ok.

Thanks for the review, I'll work on a v2.

Simon


  reply	other threads:[~2018-07-25 20:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 21:56 [PATCH 0/3] Add a " Simon Marchi
2018-07-09 21:56 ` [PATCH 1/3] Make index reading functions more modular Simon Marchi
2018-07-25 16:51   ` Tom Tromey
2018-07-09 21:56 ` [PATCH 2/3] Introduce scoped_mmapped_file Simon Marchi
2018-07-24  2:18   ` Tom Tromey
2018-07-24 12:31     ` Simon Marchi
2018-07-09 21:57 ` [PATCH 3/3] Add DWARF index cache Simon Marchi
2018-07-17 19:48   ` Tom Tromey
2018-07-17 20:48     ` Simon Marchi
2018-07-18 18:20       ` Tom Tromey
2018-07-25 18:48   ` Tom Tromey
2018-07-25 20:20     ` Simon Marchi [this message]
2018-07-26 12:38     ` Simon Marchi

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=0f83c762eff29bd89fe5f5a5f83dbe3a@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    --cc=tom@tromey.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