summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-09-11 03:23:41 +0000
committermidipix <writeonce@midipix.org>2019-09-11 05:23:12 +0000
commitb8ce7eb769128ce4e3562a3681c2b3ffb1dd3827 (patch)
treeb32efaf54208c79d453b0b1da99c63cd3cc02882
parent3b62b39608c8b4bdda1c092544af920f30be2b30 (diff)
downloadchainport-b8ce7eb769128ce4e3562a3681c2b3ffb1dd3827.tar.bz2
chainport-b8ce7eb769128ce4e3562a3681c2b3ffb1dd3827.tar.xz
mgdb: winnt_pid_to_exec_file(): initial implementation.
-rw-r--r--overlay/mgdb/gdb/winnt-nat.c21
1 files 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;
}