Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 5/9] Remove current_target_sections macro
Date: Wed, 22 Jul 2020 08:39:31 -0400	[thread overview]
Message-ID: <e62dcdc2-fe89-cb1d-54eb-10bb4227eb7f@simark.ca> (raw)
In-Reply-To: <0cb15409-d939-34e8-79e3-8dce80c5e0f2@simark.ca>

On 2020-07-22 8:20 a.m., Simon Marchi wrote:
> On 2020-07-21 11:34 p.m., Tom Tromey wrote:
>> This removes the current_target_sections macro, replacing it with uses
>> of the appropriate member from current_program_space.
>>
>> gdb/ChangeLog
>> 2020-07-21  Tom Tromey  <tom@tromey.com>
>>
>> 	* progspace.h (current_target_sections): Remove macro.
>> 	* solib-svr4.c (scan_dyntag): Update.
>> 	* solib-dsbt.c (scan_dyntag): Update.
>> 	* exec.c (exec_target::close): Update.
>> 	(add_target_sections, add_target_sections_of_objfile)
>> 	(remove_target_sections, exec_target::get_section_table)
>> 	(exec_target::files_info, set_section_command)
>> 	(exec_set_section_address, exec_target::has_memory)
>> 	(exec_target::has_memory): Update.
>> ---
>>  gdb/ChangeLog    | 12 ++++++++++++
>>  gdb/exec.c       | 23 +++++++++++++----------
>>  gdb/progspace.h  |  4 ----
>>  gdb/solib-dsbt.c |  6 +++---
>>  gdb/solib-svr4.c |  6 +++---
>>  5 files changed, 31 insertions(+), 20 deletions(-)
>>
>> diff --git a/gdb/exec.c b/gdb/exec.c
>> index 6ca867ab53e..e2a0cae787c 100644
>> --- a/gdb/exec.c
>> +++ b/gdb/exec.c
>> @@ -159,7 +159,7 @@ exec_target::close ()
>>    for (struct program_space *ss : program_spaces)
>>      {
>>        set_current_program_space (ss);
>> -      clear_section_table (current_target_sections);
>> +      clear_section_table (&ss->target_sections);
>>        ss->exec_close ();
> 
> I hoped that the call to set_current_program_space could be removed, but no.  exec_close
> ends up calling remove_target_sections, which uses current_program_space.
> 
> But once we make remove_target_sections take a program_space parameter, I think it will
> be fine to remove it.

This is handled in the next patch, so forget it.  Although I get a build failure on this
patch:

/home/smarchi/src/binutils-gdb/gdb/solib-dsbt.c: In function ‘int scan_dyntag(int, bfd*, CORE_ADDR*)’:
/home/smarchi/src/binutils-gdb/gdb/solib-dsbt.c:427:63: error: base operand of ‘->’ has non-pointer type ‘target_section_table’
  427 |   for (target_section = current_program_space->target_sections->sections;
      |                                                               ^~

Simon


  reply	other threads:[~2020-07-22 12:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22  3:34 [PATCH 0/9] Remove some macros from exec.h and progspace.h Tom Tromey
2020-07-22  3:34 ` [PATCH 1/9] Remove exec_filename macro Tom Tromey
2020-07-22  3:34 ` [PATCH 2/9] Change exec_close to be a method on program_space Tom Tromey
2020-07-22  3:34 ` [PATCH 3/9] Remove commented-out code from gcore.c Tom Tromey
2020-07-22  3:34 ` [PATCH 4/9] Remove exec_bfd_mtime define Tom Tromey
2020-07-22  3:34 ` [PATCH 5/9] Remove current_target_sections macro Tom Tromey
2020-07-22 12:20   ` Simon Marchi
2020-07-22 12:39     ` Simon Marchi [this message]
2020-07-22 14:11       ` Tom Tromey
2020-07-22  3:34 ` [PATCH 6/9] Don't change current program space in exec_target::close Tom Tromey
2020-07-22 12:22   ` Simon Marchi
2020-07-22  3:34 ` [PATCH 7/9] Remove the exec_bfd macro Tom Tromey
2020-07-22  3:34 ` [PATCH 8/9] Change program_space::ebfd to a gdb_bfd_ref_ptr Tom Tromey
2020-07-22  3:34 ` [PATCH 9/9] Remove symfile_objfile macro Tom Tromey
2020-07-22 12:38 ` [PATCH 0/9] Remove some macros from exec.h and progspace.h 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=e62dcdc2-fe89-cb1d-54eb-10bb4227eb7f@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --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