This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 0/2] Make gdbserver work with filename-only binaries


On 2018-03-01 08:08, Christophe Lyon wrote:
These new patches seem to cause problems with building for ming (using
i686-w64-mingw32-g++):

/gdb/common/pathstuff.c: In function 'gdb::unique_xmalloc_ptr<char>
gdb_realpath(const char*)':
/gdb/common/pathstuff.c:56:14: error: 'MAX_PATH' was not declared in this scope
     char buf[MAX_PATH];
              ^
/gdb/common/pathstuff.c:57:5: error: 'DWORD' was not declared in this scope
     DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL);
     ^
/gdb/common/pathstuff.c:57:11: error: expected ';' before 'len'
     DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL);
           ^
/gdb/common/pathstuff.c:63:9: error: 'len' was not declared in this scope
     if (len > 0 && len < MAX_PATH)
         ^
/gdb/common/pathstuff.c:64:54: error: 'buf' was not declared in this scope
       return gdb::unique_xmalloc_ptr<char> (xstrdup (buf));
                                                      ^
make[2]: *** [pathstuff.o] Error 1

I saw this while rebuilding branch 8.1, I didn't check master.

Sorry if this has already been reported, I can't find any mention of
this problem in the list archives.

I suspect there's already a recommended way of handling MAX_PATH cross-platform.

Thanks

Christophe

MAX_PATH is windows specific, note that this code is in an #if defined (_WIN32) guard. I think we just need to add #include <windows.h> with the same guard.

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]