Bug 15945 - gdb.mi/mi-catch-load.exp failed on Windows
Summary: gdb.mi/mi-catch-load.exp failed on Windows
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: mi (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-12 00:29 UTC by Yao Qi
Modified: 2024-01-13 20:45 UTC (History)
1 user (show)

See Also:
Host: i686-pc-mingw32
Target: i686-pc-mingw32
Build: x86_64-unknown-linux-gnu
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments
Patch to fix compilation error in mi-catch-load.c (379 bytes, patch)
2013-09-12 00:29 UTC, Yao Qi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yao Qi 2013-09-12 00:29:21 UTC
Created attachment 7192 [details]
Patch to fix compilation error in mi-catch-load.c

mi-catch-load.c can't be compiled successfully on Windows,

  mi-catch-load.c:18:19: fatal error: dlfcn.h: No such file or directory

with the patch attached applied, mi-catch-load.c can be compiled successfully. However, there are two fails in the test result.

FAIL: gdb.mi/mi-catch-load.exp: catch-load: solib-event stop
FAIL: gdb.mi/mi-catch-load.exp: catch-unload: solib-event stop

222-catch-load -t mi-catch-load-so.so*^M
222^done,bkpt={number="2",type="catchpoint",disp="del",enabled="y",what="load of library matching mi-catch-load-so.so*",catch-type="load",thread-groups=["i1"],times="0"}^M^M
(gdb) ^M^M
~"Catchpoint 2 (load)"^M^M
PASS: gdb.mi/mi-catch-load.exp: catch-load: catch load
-exec-continue^M
^running^M^M
*running,thread-id="all"^M^M
(gdb) ^M^M
=thread-exited,id="1",group-id="i1"^M^M
=thread-group-exited,id="i1",exit-code="0"^M^M
*stopped,reason="exited-normally"^M^M
(gdb) ^M^M
FAIL: gdb.mi/mi-catch-load.exp: catch-load: solib-event stop

222-catch-unload -t mi-catch-load-so.so*^M
222^done,bkpt={number="2",type="catchpoint",disp="del",enabled="y",what="unload of library matching mi-catch-load-so.so*",catch-type="unload",thread-groups=["i1"],times="0"}^M^M
(gdb) ^M^M
~"Catchpoint 2 (unload)"^M^M
PASS: gdb.mi/mi-catch-load.exp: catch-unload: catch unload
-exec-continue^M
^running^M^M
*running,thread-id="all"^M^M
(gdb) ^M^M
=thread-exited,id="1",group-id="i1"^M^M
=thread-group-exited,id="i1",exit-code="0"^M^M
*stopped,reason="exited-normally"^M^M
(gdb) ^M^M
FAIL: gdb.mi/mi-catch-load.exp: catch-unload: solib-event stop
Comment 1 Hannes Domani 2024-01-13 20:45:53 UTC
Weird, this succeeds for me with the oldest gdb I have where 'catch-load' exists, which is 7.6.1:
> (gdb)
> start
> &"start\n"
> ~"Temporary breakpoint 1 at 0x4015e6: file C:/src/repos/binutils-gdb.git/gdb/testsuite/gdb.mi/mi-catch-load.c, line 35.\n"
> =breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x004015e6",func="main",file="C:/src/repos/binutils-gdb.git/gdb/testsuite/gdb.mi/mi-catch-load.c",fullname="C:\\\\src\\\\repos\\\\binutils-gdb.git\\\\gdb\\\\testsuite\\\\gdb.mi\\\\mi-catch-load.c",line="35",thread-groups=["i1"],times="0",original-location="main"}
> ~"Starting program: C:\\gdb\\build64\\gdb-git-python3\\gdb\\testsuite\\outputs\\gdb.mi\\mi-catch-load/mi-catch-load.exe \n"
> =thread-group-started,id="i1",pid="7164"
> =thread-created,id="1",group-id="i1"
> ~"[New Thread 7164.0x2278]\n"
> ^running
> *running,thread-id="all"
> (gdb)
> =library-loaded,id="C:\\Windows\\system32\\ntdll.dll",target-name="C:\\Windows\\system32\\ntdll.dll",host-name="C:\\Windows\\system32\\ntdll.dll",symbols-loaded="0",thread-group="i1"
> =library-loaded,id="C:\\Windows\\syswow64\\kernel32.dll",target-name="C:\\Windows\\syswow64\\kernel32.dll",host-name="C:\\Windows\\syswow64\\kernel32.dll",symbols-loaded="0",thread-group="i1"
> =library-loaded,id="C:\\Windows\\syswow64\\KernelBase.dll",target-name="C:\\Windows\\syswow64\\KernelBase.dll",host-name="C:\\Windows\\syswow64\\KernelBase.dll",symbols-loaded="0",thread-group="i1"
> =library-loaded,id="C:\\Program Files\\AVAST Software\\Avast\\x86\\aswhook.dll",target-name="C:\\Program Files\\AVAST Software\\Avast\\x86\\aswhook.dll",host-name="C:\\Program Files\\AVAST Software\\Avast\\x86\\aswhook.dll",symbols-loaded="0",thread-group="i1"
> =library-loaded,id="C:\\Windows\\syswow64\\msvcrt.dll",target-name="C:\\Windows\\syswow64\\msvcrt.dll",host-name="C:\\Windows\\syswow64\\msvcrt.dll",symbols-loaded="0",thread-group="i1"
> =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x004015e6",func="main",file="C:/src/repos/binutils-gdb.git/gdb/testsuite/gdb.mi/mi-catch-load.c",fullname="C:\\\\src\\\\repos\\\\binutils-gdb.git\\\\gdb\\\\testsuite\\\\gdb.mi\\\\mi-catch-load.c",line="35",thread-groups=["i1"],times="1",original-location="main"}
> ~"\nTemporary breakpoint "
> ~"1, main () at C:/src/repos/binutils-gdb.git/gdb/testsuite/gdb.mi/mi-catch-load.c:35\n"
> ~"35\t  h = dlopen (libname, RTLD_LAZY);\n"
> *stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x004015e6",func="main",args=[],file="C:/src/repos/binutils-gdb.git/gdb/testsuite/gdb.mi/mi-catch-load.c",fullname="C:\\src\\repos\\binutils-gdb.git\\gdb\\testsuite\\gdb.mi\\mi-catch-load.c",line="35"},thread-id="1",stopped-threads="all"
> =breakpoint-deleted,id="1"
> (gdb)
> 111-gdb-set auto-solib-add on
> 111^done
> (gdb)
> 222-catch-load -t mi-catch-load-so.so
> 222^done,bkpt={number="2",type="catchpoint",disp="del",enabled="y",what="load of library matching mi-catch-load-so.so",catch-type="load",thread-groups=["i1"],times="0"}
> (gdb)
> ~"Catchpoint 2 (load)"
> -exec-continue
> ^running
> *running,thread-id="all"
> (gdb)
> =library-loaded,id="C:\\gdb\\build64\\gdb-git-python3\\gdb\\testsuite\\outputs\\gdb.mi\\mi-catch-load\\mi-catch-load-so.so",target-name="C:\\gdb\\build64\\gdb-git-python3\\gdb\\testsuite\\outputs\\gdb.mi\\mi-catch-load\\mi-catch-load-so.so",host-name="C:\\gdb\\build64\\gdb-git-python3\\gdb\\testsuite\\outputs\\gdb.mi\\mi-catch-load\\mi-catch-load-so.so",symbols-loaded="0",thread-group="i1"
> =breakpoint-modified,bkpt={number="2",type="catchpoint",disp="del",enabled="y",what="load of library matching mi-catch-load-so.so",catch-type="load",thread-groups=["i1"],times="1"}
> *stopped,bkptno="2",disp="del",reason="solib-event",added=[library="C:\\gdb\\build64\\gdb-git-python3\\gdb\\testsuite\\outputs\\gdb.mi\\mi-catch-load\\mi-catch-load-so.so"],frame={addr="0x76fafc62",func="ntdll!ZwMapViewOfSection",args=[],from="C:\\Windows\\system32\\ntdll.dll"},thread-id="1",stopped-threads="all"
> =breakpoint-deleted,id="2"
> (gdb)

I wonder why it didn't work for Yao.