[PATCH] [WineDbg]: when reloading a minidump, recreate all threads from the thread

Eric Pouech eric.pouech at wanadoo.fr
Sun Mar 4 13:01:59 CST 2007


record (and not just the first one)

A+
---

 programs/winedbg/tgt_minidump.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/programs/winedbg/tgt_minidump.c b/programs/winedbg/tgt_minidump.c
index 34e5b17..62071c7 100644
--- a/programs/winedbg/tgt_minidump.c
+++ b/programs/winedbg/tgt_minidump.c
@@ -283,11 +283,14 @@ static enum dbg_start minidump_do_reload
 
     if (MiniDumpReadDumpStream(data->mapping, ThreadListStream, &dir, &stream, &size))
     {
-        MINIDUMP_THREAD_LIST*     mtl = (MINIDUMP_THREAD_LIST*)stream;
-        MINIDUMP_THREAD*          mt = &mtl->Threads[0];
+        MINIDUMP_THREAD_LIST*   mtl = (MINIDUMP_THREAD_LIST*)stream;
+        ULONG                   i;
 
-        dbg_add_thread(dbg_curr_process, mt->ThreadId, NULL, 
-                       (void*)(DWORD_PTR)mt->Teb);
+        for (i = 0; i < mtl->NumberOfThreads; i++)
+        {
+            dbg_add_thread(dbg_curr_process, mtl->Threads[i].ThreadId, NULL,
+                           (void*)(DWORD_PTR)mtl->Threads[i].Teb);
+        }
     }
     /* first load ELF modules, then do the PE ones */
     if (MiniDumpReadDumpStream(data->mapping, Wine_ElfModuleListStream, &dir,
@@ -351,6 +354,7 @@ static enum dbg_start minidump_do_reload
             stack_backtrace(mes->ThreadId);
             source_list_from_addr(&addr, 0);
         }
+        else WINE_FIXME("dsfsdf\n");
     }
     return start_ok;
 }



More information about the wine-patches mailing list