mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
add gdb commands: koch, nim, nimble (#10741)
* add gdb commands: koch, nim, nimble * make commands path independent
This commit is contained in:
committed by
Andreas Rumpf
parent
287206f993
commit
ba38c05eb6
@@ -168,6 +168,60 @@ class DollarPrintCmd (gdb.Command):
|
||||
|
||||
DollarPrintCmd()
|
||||
|
||||
|
||||
################################################################################
|
||||
##### GDB Commands to invoke common nim tools.
|
||||
################################################################################
|
||||
|
||||
|
||||
import subprocess, os
|
||||
|
||||
|
||||
class KochCmd (gdb.Command):
|
||||
"""Command that invokes ``koch'', the build tool for the compiler."""
|
||||
|
||||
def __init__ (self):
|
||||
super (KochCmd, self).__init__ ("koch",
|
||||
gdb.COMMAND_USER, gdb.COMPLETE_FILENAME)
|
||||
self.binary = os.path.join(
|
||||
os.path.dirname(os.path.dirname(__file__)), "koch")
|
||||
|
||||
def invoke(self, argument, from_tty):
|
||||
import os
|
||||
subprocess.run([self.binary] + gdb.string_to_argv(argument))
|
||||
|
||||
KochCmd()
|
||||
|
||||
|
||||
class NimCmd (gdb.Command):
|
||||
"""Command that invokes ``nim'', the nim compiler."""
|
||||
|
||||
def __init__ (self):
|
||||
super (NimCmd, self).__init__ ("nim",
|
||||
gdb.COMMAND_USER, gdb.COMPLETE_FILENAME)
|
||||
self.binary = os.path.join(
|
||||
os.path.dirname(os.path.dirname(__file__)), "bin/nim")
|
||||
|
||||
def invoke(self, argument, from_tty):
|
||||
subprocess.run([self.binary] + gdb.string_to_argv(argument))
|
||||
|
||||
NimCmd()
|
||||
|
||||
|
||||
class NimbleCmd (gdb.Command):
|
||||
"""Command that invokes ``nimble'', the nim package manager and build tool."""
|
||||
|
||||
def __init__ (self):
|
||||
super (NimbleCmd, self).__init__ ("nimble",
|
||||
gdb.COMMAND_USER, gdb.COMPLETE_FILENAME)
|
||||
self.binary = os.path.join(
|
||||
os.path.dirname(os.path.dirname(__file__)), "bin/nimble")
|
||||
|
||||
def invoke(self, argument, from_tty):
|
||||
subprocess.run([self.binary] + gdb.string_to_argv(argument))
|
||||
|
||||
NimbleCmd()
|
||||
|
||||
################################################################################
|
||||
##### Value pretty printers
|
||||
################################################################################
|
||||
|
||||
Reference in New Issue
Block a user