FAQ
================================:example files
src/test.go
------------------------
package main
import (
   . "clib"
)
func main() {
   a := "123";
   b := "456";
   c := "789";
   println(a,b,c);
   Output("ABC");
}
------------------------
src/clib/clib.h
------------------------
#ifndef CLIB
void output(char* str);
#endif
------------------------
src/clib/clib.c
------------------------
#include "clib.h"
#include <stdio.h>
void output(char* str)
{
  printf("%s\n", str);
}
------------------------
src/clib/clib.go
------------------------
package clib
/*
#cgo CFLAGS:-g
#include "clib.h"
*/
import "C"
func Output(s string) {
   p := C.CString(s);
   C.output(p);
}
================================:exec code

go build -gcflags "-N -l" test.go
gdb ./test
b 10
r
info locals // <- every variable's value is wrong!

================================

Who can help me solve this problem,thank you very much.


My Environment:

ubuntu 11.04 i386
gdb 7.6

go 1.1

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Huangminping at Jun 17, 2013 at 3:14 pm
    Who can help me solve this problem, many thanks.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJun 17, '13 at 4:17a
activeJun 17, '13 at 3:14p
posts2
users2
websitegolang.org

2 users in discussion

Huangmipi: 1 post Huangminping: 1 post

People

Translate

site design / logo © 2021 Grokbase