This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [PATCH] 'inferior_pid' got renamed
- To: Phil Edwards <pedwards at disaster dot jaj dot com>, insight at sources dot redhat dot com
- Subject: Re: [PATCH] 'inferior_pid' got renamed
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Sun, 6 May 2001 14:27:51 -0700
- References: <20010506023907.A22905@disaster.jaj.com>
On May 6, 2:39am, Phil Edwards wrote:
> The variable inferior_pid was renamed everywhere in gdb sources recently,
> but gdbtk-cmds.c needed to be changed also. (Figured this out the hard
> way after reading the gdb ChangeLog.) The following patch lets me build.
Phil,
Thanks for your patch.
When I commit phase 3 of the ptid_t related patches (perhaps later
this week), it will no longer be possible to use expressions like:
inferior_ptid != 0
This is because the type of inferior_ptid will be changed from an int
to a struct. Expressions like the above will need to be rewritten as
either:
PIDGET (inferior_ptid) != 0
Or:
! ptid_equal (inferior_ptid, null_ptid)
Over time, I suspect that we will prefer the latter expression over the
former.
With that in mind, I've just committed the following patch...
* generic/gdbtk-cmds.c (gdb_target_has_execution_command)
(get_clear_file): Use ptid_equal() for comparing ptid values.
Use ``null_ptid'' instead of 0 in comparisons against
``inferior_ptid''.
From Phil Edwards <pedwards@disaster.jaj.com>:
* generic/gdbtk-cmds.c (gdb_target_has_execution_command)
(get_clear_file): Rename ``inferior_pid'' to ``inferior_ptid''.
Index: gdbtk/generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.33
diff -u -p -r1.33 gdbtk-cmds.c
--- gdbtk-cmds.c 2001/04/23 20:28:28 1.33
+++ gdbtk-cmds.c 2001/05/06 21:00:47
@@ -624,7 +624,7 @@ gdb_clear_file (clientData, interp, objc
return TCL_ERROR;
}
- if (inferior_pid != 0 && target_has_execution)
+ if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
{
if (attach_flag)
target_detach (NULL, 0);
@@ -981,7 +981,7 @@ gdb_target_has_execution_command (client
{
int result = 0;
- if (target_has_execution && inferior_pid != 0)
+ if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
result = 1;
Tcl_SetBooleanObj (result_ptr->obj_ptr, result);