If so, that sounds more like a problem with gdb and/or mingw? Does this installation of gdb work with plain C programs?
On Sun, Aug 21, 2016 at 4:40 PM, Giah de Barag <g...@crelg.com> wrote: > Further info on this problem with GDB. Here is a C function "prn" that > takes a char *. If I pass it a C string "foo" from the command-line in GDB, > it receives a zero. So neither passing NSString convenience variables nor > passing plain C string convenience variables works on latest GNUstep / > MINGW32 / MSYS2. > > #import <Foundation/Foundation.h> > > void prn(char *a) > { > // when call prn("foo") from > // GDB command line breaking > // here to examine, variable > // a = 0x0 !!! > printf("char is \'%s\'\n", a); fflush(stdout); > } > > int main( int argc, const char *argv[] ) > { > id pool = [NSAutoreleasePool new]; > id foo = @"foo"; > char *s = [foo cString]; > prn(s); > // now invoke prn from gdb > // b prn > // p prn("foo") > // p a > // $1 = 0x0 > // "foo" --> 0x0 ??? > [pool release]; > return 0; > } > > > > > _______________________________________________ > Gnustep-dev mailing list > Gnustep-dev@gnu.org > https://lists.gnu.org/mailman/listinfo/gnustep-dev >
_______________________________________________ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev