User forums > Help

Problem pausing debugger using TDM-GCC64, C::B v13.12

<< < (4/5) > >>

oBFusCATed:
Can you post a log from a command ling gdb session?

ollydbg:
I guess the GDB stack sniffer just failed to unwind a frame. This is because when you halt the debugee, it may paused in a system dll which does not have any debug information GDB knows. (Maybe, you can try a more recent GDB to see its sniffer get more robust :))

Do the below steps work after those situation happens? (either in the command line or under C::B)

--- Code: ---1, set a bp in the line such as "++x;",
2, you run the continue command
3, the debugee will hit this breakpoint.

--- End code ---



--- Quote from: Vuki on May 11, 2014, 07:32:23 pm ---I used glindsey's code from this topic. After pausing the debugger, this is all I get from the debugger log:
....
At this moment, I can resume the program and it runs. I can set a breakpoint in the code and it stops there. But I can't get to the program code in which the program is at the moment of pausing (the loop in this example). As you see, the program is not even in the stack trace.
...

--- End quote ---
Oh, it looks like you can hit the BP, which verify my guess.

--- Quote ---I can't get to the program code
--- End quote ---
This means GDB can't map the instruction address to source code location.  :)

Vuki:

--- Quote from: oBFusCATed on May 13, 2014, 09:12:59 am ---Can you post a log from a command ling gdb session?

--- End quote ---

I've compiled the latest gdb 7.7.1 but it didn't help. Seems it's a limitation of gdb on 64-bit windows.
gdb log below.


--- Code: ---Reading symbols from ttt.exe...done.
(gdb) r
Starting program: c:\C\MinGW\MSYS\home\Greg\gdb-7.7.1\_build\bin\ttt.exe
[New Thread 10800.0x1a38]
Hello world!
0... Pausing for a second...
1... Pausing for a second...
2... Pausing for a second...
3... Pausing for a second...
[New Thread 10800.0x1588]

Program received signal SIGINT, Interrupt.
[Switching to Thread 10800.0x1588]
0x0000000077a449f2 in KERNEL32!CtrlRoutine ()
   from C:\Windows\system32\kernel32.dll
(gdb) bt
#0  0x0000000077a449f2 in KERNEL32!CtrlRoutine ()
   from C:\Windows\system32\kernel32.dll
#1  0x0000000077a059ed in KERNEL32!BaseThreadInitThunk ()
   from C:\Windows\system32\kernel32.dll
#2  0x0000000077c3c541 in ntdll!RtlUserThreadStart ()
   from C:\Windows\system32\ntdll.dll
#3  0x0000000000000000 in ?? ()
(gdb) c
Continuing.
[Thread 10800.0x1588 exited with code 0]
4... Pausing for a second...
5... Pausing for a second...
6... Pausing for a second...
[New Thread 10800.0x1c60]

Program received signal SIGINT, Interrupt.
[Switching to Thread 10800.0x1c60]
0x0000000077a449f2 in KERNEL32!CtrlRoutine ()
   from C:\Windows\system32\kernel32.dll
(gdb) bt
#0  0x0000000077a449f2 in KERNEL32!CtrlRoutine ()
   from C:\Windows\system32\kernel32.dll
#1  0x0000000077a059ed in KERNEL32!BaseThreadInitThunk ()
   from C:\Windows\system32\kernel32.dll
#2  0x0000000077c3c541 in ntdll!RtlUserThreadStart ()
   from C:\Windows\system32\ntdll.dll
#3  0x0000000000000000 in ?? ()
(gdb) b 13
Breakpoint 1 at 0x401571: file ttt.cpp, line 13.
(gdb) c
Continuing.
[Switching to Thread 10800.0x1a38]

Breakpoint 1, main () at ttt.cpp:13
13          ++x;
(gdb)

--- End code ---

ollydbg:
Hi, Vuki, in the previous post, do you press the CTRL+C to stop the debugee? I mean can we send a CTRL+C signal to debugee or GDB to halt the debugee.

Something like: http://stackoverflow.com/questions/7085604/sending-c-to-python-subprocess-objects-on-windows

Vuki:
I do press CTL+C, because it's the only way I know to stop GDB in command line. But since it does not return to the program, I doubt that it would be better solution than the current one. From the discussion so far, it seems that the problem is on the gdb side.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version