95 Commits

Author SHA1 Message Date
Srimanta Barua
d453d7430f pid/tid specific continue with signal for gdb (#7848)
* Corrected tid syntax, added pid/thread-specific continue
* Added continue with sig
2017-07-02 19:09:04 +02:00
Srimanta Barua
2424f962ce Check which vcont commands and use them if they are (#7847) 2017-07-01 21:16:48 +02:00
Srimanta Barua
ff7b6c1df2 Optimized gdbserver mem read, and added gdbserver mem write 2017-06-29 17:17:22 +02:00
SrimantaBarua
59a5c07d8f invalidate reg cache 2017-06-26 11:39:30 +02:00
SrimantaBarua
5938053422 gdb reg caching 2017-06-26 11:39:30 +02:00
pancake
2320b29e8f Fix memleak and invalid format string for gdb 2017-06-24 20:49:59 +02:00
SrimantaBarua
9651b6a997 Attach pid 2017-06-23 11:50:26 +08:00
Srimanta Barua
c5eb7ef058 Support for dm commands in gdb (#7770)
* Added reading of memory maps from /proc/pid/maps
* Don't enable extended mode by default, only do so when attaching to process. Otherwise can't quit gdbserver
* Better gdb file reading
2017-06-19 19:43:55 +02:00
Adrian Pistol
3381ae974e Fixes to #7759 which I failed to push in. (#7766) 2017-06-18 02:45:37 +02:00
Adrian Pistol
d8f5cdb11c io_gdb: gdb://host:port/pid support; Add gdbr_{attach,detach,detach_pid,kill_pid} to gdbclient. (#7759)
Try to activate extended mode; Attach helper function requires extended mode to actually do something.

Tries to attach to the given pid in io_gdb.
This isn't proper, but it's better than running into the two-pid-vals-no-sync issue.
2017-06-18 00:59:13 +02:00
Srimanta Barua
ba1bba5401 Speed up gdb considerably if gdbserver supports no-ack mode (#7763) 2017-06-18 00:58:38 +02:00
Srimanta Barua
040ea8cafd Bug-fixes for read/write mem (#7758) 2017-06-17 03:02:05 +02:00
Srimanta Barua
fe6372339d Corrected gdbserver register-setting 2017-06-14 15:38:10 +02:00
Srimanta Barua
e5e860a3ea Added loading of offsets 2017-06-14 15:38:10 +02:00
xarkes
46deac0dde Fixing appveyor build (#7735) 2017-06-14 13:45:48 +02:00
pancake
6c37a9aa10 Add serial support in RSocket for gdb:///dev/ttyUSB0:9600 2017-06-12 22:25:58 +02:00
pancake
54150fa3db Fix last covs 2017-06-12 11:28:54 +02:00
Srimanta Barua
d81f369fa1 Fix gdb client packet size (#7703)
* Fixes for packet too long
* Proper escaping in packets and run-length encoding
* Removed old cache code
* Removed currently unnecessary code from client initialization
* Preparation for customized packet sizes
* Better packet-size configuration
* Minimum packet size (for AVR)
* mem_write too
* Corrections to packing code
* Was overcompensating for AVR. (pkt_sz = 16 => read_mem_len = 8)
2017-06-11 02:12:44 +02:00
Sajjad Pourali
028099f185 fix an unimportant warning (gdbserver/core.c) (#7695) 2017-06-07 16:27:28 +02:00
pancake
796dd28aaa Fix ext2 buffer overflow in r2_sbu_grub_memmove 2017-06-05 12:38:39 +02:00
Srimanta Barua
ad764839b2 Initial breakpoints, step, and continue for gdbserver. Plus *started* talking to GDB (#7679)
* GDB doesn't crash when connecting to us anymore

* Added initial support for breakpoints, step, continue to gdbserver
2017-06-04 22:22:01 +02:00
pancake
91daa516eb Fix build for android-mips 2017-05-30 19:39:22 +02:00
Srimanta Barua
0da8862a83 Add read reg/mem to gdbserver (#7625)
* bug fixes in client, and adding kill signal for server without multiprocess support
* commented out currently unnecessary packets sent by client
* Corrections to client kill signal code
* More functionality for gdbserver. Read regs and memory
2017-05-29 21:36:42 +02:00
pancake
4ee963ee98 Fix some clang-analyzer issues 2017-05-29 15:01:11 +02:00
Srimanta Barua
06aae3080e Added kill signal for gdb client 2017-05-25 15:41:07 +02:00
pancake
9b44b6bb23 Fixes for the -lr_socket issue 2017-05-24 02:00:56 +02:00
pancake
9e19118eff Fix latest covs 2017-05-23 11:24:04 +02:00
Srimanta Barua
d3958f00e4 Initial stub for gdbserver support
* Renaming functions, reorganizing code, adding temporary hack for closing gdbserver
2017-05-22 19:37:48 +02:00
SkUaTeR
7d7c9cb5a7 More fixes in shlr for MSVC 2017-05-16 20:14:39 +02:00
pancake
ad54e9ddf1 Refix mingw32 build 2017-05-10 00:34:05 +02:00
xarkes
926f024909 Improved MSVC support (WIP) 2017-05-09 14:25:57 +02:00
Srimanta Barua
a4d4002ce0 Reorganized shlr/gdb in preparation for gdbserver 2017-05-07 11:53:17 +02:00
pancake
60f9667654 Remove support for bjam build system
- Delete all Jamroot files
2017-05-02 05:48:40 +02:00
Michael Scherer
0e69dfbb56 Do not fail if vFile:fstat is not implemented on the remote side
See handle_vFile in ./gdb/gdbserver/hostio.c in gdb git, and the documentation
https://sourceware.org/gdb/onlinedocs/gdb/Host-I_002fO-Packets.html#Host-I_002fO-Packets

         An empty response indicates that this operation is not recognized.

vFile:fstat is not supported by gdb 7.6.1, shipped on RHEL 7, for example.
2017-04-21 10:08:18 +02:00
pancake
47d90a9842 strdup g->data in qStatus 2017-04-12 03:51:45 +02:00
pancake
65776308c9 RAR disassembler and bin plugin moved to radare2-extras 2017-04-11 13:53:58 +02:00
pancake
c1592008a0 Fix #7231 - cant connect and read memory with gdb:// 2017-04-10 17:32:07 +02:00
pancake
a8106859a5 Fix crash in gdb:// 2017-04-10 17:00:26 +02:00
Srimanta Barua
e7909f008c Improve gdb remote debugging (#7027)
* Added bitflag structure for qSupported

* Get if process is attached/created and get file name

* Set process/thread id for subsequent 'g' commands

* Use strbuf instead of big buffer,started work on fstat

* Fix indent, brackets. Use bool instead of bitflags

* Minor fixes
2017-03-20 15:26:18 +01:00
pancake
32a38d7c9b Remove the use of -ggdb 2017-02-01 22:32:11 +01:00
Paul Fertser
d9d64b6cac gdb: use simple packets instead of vCont for single-threaded (#6409)
When debugging a single-threaded application via GDB Serial protocol
some GDB servers (notably OpenOCD) do not support vCont command, so
neither step nor continue work. Even though current protocol
description deprecates plain "s" and "c" it does so only for
multi-threading cases.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2017-01-16 01:12:18 +01:00
pancake
ea5c83ce4e Fix a bunch of malloc(0) 2016-11-08 15:09:52 +01:00
pancake
b44ec9b3e3 Add =!pkt in gdb:// and other minor fixes 2016-09-14 13:11:04 +02:00
pancake
bd5e22c17e Some more osx-ppc fixes 2016-06-06 16:20:03 +02:00
pancake
df26636c14 Fix mingw32 build after the osx-ppc changes 2016-05-01 15:17:52 +02:00
pancake
aae417badf More OSX-PPC fixes 2016-04-27 01:52:35 +02:00
Damien Zammit
1a593a6318 GDB debug for lm32 architecture (#4696)
Signed-off-by: Damien Zammit <damien@zamaudio.com>

* Missing a couple of things in previous commit

Signed-off-by: Damien Zammit <damien@zamaudio.com>
2016-04-24 23:13:00 +02:00
Ido Yariv
8ee54db24e Rewrite remote gdb packet handling
This patch addresses several issues with the current implementation,
including:
- Excessive recursions
- Incorrect handling of the escape character
- Buffer size limitations
2016-02-05 17:24:00 +01:00
Ido Yariv
cba51be5b8 Skip first packet when connecting to gdbserver
QEMU seems to send a T02thread message upon connection. This can get the
client side out of sync wrt requests & responses.

To work around this, read a packet after a connection is made. This
could time out, but that should be harmless.
2016-02-03 11:29:54 +01:00
Ido Yariv
0952fd0815 Avoid needless polling on incoming gdb packets
In case the packet checksum is received, there's little point in
continuing to poll for data.
2016-02-01 12:23:52 +01:00