Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug 668 tweak call stack parser #7

Merged
merged 1 commit into from

2 participants

@arnodb

This change was tested on linux x86_64, with a vanilla perl 5.12.5 (freshly compiled) and a distributed perl 5.18.2 (debian). It should fix issue http://sourceforge.net/p/e-p-i-c/bugs/668/.

It does two things:

  • match the new debugger stack pattern (apostrophe)
  • skip the additional DB::DB stack item which is a duplicate of the one obtained from currentIP (hackish but it works)
@jploski
Owner

Thanks! I tried to reproduce the DB::DB case for skipFirst=1 using 5.8.12, but apparently it doesn't happen to me. Can you explain it a bit more or maybe post a simple demo script (which I could then integrate into test_Variables.pl or test_Debugger.pl)?

@arnodb

When I add System.out.println(stackTrace + "\n"); to the code, here is what I get with the following script:

use strict;

sub func2() {
    print "func 2\n";
}

sub func1() {
    print "func 1\n";
    func2;
}

func1;

print "end\n";

I start the debugger, and successively press F5,F6,F5.

Perl 5.12.5 (the first non empty trace appears after the first F5, i.e. when I enter func1):

. = main::func1() called from file `/home/arnaud/workspace/test-perl/stack.pl' line 12

. = main::func1() called from file `/home/arnaud/workspace/test-perl/stack.pl' line 12

. = main::func2() called from file `/home/arnaud/workspace/test-perl/stack.pl' line 9
. = main::func1() called from file `/home/arnaud/workspace/test-perl/stack.pl' line 12

Perl 5.18.2 (the first non empty trace appears before the first F5, i.e. first breakpoint):

@ = DB::DB called from file '/home/arnaud/workspace/test-perl/stack.pl' line 12

@ = DB::DB called from file '/home/arnaud/workspace/test-perl/stack.pl' line 8
. = main::func1() called from file '/home/arnaud/workspace/test-perl/stack.pl' line 12

@ = DB::DB called from file '/home/arnaud/workspace/test-perl/stack.pl' line 9
. = main::func1() called from file '/home/arnaud/workspace/test-perl/stack.pl' line 12

@ = DB::DB called from file '/home/arnaud/workspace/test-perl/stack.pl' line 4
. = main::func2() called from file '/home/arnaud/workspace/test-perl/stack.pl' line 9
. = main::func1() called from file '/home/arnaud/workspace/test-perl/stack.pl' line 12

Note: my 5.18 version comes from deb package perl 5.18.2-2 amd64. Maybe I should test with a vanilla install but I would be surprised if that changes anything.

@arnodb

Perl 5.18.2 freshly compiled with default (i.e. no) options: same thing.

@jploski jploski merged commit 3d2d764 into from
@jploski
Owner

I could see the DB::DB thing today - must have been testing with a wrong version of Perl previously. It's now released in version 0.6.55.

@arnodb

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 21, 2014
  1. Bug 668 tweak call stack parser

    Arnaud de Bossoreille authored
This page is out of date. Refresh to see the latest.
View
17 org.epic.debug/src/org/epic/debug/db/PerlThreadStack.java
@@ -52,8 +52,17 @@ public void update() throws DebugException
previousFrames.length > 0
? (StackFrame) previousFrames[0]
: null;
-
- StackFrame[] frames = new StackFrame[matches.length + 1];
+
+ int skipFirst = 0;
+ if (matches.length > 0) {
+ int firstLineNumber = Integer.parseInt(matches[0].toString(4));
+ if (matches[0].toString(2).startsWith("DB::DB ")
+ && firstLineNumber == currentIP.getLine()) {
+ // This is a duplicate, skip.
+ skipFirst = 1;
+ }
+ }
+ StackFrame[] frames = new StackFrame[matches.length + 1 - skipFirst];
frames[0] = new StackFrame(
thread,
currentIP.getPath(),
@@ -63,11 +72,11 @@ public void update() throws DebugException
previousTopFrame,
0);
- for (int pos = 0; pos < matches.length; ++pos)
+ for (int pos = skipFirst; pos < matches.length; ++pos)
{
IPath dbPath = new Path(matches[pos].toString(3));
- frames[pos + 1] = new StackFrame(
+ frames[pos + 1 - skipFirst] = new StackFrame(
thread,
dbPath,
Integer.parseInt(matches[pos].toString(4)),
View
2  org.epic.debug/src/org/epic/debug/db/RE.java
@@ -35,7 +35,7 @@ public RE()
ENTER_FRAME = newRE("^\\s*entering", false);
EXIT_FRAME = newRE("^\\s*exited", false);
STACK_TRACE = newRE(
- "(.)\\s+=\\s+(.*)called from .* \\`([^\\']+)\\'\\s*line (\\d+)\\s*",
+ "(.)\\s+=\\s+(.*)called from .* [\\`']([^\\']+)\\'\\s*line (\\d+)\\s*",
false);
}
Something went wrong with that request. Please try again.