Commit graph

347 commits

Author SHA1 Message Date
Anton Kochkov
f3a0a3d01c Some coverity fixes 2020-01-10 12:30:23 +01:00
yossizap
2e5f4b41b4 Fix multithreaded breakpoint behavior in linux ##debug
The plugin wouldn't properly trace breakpoint hits on different threads
since they weren't switched to and the events weren't always handled.
Also, since the breakpoints are removed after they are found in one of the
threads, it's best to stop all threads for now even if dbg.threads is false.
2020-01-10 00:30:18 +01:00
yossizap
0de7c21bcc Always unset bps after continue and step hard ##debug (#15772)
Breakpoints were left in disassembly after a signal/break and there
are probably other cases that may lead to it.
2020-01-09 12:00:24 +01:00
pancake
836ea638b7 Revert "Validate bp addr on rebase and restore instead of preventing creation ##debug (#15750)"
This reverts commit e503bdd9c2.
2020-01-03 01:35:05 +01:00
yossizap
e503bdd9c2 Validate bp addr on rebase and restore instead of preventing creation ##debug (#15750)
This way it is possible to set breakpoints before starting debug through
'db' and the user will be notified when a breakpoint points to an
invalid map.
2020-01-03 00:57:18 +01:00
yossizap
59ce43d52c Fix reopening of windows debug after detaching not working ##debug
attach_new_process was called instead of regular attach because the
saved pid and tid in core->dbg weren't reset before calling r_debug_select
in a new session. Made sure this won't be a problem when using dp= after
dp- either.
2019-12-27 02:46:59 -06:00
yossizap
f0027aa263 Fix windows breakpoint rebasing ##debug
Calculate the diff ourselves since bp->delta is calculated with the
dbg->bp->baddr at the time of breakpoint creation, which may not
reflect the correct baddr and break the rebase.
2019-12-27 02:46:59 -06:00
GustavoLCR
0e19329de7 Fix rebasing for remote GDB on windows 2019-12-19 17:42:22 -06:00
yossizap
28cac248a6 Added an event to signal the end of the debug session ##debug 2019-12-15 10:46:48 +01:00
GustavoLCR
e43c9e7caf Fix some warnings (#15549) 2019-12-08 12:49:58 +01:00
fcasal
c2f01218f2 Rebase Breakpoints for PIEs ##debug (#12801) 2019-12-06 10:52:26 +01:00
yossizap
21ec674969 Allow debug plugins to modify pid/tid on select ##debug
Previously, when using `dp=`, the debug plugin would set a new tid based
on the requested pid, but r_debug_select would set the old tid as dbg->tid,
resulting in issues interacting with the current thread. This could also
be an issue when the requested pid/tid is invalid and the plugin selects
something else.
2019-12-04 10:55:29 +01:00
yossizap
7823430724 Add process selection to linux native debug ##debug
Previously, `dp=` wouldn't fully switch to the given process since it was
treated like `dpt` thread switching, leaving the debugger in an undefined state.
2019-12-04 10:55:29 +01:00
yossizap
05b000bb13 Modified debug_native to handle break's thread switching behavior
The user was interrupted during continue and switched to a different
thread since DebugBreakProcess creates a thread that triggers a breakpoint.
With these changes the DebugBreak thread is recorded to skip the breakpoint
event afterwards.
2019-11-02 00:30:25 +01:00
yossizap
45782c7705 Fixed w32dbg breaking issues (#15386) ##debug
* Fixed w32dbg breaking issues and moved break_push to w32_dbg_wait to support stepping as well

Previously, breaking would only work during 'dc' because it was pushed
in debug.c specifically for continue. This change moves the
responsibility of pushing/popping w32_break_process_wrapper to
windows_debug.c instead to support calls to w32_dbg_wait from anywhere.
2019-10-30 18:58:34 +01:00
yossizap
797803473b Fixed dpk ##debug 2019-10-26 11:02:23 +02:00
yossizap
82b02e8b89 Fixed opcodes not being associated with the current thread in gdbr (#15358) ##debug 2019-10-25 19:41:34 +02:00
yossizap
d9fa409563 Added support to thread switching in linux and fix r_debug_select ##debug 2019-10-17 19:21:58 +02:00
00rsiere
fe9a03416f Notify user on hardware breakpoint hit ##debug 2019-08-19 19:29:43 +02:00
Anton Kochkov
9677804b8e
Windows native debugger refactoring ##debug ##windows
* Windows native debugger refactoring

Massive win32 native debugging code refactoring
and corresponding fixes.

* Fix hang after killing process
2019-07-29 11:19:26 +08:00
radare
0d1c3c4f33
Honor SWI for step-over ##debug 2019-07-07 16:54:03 +02:00
Anton Kochkov
20e19d6023 More spelling fixes in the code 2019-06-20 13:36:02 +08:00
radare
a875795bb5
Completely eliminate the bytes apis in RBin ##bin
* Huge bytes->buffer on almost all the plugins, break API and ABI \o/
* Changed the way RBinFiles are created
* Changed the structure of the Sdb instance
* Improve ELF and MZ detection mechanisms to reduce false positives
* Change all the free/destroy methods to return void
* Fix "ks" shell
* Simplify and change the way RBinWrite apis work
2019-05-27 18:18:01 +02:00
radare
75876f6d29
Some fixes for the debug/emul traces and initial visual mode ##debug (#13475) 2019-03-23 14:59:15 +01:00
Anton Kochkov
bb67b54f74
Remove CYGWIN & MINGW remnants (#13377) 2019-03-15 12:55:08 +08:00
radare
c98136300d
Fix #12667 - Fix heap overflow in RCons.grep ##cons 2019-01-07 16:08:54 +01:00
radare
d05292e485
Fix 80 warnings coming from gcc8.2 (#12280) 2018-11-22 22:11:43 +01:00
dav1901
8e7aea3198 Minor cleanups (#12231) 2018-11-19 22:55:34 +01:00
Paweł Łukasik
22ff13e069 Add dbg.verbose variable to show more info when debugging ##debug 2018-11-13 02:10:21 +01:00
Riccardo Schirone
f801cad1c2 Clangification (#11660) 2018-09-26 07:48:22 -07:00
Mathieu Tarral
6148694dfa print hit breakpoint on stderr
avoid polluting stdout when using r2pipe and cmdj
2018-09-25 13:42:32 -07:00
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
pancake
507c678924 Fix #11352 - slow esil emulation visual panel 2018-09-03 01:48:47 +10:00
Rene Laemmert
37508ed71b added possibility to execute r2 commands on syscall hit (#11283) 2018-08-28 15:56:07 +02:00
radare
0ce42507dc
Initial implementation of visual tabs (Vt and VT) (#11105) 2018-08-16 11:01:53 +02:00
d4em0n
3524f8b8ca Fix #10813 breakpoint kind when send to gdbserver and fix continue/stepping in gdbclient (arm) (#10818) 2018-07-31 09:37:20 +01:00
fcasal
9a83761c6d esil emulation now stops at breakpoints (#10834) 2018-07-27 20:01:38 +01:00
Florian Märkl
5e35ad898b RConsContext (#10450)
* Add RConsContext
* Swap cons in tasks using RConsContext
* Create cons context for background tasks
* Move event_interrupt to RConsContext
* Fix breaking main cons from signal
* Make r_print_is_interrupted() use callback
2018-06-23 12:10:13 +02:00
vdf-git
b643095d1f Fixed breakpoint infinete loop error (#10410) 2018-06-19 15:34:10 +02:00
pancake
f5f090b709 Implement named breakpoints with support for expressions 2018-06-19 12:27:57 +02:00
vdf-git
febc008eb9 'bugfix' to fix #1361 in radare2-regressions (#10391) 2018-06-18 19:56:45 +02:00
Khairul Kasmiran
373699a28d Removed some spaces 2018-06-18 21:37:10 +08:00
sivaramaaa
e5bbaffbfe Refactor code to change R_ANAL_OP_MASK_ALL to appropriate value 2018-05-31 19:05:54 +02:00
pancake
b43f95f8fa Fix arj newline 2018-05-30 11:06:56 +02:00
pancake
be89180e7b Cleaning up asn1 apis, standarize IS_* apis and some more cleanup 2018-05-21 22:13:07 +02:00
skuater
bc03bf2f97 initial fix for issue #10097 2018-05-15 18:21:19 +02:00
Khairul Kasmiran
2faadf6d86 r_cons_singleton() 🠊 r_cons_singleton () 2018-05-02 21:36:08 +08:00
Khairul Azhar Kasmiran
019ac17bae dbg.btalgo=trace: trace calls for backtrace (#9980) 2018-04-29 11:42:55 +02:00
pancake
1adac87918 Update sdb-1.1.0, update calls to sdb_fmt() 2018-04-10 23:52:47 +02:00
sivaramaaa
17061a7b61 Fix #8198, Avoid restoring and replaying session twice in every step back command (#9794) 2018-04-04 12:57:46 +02:00