MCPcopy Create free account
hub / github.com/SySS-Research/hallucinate / java_attach_startup

Function java_attach_startup

hallucinate/java.py:137–154  ·  view source on GitHub ↗
(cmdline, h, args)

Source from the content-addressed store, hash-verified

135
136
137def java_attach_startup(cmdline, h, args):
138 global _javaserver, _agentcfg
139 if _javaserver is not None:
140 logging.warning("Java server can only be initialized once")
141 return
142
143 logging.info('Injecting agent during Java launch, starting server')
144 s, key, host, port = start_server(h, host=args.javaagenthost, port=args.javaagentport, key=args.javaagentkey)
145 debug = ''
146 if args.verbose > 1:
147 debug = 'debug;'
148 _agentcfg = '%sserverport=%d;serveraddr=%s;serverkey=%s' % (debug, port, host, key)
149
150 agentjar = args.agentjar
151 if agentjar is None:
152 agentjar = os.path.dirname(os.path.realpath(__file__)) + os.sep + 'hallucinate-java-all.jar'
153
154 return [cmdline[0], '-javaagent:' + agentjar + '=' + _agentcfg] + cmdline[1:]
155
156
157def java_stop():

Callers 1

mainFunction · 0.90

Calls 1

start_serverFunction · 0.85

Tested by

no test coverage detected