I'm new to waf and trying to implement an analogue to a GNU make trick I often use:
gdb: application.elf
gdb -x gdbinit-debug $<
That is, allow 'make gdb' to launch an interactive GDB session for debugging.
I've written a GDB task for waf, a feature that uses it, and hooked it up to a top-level command. But I don't see any of the I/O from GDB. It is running, according to ps
, but I seem to not be allowed to play along.
Is there a way to make this happen in waf?
Edit: here's the relevant part of the script, I think:
class gdb_task(Task):
def run(self):
cmd = [ self.env.GDB, '--silent', '--batch' ]
for script in self.inputs[:-1]:
cmd.extend(['-x', script.abspath()])
cmd.append(self.inputs[-1].abspath())
return self.exec_command(cmd)
color = 'CYAN'
def runnable_status(self):
return RUN_ME
def keyword(self):
return 'GDB'
def __str__(self):
node = self.inputs[-1]
return node.path_from(node.ctx.launch_node())
It works fine, but if i take the --batch
off, it just hangs with no output when run.