-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Added support for parsing multiple filename tables #218
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package main | ||
|
||
/* | ||
#include <stdio.h> | ||
char* foo(void) { return "hello, world!"; } | ||
*/ | ||
import "C" | ||
|
||
import "fmt" | ||
import "runtime" | ||
|
||
func main() { | ||
runtime.GOMAXPROCS(runtime.NumCPU()) | ||
fmt.Println(C.GoString(C.foo())) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -495,6 +495,34 @@ func TestSwitchThread(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestCGONext(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this test fail without your patch? I think there is already a CGO next test (I know it was my suggestion to write this test), but I want to make sure we have a test that triggers the behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. This test fails without my patch with exact same error. (with updated cgotest fixture only). |
||
//test if one can do 'next' in a cgo binary | ||
|
||
// On OSX with Go < 1.5 CGO is not supported due to: https://github.com/golang/go/issues/8973 | ||
if runtime.GOOS == "darwin" && strings.Contains(runtime.Version(), "1.4") { | ||
return | ||
} | ||
|
||
withTestProcess("cgotest", t, func(p *Process, fixture protest.Fixture) { | ||
pc, err := p.FindFunctionLocation("main.main", true, 0) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
_, err = p.SetBreakpoint(pc) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
err = p.Continue() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
err = p.Next() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
}) | ||
} | ||
|
||
type loc struct { | ||
line int | ||
fn string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add this include?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't reproduce until we have some C includes. Even new test will pass without this.
I have tested with all combinations between [oldTest, newTest, oldcgo, newcgo, cgo-with-only-runtime, cgo-with-only-header, cgo-with-header-runtime]
Tested with 1 variable at a time. newTest+cgo-with-header-with-runtime is required for fail test.