Re: [PATCH] Fix up msymbol type of dll trampoline to mst_solib_trampoline

asmwarrior
2013-07-06T08:20:18Z

On 2013-7-6 15:41, Eli Zaretskii wrote:
>> We can't set breakpoint on 'Add_S' in current GDB,
>> >
>> > (gdb) b Add_S
>> > Function "Add_S" not defined.
>> > Make breakpoint pending on future shared library load? (y or [n])
>> >
>> > IMO, It is expected that 'b Add_S' can set a breakpoint on Add_S.
> Then GDB should look for Add_S@n symbols, where n is the number of
> bytes in the function's arguments.
Currently, I think GDB did not have this function implemented.
But if I expilicity write the "b Add_S@8", then I can set the breakpoint correctly, see the log below:
---------------------------------------------------------------------
E:\code\cb\test_code\learndll>gdb main.exe
GNU gdb (GDB) 7.6.50.20130705-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from E:\code\cb\test_code\learndll\main.exe...done.
(gdb) b main.c:18
Breakpoint 1 at 0x4016f6: file main.c, line 18.
(gdb) r
Starting program: E:\code\cb\test_code\learndll\main.exe
[New Thread 4176.0x1048]

Breakpoint 1, main (argc=1, argv=0x3e3f80) at main.c:18
18 int a = Add_C(1, 2);
(gdb) b Add_S
Function "Add_S" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) b Add_S@8
Breakpoint 2 at 0x70f41710: file add.c, line 10.
(gdb) c
Continuing.
3

Breakpoint 2, Add_S@8 (a=3, b=4) at add.c:10
10 return (a + b);
(gdb)
----------------------------------------------------------------------
Yuanhui Zhang