aboutsummaryrefslogtreecommitdiffstats
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xbfd/delf.py27
-rwxr-xr-xbfd/load.py5
2 files changed, 31 insertions, 1 deletions
diff --git a/bfd/delf.py b/bfd/delf.py
new file mode 100755
index 0000000..60b2697
--- /dev/null
+++ b/bfd/delf.py
@@ -0,0 +1,27 @@
+#!/usr/bin/python3
+
+import argparse
+import code
+import readline
+import signal
+import sys
+from load import premain, CLIArgParser, SigHandler_SIGINT
+
+def main():
+ argparser = CLIArgParser()
+ if argparser.args.dbg:
+ try:
+ premain(argparser)
+ except Exception as e:
+ print(e.__doc__)
+ if e.message: print(e.message)
+ signal.signal(signal.SIGINT, SigHandler_SIGINT)
+ variables = globals().copy()
+ variables.update(locals())
+ shell = code.InteractiveConsole(variables)
+ shell.interact(banner="DELF REPL")
+ else:
+ premain(argparser)
+
+if __name__ == "__main__":
+ main()
diff --git a/bfd/load.py b/bfd/load.py
index ae0771f..73ff05e 100755
--- a/bfd/load.py
+++ b/bfd/load.py
@@ -16,6 +16,7 @@
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*/
+#**********************************************************************************************************************/
import argparse
import sys
import readline
@@ -1451,7 +1452,9 @@ def main():
if argparser.args.dbg:
try:
premain(argparser)
- except:
+ except Exception as e:
+ print(e.__doc__)
+ if e.message: print(e.message)
signal.signal(signal.SIGINT, SigHandler_SIGINT)
variables = globals().copy()
variables.update(locals())