Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
efe12e9f
Commit
efe12e9f
authored
15 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add better debug messages so we can see what's going on.
parent
192eed38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapControl/remote/zmapXRemote.c
+62
-33
62 additions, 33 deletions
src/zmapControl/remote/zmapXRemote.c
with
62 additions
and
33 deletions
src/zmapControl/remote/zmapXRemote.c
+
62
−
33
View file @
efe12e9f
...
...
@@ -26,9 +26,9 @@
*
* Exported functions: See ZMap/zmapXRemote.h
* HISTORY:
* Last edited:
Aug 11 16:30
2009 (edgrif)
* Last edited:
Sep 2 14:48
2009 (edgrif)
* Created: Wed Apr 13 19:04:48 2005 (rds)
* CVS info: $Id: zmapXRemote.c,v 1.3
6
2009-0
8-14 09:5
9:37 edgrif Exp $
* CVS info: $Id: zmapXRemote.c,v 1.3
7
2009-0
9-02 13:4
9:37 edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -105,17 +105,7 @@ ZMapXRemoteObj zMapXRemoteNew(void)
}
else
{
zmapXDebug
(
"[zMapXRemoteNew] XSynchronize() '%s'
\n
"
,
env_string
);
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
#ifdef DO_DEBUGGING
g_printerr
(
"%s [zMapXRemoteNew] XSynchronize() @ line %d
\n
"
,
__LINE__
);
XSynchronize
(
object
->
display
,
True
);
#endif
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
zmapXDebug
(
"XSynchronize() '%s'
\n
"
,
env_string
);
/* almost certainly not required when using g_new0(). */
object
->
init_called
=
FALSE
;
...
...
@@ -160,6 +150,7 @@ void zMapXRemoteDestroy(ZMapXRemoteObj object)
return
;
}
/*!
* \brief Set the X11 Window ID for the handle
*
...
...
@@ -170,11 +161,13 @@ void zMapXRemoteDestroy(ZMapXRemoteObj object)
void
zMapXRemoteSetWindowID
(
ZMapXRemoteObj
object
,
Window
id
)
{
object
->
window_id
=
id
;
return
;
}
/*!
* \b
i
ref Set the Atom name used to pass the "request"
* \br
i
ef Set the Atom name used to pass the "request"
*
* @param The handle
* @param The atom name
...
...
@@ -185,9 +178,12 @@ void zMapXRemoteSetRequestAtomName(ZMapXRemoteObj object, char *name)
{
char
*
atom_name
=
NULL
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
zmapXDebug
(
"zMapXRemoteSetRequestAtomName change to '%s'
\n
"
,
name
);
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
object
->
request_atom
=
XInternAtom
(
object
->
display
,
name
,
False
);
object
->
request_atom
=
XInternAtom
(
object
->
display
,
name
,
False
);
if
(
!
(
atom_name
=
zmapXRemoteGetAtomName
(
object
->
display
,
object
->
request_atom
)))
{
...
...
@@ -195,13 +191,15 @@ void zMapXRemoteSetRequestAtomName(ZMapXRemoteObj object, char *name)
}
else
{
zmapXDebug
(
"New name is %s
\n
"
,
atom_name
);
zmapXDebug
(
"Set/Check Request atom %s
\n
"
,
atom_name
);
g_free
(
atom_name
);
}
return
;
}
/*!
* \brief Set the Atom name used to receive the "response"
*
...
...
@@ -214,7 +212,10 @@ void zMapXRemoteSetResponseAtomName(ZMapXRemoteObj object, char *name)
{
char
*
atom_name
=
NULL
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
zmapXDebug
(
"zMapXRemoteSetResponseAtomName change to '%s'
\n
"
,
name
);
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
object
->
response_atom
=
XInternAtom
(
object
->
display
,
name
,
False
);
...
...
@@ -222,7 +223,7 @@ void zMapXRemoteSetResponseAtomName(ZMapXRemoteObj object, char *name)
zMapLogFatal
(
"Unable to set and get atom '%s'. Possible X Server problem."
,
name
);
else
{
zmapXDebug
(
"
New name is
%s
\n
"
,
atom_name
);
zmapXDebug
(
"
Set/Check Response atom
%s
\n
"
,
atom_name
);
g_free
(
atom_name
);
}
...
...
@@ -371,7 +372,9 @@ int zMapXRemoteSendRemoteCommand(ZMapXRemoteObj object, char *command, char **re
ZMapXRemoteSendCommandError
result
=
ZMAPXREMOTE_SENDCOMMAND_SUCCEED
;
PredicateDataStruct
send_time
=
{
0
};
Bool
isDone
=
False
;
gboolean
check_names
=
TRUE
;
char
*
atom_name
=
NULL
;
timeout_timer
=
g_timer_new
();
g_timer_start
(
timeout_timer
);
...
...
@@ -408,13 +411,14 @@ int zMapXRemoteSendRemoteCommand(ZMapXRemoteObj object, char *command, char **re
if
(
check_names
)
{
char
*
atom_name
=
NULL
;
if
((
atom_name
=
zmapXRemoteGetAtomName
(
object
->
display
,
object
->
request_atom
)))
{
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
zmapXDebug
(
"About to send to %s on 0x%x:
\n
'%s'
\n
"
,
atom_name
,
(
unsigned
int
)
object
->
window_id
,
command
)
;
g_free
(
atom_name
);
atom_name
,
(
unsigned
int
)
object
->
window_id
,
command
)
;
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
}
}
...
...
@@ -422,7 +426,13 @@ int zMapXRemoteSendRemoteCommand(ZMapXRemoteObj object, char *command, char **re
result
=
zmapXRemoteChangeProperty
(
object
,
object
->
request_atom
,
command
);
zmapXDebug
(
"Sent:
\n
'%s'
\n
"
,
command
);
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
zmapXDebug
(
"Sent to %s on 0x%x:
\n
'%s'
\n
"
,
atom_name
,
(
unsigned
int
)
object
->
window_id
,
command
);
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
g_free
(
atom_name
)
;
if
(
windowError
)
{
...
...
@@ -435,8 +445,6 @@ int zMapXRemoteSendRemoteCommand(ZMapXRemoteObj object, char *command, char **re
XEvent
event
=
{
0
};
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
/* I need it not to time out during testing..... */
if
((
elapsed
=
g_timer_elapsed
(
timeout_timer
,
&
ignore
))
>
timeout
)
...
...
@@ -450,7 +458,8 @@ int zMapXRemoteSendRemoteCommand(ZMapXRemoteObj object, char *command, char **re
result
=
ZMAPXREMOTE_SENDCOMMAND_TIMEOUT
;
/* invalid window */
goto
DONE
;
}
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
if
(
XPending
(
object
->
display
))
...
...
@@ -518,7 +527,8 @@ int zMapXRemoteSendRemoteCommand(ZMapXRemoteObj object, char *command, char **re
while
(
!
isDone
&&
!
windowError
);
DONE:
zmapXDebug
(
"%s
\n
"
,
" - DONE: done"
);
zmapXDebug
(
"%s
\n
"
,
" - DONE: done"
);
XSelectInput
(
object
->
display
,
object
->
window_id
,
0
);
return
result
;
...
...
@@ -604,7 +614,11 @@ char *zMapXRemoteGetResponse(ZMapXRemoteObj object)
{
char
*
response
=
NULL
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
zmapXDebug
(
"%s
\n
"
,
"just a message to say we're in zMapXRemoteGetResponse"
);
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
if
(
windowError
||
(
zmapXRemoteErrorText
!=
NULL
))
{
...
...
@@ -641,7 +655,12 @@ char *zMapXRemoteGetRequest(ZMapXRemoteObj object)
GError
*
error
=
NULL
;
char
*
request
=
NULL
;
int
size
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
zmapXDebug
(
"%s
\n
"
,
"just a message to say we're in zMapXRemoteGetRequest"
);
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
if
(
!
zmapXRemoteGetPropertyFullString
(
object
->
display
,
object
->
window_id
,
...
...
@@ -810,9 +829,16 @@ static Bool process_property_notify(ZMapXRemoteObj object,
}
else
if
(
nitems
>
0
&&
commandResult
&&
*
commandResult
)
{
char
*
atom_name
=
NULL
;
atom_name
=
zmapXRemoteGetAtomName
(
object
->
display
,
object
->
response_atom
)
;
*
response
=
commandResult
;
zmapXDebug
(
"Received:
\n
'%s'
\n
"
,
*
response
)
;
zmapXDebug
(
"Received at window '0x%x' on atom '%s': '%s'
\n
"
,
object
->
window_id
,
atom_name
,
*
response
)
;
g_free
(
atom_name
);
}
else
{
...
...
@@ -828,10 +854,12 @@ static Bool process_property_notify(ZMapXRemoteObj object,
break
;
}
/* switch(event.xproperty.state) */
}
else
if
(
event
.
xproperty
.
atom
==
object
->
request_atom
)
else
if
(
event
.
xproperty
.
atom
==
object
->
request_atom
)
{
char
*
atom_name
=
NULL
;
atom_name
=
zmapXRemoteGetAtomName
(
object
->
display
,
event
.
xproperty
.
atom
);
switch
(
event
.
xproperty
.
state
)
{
case
PropertyNewValue
:
...
...
@@ -845,6 +873,7 @@ static Bool process_property_notify(ZMapXRemoteObj object,
default:
break
;
}
/* switch(event.xproperty.state) */
if
(
atom_name
)
g_free
(
atom_name
);
}
...
...
@@ -914,17 +943,15 @@ static int zmapXRemoteChangeProperty(ZMapXRemoteObj object, Atom atom, char *cha
atom_name
=
zmapXRemoteGetAtomName
(
object
->
display
,
atom
);
zmapXDebug
(
"Changing atom '%s' to value '%s'
\n
"
,
atom_name
,
change_to
);
g_free
(
atom_name
);
zmapXTrapErrors
();
zmapXRemoteErrorStatus
=
ZMAPXREMOTE_PRECOND
;
XChangeProperty
(
object
->
display
,
win
,
atom
,
XA_STRING
,
8
,
PropModeReplace
,
(
unsigned
char
*
)
change_to
,
strlen
(
change_to
));
strlen
(
change_to
));
zmapXDebug
(
"Sent to window '0x%x' on atom '%s': '%s'
\n
"
,
win
,
atom_name
,
change_to
);
XSync
(
object
->
display
,
False
);
...
...
@@ -933,6 +960,8 @@ static int zmapXRemoteChangeProperty(ZMapXRemoteObj object, Atom atom, char *cha
if
(
windowError
)
result
=
ZMAPXREMOTE_SENDCOMMAND_PROPERTY_ERROR
;
g_free
(
atom_name
);
return
result
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment