LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Runtime symbol table access. Work in progress. | 5 // Runtime symbol table access. Work in progress. |
6 // The Plan 9 symbol table is not in a particularly convenient form. | 6 // The Plan 9 symbol table is not in a particularly convenient form. |
7 // The routines here massage it into a more usable form; eventually | 7 // The routines here massage it into a more usable form; eventually |
8 // we'll change 6l to do this for us, but it is easier to experiment | 8 // we'll change 6l to do this for us, but it is easier to experiment |
9 // here than to change 6l and all the other tools. | 9 // here than to change 6l and all the other tools. |
10 // | 10 // |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 for(i=0; i<s.len; i++) { | 552 for(i=0; i<s.len; i++) { |
553 if(s.str[i] != p[0]) | 553 if(s.str[i] != p[0]) |
554 continue; | 554 continue; |
555 if(hasprefix((String){s.str + i, s.len - i}, p)) | 555 if(hasprefix((String){s.str + i, s.len - i}, p)) |
556 return 1; | 556 return 1; |
557 } | 557 } |
558 return 0; | 558 return 0; |
559 } | 559 } |
560 | 560 |
561 bool | 561 bool |
562 runtime·showframe(Func *f) | 562 runtime·showframe(Func *f, bool current) |
563 { | 563 { |
564 static int32 traceback = -1; | 564 static int32 traceback = -1; |
565 | 565 |
566 » if(runtime·throwing) | 566 » if(current && m->throwing > 0) |
567 return 1; | 567 return 1; |
568 if(traceback < 0) | 568 if(traceback < 0) |
569 traceback = runtime·gotraceback(); | 569 traceback = runtime·gotraceback(); |
570 » return traceback > 1 || contains(f->name, ".") && !hasprefix(f->name, "r
untime."); | 570 » return traceback > 1 || f != nil && contains(f->name, ".") && !hasprefix
(f->name, "runtime."); |
571 } | 571 } |
LEFT | RIGHT |