|
From: | Ivan Vučica |
Subject: | Re: 32bit GS on 64bit Win rebuild base from src |
Date: | Sun, 21 Aug 2016 23:32:59 +0100 |
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
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev
[Prev in Thread] | Current Thread | [Next in Thread] |