Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA record/replay branch] Eliminate a global variable
@ 2008-10-03  0:18 Michael Snyder
  2008-10-03  0:20 ` teawater
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Snyder @ 2008-10-03  0:18 UTC (permalink / raw)
  To: teawater, gdb-patches

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

Seems like we can use target_can_async_p() here
instead of relying on a global variable.


[-- Attachment #2: async.txt --]
[-- Type: text/plain, Size: 2339 bytes --]

2008-10-02  Michael Snyder  <msnyder@vmware.com>

	* record.c (record_open): Call target_can_async_p() instead
	of relying on a global variable.
	* record.h (record_linux_async_permitted): Delete.
	* linux-nat.h (record_linux_async_permitted): Delete reference.

Index: record.c
===================================================================
RCS file: /cvs/src/src/gdb/Attic/record.c,v
retrieving revision 1.1.2.14
diff -u -p -r1.1.2.14 record.c
--- record.c	22 Sep 2008 17:43:11 -0000	1.1.2.14
+++ record.c	3 Oct 2008 00:12:38 -0000
@@ -48,7 +48,6 @@ static int record_insn_num = 0;
 struct target_ops record_ops;
 int record_resume_step = 0;
 enum exec_direction_kind record_execdir = EXEC_FORWARD;
-int record_linux_async_permitted = 0;
 static int record_get_sig = 0;
 static sigset_t record_maskall;
 static int record_not_record = 0;
@@ -423,7 +422,7 @@ record_open (char *name, int from_tty)
     {
       error (_("Record: record target can't debug inferior in non-stop mode (non-stop)."));
     }
-  if (record_linux_async_permitted)
+  if (target_can_async_p ())
     {
       error (_("Record: record target can't debug the GNU/Linux inferior in asynchronous mode (linux-async)."));
     }
Index: record.h
===================================================================
RCS file: /cvs/src/src/gdb/Attic/record.h,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 record.h
--- record.h	2 Sep 2008 09:18:28 -0000	1.1.2.4
+++ record.h	3 Oct 2008 00:12:38 -0000
@@ -77,7 +77,6 @@ extern struct target_ops record_ops;
 extern int record_resume_step;
 extern int record_regcache_raw_write_regnum;
 extern enum exec_direction_kind record_execdir;
-extern int record_linux_async_permitted;
 
 extern int record_arch_list_add_reg (int num);
 extern int record_arch_list_add_mem (CORE_ADDR addr, int len);
Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.94.2.3
diff -u -p -r1.94.2.3 linux-nat.c
--- linux-nat.c	2 Sep 2008 09:18:28 -0000	1.94.2.3
+++ linux-nat.c	3 Oct 2008 00:12:38 -0000
@@ -4126,7 +4126,6 @@ set_maintenance_linux_async_permitted (c
     }
 
   linux_async_permitted = linux_async_permitted_1;
-  record_linux_async_permitted = linux_async_permitted;
   linux_nat_set_async_mode (linux_async_permitted);
 }
 

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

* Re: [RFA record/replay branch] Eliminate a global variable
  2008-10-03  0:18 [RFA record/replay branch] Eliminate a global variable Michael Snyder
@ 2008-10-03  0:20 ` teawater
  2008-10-03  0:37   ` Michael Snyder
  0 siblings, 1 reply; 3+ messages in thread
From: teawater @ 2008-10-03  0:20 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

Looks good. Please check it in.

Thanks,
Hui

On Fri, Oct 3, 2008 at 08:16, Michael Snyder <msnyder@vmware.com> wrote:
> Seems like we can use target_can_async_p() here
> instead of relying on a global variable.
>
>
> 2008-10-02  Michael Snyder  <msnyder@vmware.com>
>
>        * record.c (record_open): Call target_can_async_p() instead
>        of relying on a global variable.
>        * record.h (record_linux_async_permitted): Delete.
>        * linux-nat.h (record_linux_async_permitted): Delete reference.
>
> Index: record.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/Attic/record.c,v
> retrieving revision 1.1.2.14
> diff -u -p -r1.1.2.14 record.c
> --- record.c    22 Sep 2008 17:43:11 -0000      1.1.2.14
> +++ record.c    3 Oct 2008 00:12:38 -0000
> @@ -48,7 +48,6 @@ static int record_insn_num = 0;
>  struct target_ops record_ops;
>  int record_resume_step = 0;
>  enum exec_direction_kind record_execdir = EXEC_FORWARD;
> -int record_linux_async_permitted = 0;
>  static int record_get_sig = 0;
>  static sigset_t record_maskall;
>  static int record_not_record = 0;
> @@ -423,7 +422,7 @@ record_open (char *name, int from_tty)
>     {
>       error (_("Record: record target can't debug inferior in non-stop mode
> (non-stop)."));
>     }
> -  if (record_linux_async_permitted)
> +  if (target_can_async_p ())
>     {
>       error (_("Record: record target can't debug the GNU/Linux inferior in
> asynchronous mode (linux-async)."));
>     }
> Index: record.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/Attic/record.h,v
> retrieving revision 1.1.2.4
> diff -u -p -r1.1.2.4 record.h
> --- record.h    2 Sep 2008 09:18:28 -0000       1.1.2.4
> +++ record.h    3 Oct 2008 00:12:38 -0000
> @@ -77,7 +77,6 @@ extern struct target_ops record_ops;
>  extern int record_resume_step;
>  extern int record_regcache_raw_write_regnum;
>  extern enum exec_direction_kind record_execdir;
> -extern int record_linux_async_permitted;
>
>  extern int record_arch_list_add_reg (int num);
>  extern int record_arch_list_add_mem (CORE_ADDR addr, int len);
> Index: linux-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/linux-nat.c,v
> retrieving revision 1.94.2.3
> diff -u -p -r1.94.2.3 linux-nat.c
> --- linux-nat.c 2 Sep 2008 09:18:28 -0000       1.94.2.3
> +++ linux-nat.c 3 Oct 2008 00:12:38 -0000
> @@ -4126,7 +4126,6 @@ set_maintenance_linux_async_permitted (c
>     }
>
>   linux_async_permitted = linux_async_permitted_1;
> -  record_linux_async_permitted = linux_async_permitted;
>   linux_nat_set_async_mode (linux_async_permitted);
>  }
>
>
>


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

* Re: [RFA record/replay branch] Eliminate a global variable
  2008-10-03  0:20 ` teawater
@ 2008-10-03  0:37   ` Michael Snyder
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Snyder @ 2008-10-03  0:37 UTC (permalink / raw)
  To: teawater; +Cc: gdb-patches

Thanks, committing now.

Good thing, too, because that global doesn't exist any more in HEAD.
;-)

teawater wrote:
> Looks good. Please check it in.
> 
> Thanks,
> Hui
> 
> On Fri, Oct 3, 2008 at 08:16, Michael Snyder <msnyder@vmware.com> wrote:
>> Seems like we can use target_can_async_p() here
>> instead of relying on a global variable.
>>
>>
>> 2008-10-02  Michael Snyder  <msnyder@vmware.com>
>>
>>        * record.c (record_open): Call target_can_async_p() instead
>>        of relying on a global variable.
>>        * record.h (record_linux_async_permitted): Delete.
>>        * linux-nat.h (record_linux_async_permitted): Delete reference.
>>
>> Index: record.c
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/Attic/record.c,v
>> retrieving revision 1.1.2.14
>> diff -u -p -r1.1.2.14 record.c
>> --- record.c    22 Sep 2008 17:43:11 -0000      1.1.2.14
>> +++ record.c    3 Oct 2008 00:12:38 -0000
>> @@ -48,7 +48,6 @@ static int record_insn_num = 0;
>>  struct target_ops record_ops;
>>  int record_resume_step = 0;
>>  enum exec_direction_kind record_execdir = EXEC_FORWARD;
>> -int record_linux_async_permitted = 0;
>>  static int record_get_sig = 0;
>>  static sigset_t record_maskall;
>>  static int record_not_record = 0;
>> @@ -423,7 +422,7 @@ record_open (char *name, int from_tty)
>>     {
>>       error (_("Record: record target can't debug inferior in non-stop mode
>> (non-stop)."));
>>     }
>> -  if (record_linux_async_permitted)
>> +  if (target_can_async_p ())
>>     {
>>       error (_("Record: record target can't debug the GNU/Linux inferior in
>> asynchronous mode (linux-async)."));
>>     }
>> Index: record.h
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/Attic/record.h,v
>> retrieving revision 1.1.2.4
>> diff -u -p -r1.1.2.4 record.h
>> --- record.h    2 Sep 2008 09:18:28 -0000       1.1.2.4
>> +++ record.h    3 Oct 2008 00:12:38 -0000
>> @@ -77,7 +77,6 @@ extern struct target_ops record_ops;
>>  extern int record_resume_step;
>>  extern int record_regcache_raw_write_regnum;
>>  extern enum exec_direction_kind record_execdir;
>> -extern int record_linux_async_permitted;
>>
>>  extern int record_arch_list_add_reg (int num);
>>  extern int record_arch_list_add_mem (CORE_ADDR addr, int len);
>> Index: linux-nat.c
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/linux-nat.c,v
>> retrieving revision 1.94.2.3
>> diff -u -p -r1.94.2.3 linux-nat.c
>> --- linux-nat.c 2 Sep 2008 09:18:28 -0000       1.94.2.3
>> +++ linux-nat.c 3 Oct 2008 00:12:38 -0000
>> @@ -4126,7 +4126,6 @@ set_maintenance_linux_async_permitted (c
>>     }
>>
>>   linux_async_permitted = linux_async_permitted_1;
>> -  record_linux_async_permitted = linux_async_permitted;
>>   linux_nat_set_async_mode (linux_async_permitted);
>>  }
>>
>>
>>


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

end of thread, other threads:[~2008-10-03  0:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-03  0:18 [RFA record/replay branch] Eliminate a global variable Michael Snyder
2008-10-03  0:20 ` teawater
2008-10-03  0:37   ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox