Skip to content

Commit

Permalink
minor bisect change to try running some commands on ipython
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfl committed Aug 31, 2016
1 parent d08d6fa commit 239df8a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@
// unable to determine where it should actually be performing this, so we are just makeing the end of the branchable frame
// close out any traces that were created in this frame
// ^^^ this might have been a bug with the intergration, but now it is using this auto closing as a "feature"
//#define CONF_ALLOW_UNCLOSED_TRACES
#define CONF_ALLOW_UNCLOSED_TRACES


// using timers in addition to number of times it loops to determine what to trace
//#define CONF_USE_TIMERS
#ifdef CONF_RELEASE_BUILD
# define CONF_USE_TIMERS
#endif
#define CONF_TIMER_DELAY_MS CONF_BUILD_TOGGLE(0, 5000)

#define CONF_ESTIMATE_INSTRUCTIONS
Expand Down
1 change: 0 additions & 1 deletion src/jit_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ namespace redmagic {

mem_loc_t frame_stack_ptr = -1;


#ifdef CONF_ESTIMATE_INSTRUCTIONS
int num_backwards_loops = 0;
uint64_t instruction_cnt_at_start = 0;
Expand Down
3 changes: 1 addition & 2 deletions src/manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -871,11 +871,11 @@ void* Manager::ensure_not_traced() {
}

void* Manager::end_branchable_frame(void *ret_addr, void **stack_ptr) {
auto head = get_tracer_head();
#ifdef CONF_ALLOW_UNCLOSED_TRACES
// check if the current trace should be finished out
// if so, have it fallthrough and then run the corresponding block of code
// if there are multiple traces then this method will end up getting call once per each trace that needs to be cleaned up
auto head = get_tracer_head();
// assert that this return address actually came from a call instead of a tail optimized jmp, b/c life is bad...
assert(head->is_traced || ((uint8_t*)ret_addr)[-5] == 0xE8);
assert(ret_addr == *stack_ptr);
Expand Down Expand Up @@ -924,7 +924,6 @@ void* Manager::end_branchable_frame(void *ret_addr, void **stack_ptr) {
}
}
#endif
auto head = get_tracer_head();
assert(head->frame_stack_ptr > (mem_loc_t)stack_ptr);
branchable_frame_id--;
assert(head->frame_id <= branchable_frame_id);
Expand Down
8 changes: 5 additions & 3 deletions tools/biset.py → tools/bisect.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ def do_run(instruction_count, process, error_search, out_log):
cnt = 0
qu = deque([], maxlen=600)

proc = subprocess.Popen(process, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
inp = open('/home/matthew/developer/redmagic/tools/input')

proc = subprocess.Popen(process, stdin=inp, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)

try:
for li in proc.stdout:
Expand Down Expand Up @@ -51,7 +53,7 @@ def main():
error_search = ['IndexError', 'Assertion', 'SIGSEGV', 'Traceback']
#process = '/home/matthew/developer/cpython/python -m IPython -c exit()'.split()
# run under gdb since the program seems to change behavor depending on how it is run
process = ['gdb', '/home/matthew/developer/cpython/python', '--eval-command=run -m IPython -c "exit()"', '--eval-command=quit', '-batch']
process = ['gdb', '/home/matthew/developer/cpython/python', '--eval-command=run -m IPython', '--eval-command=quit', '-batch']

try:
while max_i - min_i > 2:
Expand All @@ -67,7 +69,7 @@ def main():
do_run(2*max_i, process, error_search, olog)
finally:
print(min_i, max_i)




Expand Down
6 changes: 6 additions & 0 deletions tools/input
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
123
4 + 5
def u(): for i in xrange(50): print i
u()

exit()
Expand Down

0 comments on commit 239df8a

Please sign in to comment.