Enable GDB for Windows (#8877)

This commit is contained in:
Anton Kochkov 2017-11-24 14:16:14 +08:00 committed by GitHub
parent c5cf714a6d
commit 12b9d8c3b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -9,7 +9,7 @@ files=[
'p/debug_bf.c',
#'p/debug_bochs.c',
'p/debug_esil.c',
#'p/debug_gdb.c',
'p/debug_gdb.c',
'p/debug_io.c',
'p/debug_native.c',
#'p/debug_qnx.c',
@ -56,6 +56,7 @@ endif
r_debug = library('r_debug', files,
include_directories: [platform_inc, include_directories([
'../bin/format/elf',
'../../shlr/gdb/include',
'../../shlr/windbg'
])],
c_args : ['-DCORELIB=1', '-I' + meson.current_build_dir() + '/../..'],

View File

@ -124,7 +124,11 @@ static RList *r_debug_gdb_map_get(RDebug* dbg) { //TODO
ut64 buflen = 16384;
// If /proc/%d/maps is not valid for gdbserver, we return NULL, as of now
snprintf (path, sizeof (path) - 1, "/proc/%d/maps", desc->pid);
#ifdef _MSC_VER
if (gdbr_open_file (desc, path, O_RDONLY, _S_IREAD | _S_IWRITE) < 0) {
#else
if (gdbr_open_file (desc, path, O_RDONLY, S_IRUSR | S_IWUSR | S_IXUSR) < 0) {
#endif
return NULL;
}
if (!(buf = malloc (buflen))) {

View File

@ -166,6 +166,7 @@ crypto = [
debug = [
'bf',
'esil',
'gdb',
'io',
'native',
'rap',
@ -201,6 +202,7 @@ io = [
'bfdbg',
'debug',
'default',
'gdb',
'gzip',
'http',
'ihex',