From b8ce7eb769128ce4e3562a3681c2b3ffb1dd3827 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 11 Sep 2019 03:23:41 +0000 Subject: mgdb: winnt_pid_to_exec_file(): initial implementation. --- overlay/mgdb/gdb/winnt-nat.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/overlay/mgdb/gdb/winnt-nat.c b/overlay/mgdb/gdb/winnt-nat.c index 4686acc..564c7f2 100644 --- a/overlay/mgdb/gdb/winnt-nat.c +++ b/overlay/mgdb/gdb/winnt-nat.c @@ -133,10 +133,25 @@ static ptid_t winnt_get_ada_task_ptid (struct target_ops * t, long lwp, long tid static char * winnt_pid_to_exec_file (struct target_ops * t, int pid) { - (void)t; - (void)pid; + ssize_t ret; + struct winnt_process * pidinfo; + + if (!(pidinfo = winnt_process_record(pid))) + winnt_perror("internal error: record not found",pid); + + ret = __dbg_info_get( + pidinfo->pfd,0, + __DBG_INFO_IMAGE_RPATH, + outbuf,WINNT_OUTBUF_SIZE); - outbuf[0] = 0; + if (ret < 0) + ret = __dbg_info_get( + pidinfo->pfd,0, + __DBG_INFO_REPORTED_IMAGE_RPATH, + outbuf,WINNT_OUTBUF_SIZE); + + if (ret < 0) + outbuf[0] = 0; return outbuf; } -- cgit v1.2.3