Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request #19

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
*.so
*.pyc
*.log
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AndBug</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
8 changes: 8 additions & 0 deletions .pydevproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/${PROJECT_DIR_NAME}/src</path>
</pydev_pathproperty>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
</pydev_project>
10 changes: 10 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eclipse.preferences.version=1
encoding//lib/andbug/cmd/break-detail.py=utf-8
encoding//lib/andbug/cmd/break.py=utf-8
encoding//lib/andbug/cmd/inspect.py=utf-8
encoding//lib/andbug/cmd/method_detail.py=utf-8
encoding//lib/andbug/log.py=utf-8
encoding//lib/andbug/proto.py=utf-8
encoding//lib/andbug/util.py=utf-8
encoding//lib/andbug/vm.py=utf-8
encoding/andbug=utf-8
15 changes: 15 additions & 0 deletions andbug
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
Expand All @@ -16,6 +17,7 @@
'this script executes command modules found in andbug.commands'
import os, os.path, sys, traceback, atexit


def panic(why, exit=True, exc=False):
sys.stderr.write("!! %s\n" % (why,))
sys.stderr.flush()
Expand All @@ -24,6 +26,19 @@ def panic(why, exit=True, exc=False):
if exit:
sys.exit(-1)

def cur_file_dir():
#获取脚本路径
path = sys.path[0]
#判断为脚本文件还是py2exe编译后的文件,如果是脚本文件,则返回的是脚本的目录,
#如果是py2exe编译后的文件,则返回的是编译后的文件路径
if os.path.isdir(path):
return path
elif os.path.isfile(path):
return os.path.dirname(path)

sys.path.append(cur_file_dir()+"/lib")
#sys.path.append("/home/anbc/work_folder/andbug_work/andbug/lib")

def main(args):
import andbug, andbug.cmd, andbug.command

Expand Down
Loading