to ollydbg:
i look the debug log like below:
----------------------------------
.....
>>>>>>cb_gdb:
> bt 30
#0 Bugtest<int> (_x=1) at E:\program\bugtest\main.cpp:7
#1 0x004013ce in main () at E:\program\bugtest\main.cpp:13
>>>>>>cb_gdb:
> info frame
Stack level 0, frame at 0x22ff4c:
eip = 0x41775b in int Bugtest<int>(int) (E:\program\bugtest\main.cpp:7); saved eip 0x4013ce
called by frame at 0x22ff70
source language c++.
Arglist at 0x22ff44, args: _x=1
Locals at 0x22ff44, Previous frame's sp is 0x22ff4c
Saved registers:
ebp at 0x22ff44, eip at 0x22ff48
>>>>>>cb_gdb:
> x/32xb 0x0
Cannot access memory at address 0x0
0x0: >>>>>>cb_gdb:
> info threads
* 1 thread 2100.0xa98 Bugtest<int> (_x=1) at E:\program\bugtest\main.cpp:7
>>>>>>cb_gdb:
> disassemble
Dump of assembler code for function _Z7BugtestIiEiT_:
0x00417758 <int Bugtest<int>(int)+0>: push ebp
0x00417759 <int Bugtest<int>(int)+1>: mov ebp,esp
0x0041775b <int Bugtest<int>(int)+3>: mov eax,0x4
0x00417760 <int Bugtest<int>(int)+8>: leave
0x00417761 <int Bugtest<int>(int)+9>: ret
End of assembler dump.
>>>>>>cb_gdb:
> cont
Breakpoint 2, Bugtest<char> (_x=48 '0') at E:\program\bugtest\main.cpp:7
P:/bugtest/main.cpp:7:90:beg:0x417750
>>>>>>cb_gdb:
> info locals
No locals.
>>>>>>cb_gdb:
> info args
_x = 48 '0'
>>>>>>cb_gdb:
> info registers
eax 0x30 48
ecx 0x0 0
edx 0x0 0
ebx 0x7ffda000 2147328000
esp 0x22ff40 0x22ff40
ebp 0x22ff44 0x22ff44
esi 0x16 22
edi 0x20 32
eip 0x417750 0x417750 <int Bugtest<char>(char)+12>
eflags 0x202 [ IF ]
cs 0x1b 27
ss 0x23 35
ds 0x23 35
es 0x23 35
fs 0x3b 59
gs 0x0 0
>>>>>>cb_gdb:
> bt 30
#0 Bugtest<char> (_x=48 '0') at E:\program\bugtest\main.cpp:7
#1 0x00401401 in main () at E:\program\bugtest\main.cpp:15
>>>>>>cb_gdb:
> info frame
Stack level 0, frame at 0x22ff4c:
eip = 0x417750 in int Bugtest<char>(char) (E:\program\bugtest\main.cpp:7); saved eip 0x401401
called by frame at 0x22ff70
source language c++.
Arglist at 0x22ff44, args: _x=48 '0'
Locals at 0x22ff44, Previous frame's sp is 0x22ff4c
Saved registers:
ebp at 0x22ff44, eip at 0x22ff48
>>>>>>cb_gdb:
> x/32xb 0x0
Cannot access memory at address 0x0
0x0: >>>>>>cb_gdb:
> info threads
* 1 thread 2100.0xa98 Bugtest<char> (_x=48 '0') at E:\program\bugtest\main.cpp:7
>>>>>>cb_gdb:
----------------------------------------------------------------
at second breakpoint, no run zhe disassemble cmd,
if i send the cmd to GDB, can see the log:
> disassemble
Dump of assembler code for function _Z7BugtestIcEiT_:
0x00417744 <int Bugtest<char>(char)+0>: push ebp
0x00417745 <int Bugtest<char>(char)+1>: mov ebp,esp
0x00417747 <int Bugtest<char>(char)+3>: sub esp,0x4
0x0041774a <int Bugtest<char>(char)+6>: mov eax,DWORD PTR [ebp+0x8]
0x0041774d <int Bugtest<char>(char)+9>: mov BYTE PTR [ebp-0x4],al
0x00417750 <int Bugtest<char>(char)+12>: mov eax,0x1
0x00417755 <int Bugtest<char>(char)+17>: leave
0x00417756 <int Bugtest<char>(char)+18>: ret
End of assembler dump.
>>>>>>cb_gdb:
--------------------------------------------------
i don't know why the disassemble cmd not autorun