Don't prune program spaces when doing "maintenance info program-spaces"

Message ID 54242A52.8060200@ericsson.com
State Committed
Headers

Commit Message

Simon Marchi Sept. 25, 2014, 2:44 p.m. UTC
  On 2014-09-24 10:30 PM, Sergio Durigan Junior wrote:
> On Wednesday, September 24 2014, Doug Evans wrote:
> 
>> IOW, how about move the call to prune_program_spaces to  whatever
>> caller wants it.
> 
> As a note, after I commented on the patch, I noticed that the "prune"
> argument may be unecessary indeed (and the "prunning" logic"), because
> we are not prunning anything anymore.
> 
> Anyway, I just wanted to say that I agree with removing this part of the
> code, and moving it to more suitable parts.

Fine with me. Here is the updated patch, much simpler now.

gdb/Changelog:

	* progspace.c (print_program_space): Don't prune program spaces
	before printing them.
---
 gdb/progspace.c | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Doug Evans Sept. 25, 2014, 7:13 p.m. UTC | #1
On Thu, Sep 25, 2014 at 8:44 AM, Simon Marchi <simon.marchi@ericsson.com> wrote:
> On 2014-09-24 10:30 PM, Sergio Durigan Junior wrote:
>> On Wednesday, September 24 2014, Doug Evans wrote:
>>
>>> IOW, how about move the call to prune_program_spaces to  whatever
>>> caller wants it.
>>
>> As a note, after I commented on the patch, I noticed that the "prune"
>> argument may be unecessary indeed (and the "prunning" logic"), because
>> we are not prunning anything anymore.
>>
>> Anyway, I just wanted to say that I agree with removing this part of the
>> code, and moving it to more suitable parts.
>
> Fine with me. Here is the updated patch, much simpler now.
>
> gdb/Changelog:
>
>         * progspace.c (print_program_space): Don't prune program spaces
>         before printing them.

LGTM

In the commit log I would add a note that this was removed so that the
print routine didn't have (unwanted) side-effects.

Thanks.
  
Simon Marchi Sept. 26, 2014, 2:36 p.m. UTC | #2
On 2014-09-25 03:13 PM, Doug Evans wrote:
> On Thu, Sep 25, 2014 at 8:44 AM, Simon Marchi <simon.marchi@ericsson.com> wrote:
>> On 2014-09-24 10:30 PM, Sergio Durigan Junior wrote:
>>> On Wednesday, September 24 2014, Doug Evans wrote:
>>>
>>>> IOW, how about move the call to prune_program_spaces to  whatever
>>>> caller wants it.
>>>
>>> As a note, after I commented on the patch, I noticed that the "prune"
>>> argument may be unecessary indeed (and the "prunning" logic"), because
>>> we are not prunning anything anymore.
>>>
>>> Anyway, I just wanted to say that I agree with removing this part of the
>>> code, and moving it to more suitable parts.
>>
>> Fine with me. Here is the updated patch, much simpler now.
>>
>> gdb/Changelog:
>>
>>         * progspace.c (print_program_space): Don't prune program spaces
>>         before printing them.
> 
> LGTM
> 
> In the commit log I would add a note that this was removed so that the
> print routine didn't have (unwanted) side-effects.
> 
> Thanks.

Pushed, thanks!
  

Patch

diff --git a/gdb/progspace.c b/gdb/progspace.c
index a74b6ab..b111a50 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -281,10 +281,6 @@  print_program_space (struct ui_out *uiout, int requested)
   int count = 0;
   struct cleanup *old_chain;

-  /* Might as well prune away unneeded ones, so the user doesn't even
-     seem them.  */
-  prune_program_spaces ();
-
   /* Compute number of pspaces we will print.  */
   ALL_PSPACES (pspace)
     {