diff options
| author | Tor Aamodt <[email protected]> | 2010-08-08 04:21:09 -0800 |
|---|---|---|
| committer | Tor Aamodt <[email protected]> | 2010-08-08 04:21:09 -0800 |
| commit | 34f6823f1ca28a0e99cd810061bbbf833f803b9c (patch) | |
| tree | 6a177e13ca8aae6e6f28dd5e4e274bdba0852745 /src/debug.cc | |
| parent | 06435e77c580bf7737333929ed26d3863949bd15 (diff) | |
check if debug thread selected
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7163]
Diffstat (limited to 'src/debug.cc')
| -rw-r--r-- | src/debug.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/debug.cc b/src/debug.cc index 0691d78..6bddb48 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -155,19 +155,21 @@ void gpgpu_debug() g_global_mem->set_watch(addr,next_brkpt); breakpoints[next_brkpt++] = brk_pt(addr,value); } else if( !strcmp(tok,"l") ) { - if( brk_thd == NULL ) - printf("no thread selected"); - addr_t pc = brk_thd->get_pc(); - addr_t start_pc = (pc<5)?0:(pc-5); - for( addr_t p=start_pc; p <= pc+5; p++ ) { - const ptx_instruction *i = brk_thd->get_inst(p); - if( i ) { - if( p != pc ) - printf( " " ); - else - printf( "==> " ); - i->print_insn(stdout); - printf( "\n" ); + if( brk_thd == NULL ) { + printf("no thread selected\n"); + } else { + addr_t pc = brk_thd->get_pc(); + addr_t start_pc = (pc<5)?0:(pc-5); + for( addr_t p=start_pc; p <= pc+5; p++ ) { + const ptx_instruction *i = brk_thd->get_inst(p); + if( i ) { + if( p != pc ) + printf( " " ); + else + printf( "==> " ); + i->print_insn(stdout); + printf( "\n" ); + } } } } else if( !strcmp(tok,"h") ) { |
