Commit Graph

154 Commits

Author SHA1 Message Date
lzutao
1365948cee Do not use reversed keyword of meson ##build
`files` is a reversed keyword in meson. Try to avoid using it.
2019-01-10 14:15:50 +01:00
lzutao
9cc6d2d291 meson: Do not use glob with meson ##build
* meson: Explicit is better than implicit
* meson: Fix deprecated warnings in Meson 0.49.0
* meson: Do not need separate array for installed files

libr/socket/meson.build:30: DEPRECATION: Library r_socket was passed to
the "libraries" keyword argument of a previous call to generate() method
instead of first positional argument. Adding r_socket to "Requires" field,
but this is a deprecated behaviour that will change in a future version
of Meson. Please report the issue if this warning cannot be avoided in
your case.
2018-12-27 14:17:54 +01:00
dav1901
9b0fbf1ee4 Minor code cleanups - free/R_FREE/etc 2018-11-13 00:23:49 +01:00
pancake
565094a487 Fix null deref in bp 2018-09-26 10:05:44 -07:00
pancake
41ec949204 Fix #11112 - Rename {srwx,flags,perms} to perm. (-21 LOC)
Unify R_IO, R_BIN, R_BP, .. into R_PERM_* using 1 letter syntax
2018-09-22 11:31:45 +02:00
Paul I
bf29250ddd Fix #11487 (#11534) 2018-09-15 22:52:12 +02:00
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
Riccardo Schirone
eee1385466
Meson private (#11331)
* meson: refactor library cflags
* meson: use visibility=hidden by default
* remove unused var
* magic/meson: replace tabs with spaces
2018-09-03 10:07:28 +02:00
AsFaBw
84852de244 Fix 10811 - Improvements in gdbclient breakpoints (#10940) 2018-08-07 12:15:11 +02:00
Riccardo Schirone
7572f315ea
meson improvements (#10617)
* meson.build: fix meson build when not on git
* meson.build: make capstone a dependency
* meson.build: make r_magic library optional
* meson.build: capstone include is already in the dependency
* meson.build: use dependencies instead of manual linking + includes
* meson.build: add travis
* flag/meson.build: include sdb dependency
* travis-script: print messages based on install system
* io/meson.build: add sdb as dependency
* syscall/meson.build: missing sdb dependency
* {parse,config}/meson.build: add sdb dependency
* travis.yml: pass INSTALL_SYSTEM var to docker
* {bin/shlr}/meson.build: add sdb_dep to r2java and bin
* install meson and ninja-build in r2-travis docker
* travis.yml: allow meson build to fail for now
* anal/meson.build: add sdb and java dependencies
* egg/meson.build: add sdb dependency
* travis.yml: meson build env should be also in the includes list
* core/meson.build: add java dep
* meson.build: use dependencies also to create main r2 dependency
* rasm2/meson.build: replace link_with with dependencies
* rasm2/meson.build: add sdb as dependency
* meson.builds: convert link_with to dependencies and fix tabs
* travis-script: change meson install prefix and set PKG_CONFIG_PATH
* travis-script: add lib64 to LD_LIBRARY_PATH
2018-07-09 16:58:38 +02:00
pancake
f5f090b709 Implement named breakpoints with support for expressions 2018-06-19 12:27:57 +02:00
pancake
d22fc94d40 Fix realloc misussage in r_bp 2018-06-19 11:34:13 +02:00
pancake
cd1662903d Make breakpoints at offset 0 work 2018-06-19 11:33:50 +02:00
pancake
1288473703 Implement 'dbi addr' and dbi. 2018-06-19 11:24:56 +02:00
pancake
9c49aeda0b Fix UAF issues in RBreakpoint (there are probably more) 2018-06-19 11:07:16 +02:00
vdf-git
535b6855d5 corrected breakpoint opcodes for debugger in arm/thumb-2 (#10390) 2018-06-18 19:57:08 +02:00
Alex Gaines
53587f1216 Fix #10241 - Modified ARM32 breakpoint, this may break other ARM cpus... 2018-06-03 18:47:58 +02:00
Paul I
cc90ec6be5 [WIP] Move hardcoded paths to r_userconf.h (#9959)
* Move hardcoded paths to r_userconf.h

* Add R2_HOME_* macros

* Some cleanup
2018-04-28 10:02:55 +02:00
Abominas
b0fc578d31 Add initial temp breakpoint support (#9845) 2018-04-15 00:36:40 +02:00
Paul I
40b4a5b557 Meson: disable libversion info for Windows (#9858) 2018-04-10 22:44:54 +02:00
pancake
0529ed0d3f Add breakpoints for mips64 2018-04-04 16:40:28 +02:00
Paul I
ca3652da4b Meson: Add version info for shared libs (#9763) 2018-03-24 18:18:32 +01:00
Paul I
4e73ad7d19 Meson: some cleanup (#9753) 2018-03-23 07:47:46 +01:00
Florian Märkl
5e1f811ec0 Fix meson indentation (#9567) 2018-03-03 22:08:37 +01:00
Florian Märkl
95a1b75784 Install Headers and .pc Files with Meson (#9548)
Use meson pkgconfig for .pc files

meson 0.44

Install same headers as acr
2018-03-03 20:00:18 +08:00
Paul I
bb4f61580e Cleanup meson files (#9424) 2018-02-20 09:33:19 +01:00
whitequark
c816dc7e66 Don't try to build shared libraries if configured as --without-pic.
Specifically, avoid building all plugins as non-static objects,
as well as some supplementary libraries. In fact, a large amount
of plugins was already gated to build as shared objects only with
WITHPIC=1, but this was not done consistently.
This gating has been moved to */p/Makefile.

Building these shared objects is a waste of time and breaks
the --without-pic build unless CFLAGS is forced in the make
invocation.
2018-01-11 23:09:22 +01:00
Ayman Khamouma (ak42)
00b6eccdea take bits "wildcard" into account in r_bp_size (#8994) 2017-12-10 11:28:33 +01:00
pancake
d25ae603c7 Automatically set dbg.bpsize to fix bps in arm64 2017-12-03 18:57:42 +01:00
pancake
37626f13a5 Fix #8786 - Use brk0 for arm64 breakpoints 2017-12-03 16:51:25 +01:00
Maijin
4bb5c15faa r_lib_struct_t -> RLibStruct 2017-11-10 13:38:05 +01:00
Ren Kimura
816c5ee244 Add conditional watchpoint (#8321) 2017-08-26 18:57:51 +02:00
Ren Kimura
9862367fd0 Add drx_add/delete for watchpoint (#8244)
* Add drx_add/delete for watchpoint

* Changed breakpoint callback
2017-08-20 10:39:10 +02:00
Ren Kimura
7ce197eb44 Add initial support for hw watchpoint (#8132)
* Add initial support of hw watchpoint

* Fixed parse bug

* Fixed rwx str
2017-08-06 05:27:01 +02:00
SkUaTeR
c31d81da26 support for static build (#7822)
* support for static build
* improved sharard/static build
2017-06-28 22:54:40 +02:00
SkUaTeR
dc7914644e Meson improvements 2017-05-31 13:38:47 +02:00
pancake
6758e3753d Remove configure-plugins dependency for the make meson 2017-05-26 02:43:53 +02:00
SkUaTeR
9a1337512a meson.build fixes to build with MSVC 2017-05-14 23:06:00 +02:00
pancake
60f9667654 Remove support for bjam build system
- Delete all Jamroot files
2017-05-02 05:48:40 +02:00
pancake
fa671b9a16 Initial support for the Meson build system
- Integrated with current ACR
- Fix some stale fails got removed
2017-05-02 05:05:36 +02:00
alvarofe
40babe0459 Fix oob read with dbh- command 2017-04-18 19:07:14 +02:00
Ren Kimura
9a1190c112 Add bp_plugin_del and dbh- command (#7209) 2017-04-06 15:59:19 +02:00
pancake
4dc2b8b081 Add sys/sdk build script (wip) 2017-02-02 13:25:14 +01:00
pancake
94d47c79bb Completely remove all references to list.h 2016-10-27 13:33:27 +02:00
Sven Steinbauer
2996538700 Fix #5633 - Change x == NULL to correct syntax 2016-09-19 14:44:47 +02:00
dromero
d250d21385 Fix for the #5671 issue (#5704) 2016-09-06 12:02:38 +02:00
Tiago Gasiba
f0a2d8657d Add support for conditional breakpoints running r2 commands 2016-09-01 19:11:46 +02:00
Joshua J. Drake
722c62827b Major rework to the native debugger (esp on Linux) (#5185)
The major contribution here is completely re-worked breakpoint hit/recoil
handling. This work fixes #4907 and lays the ground work for future native
debugger improvements (multi-threading, etc).

* Give a human friendly type to enums
* Change many wait functions to return RDebugReasonType
* Better return checking (from r_debug_reg_sync, r_bp_restore)
* Optimized register synchronization
* Lots of comments and whitespace changes
* Improved inferior death detection

Handle EXIT_PID events differently than DEAD process events

* Move breakpoint/recoil handling to wait/cont/step

Rather than handing breakpoint related things inside cmd_debug.c, do that
inside the r_debug API functions. This seems like the most logical place for it
to live since it should apply to just about any platform/architecture.  This
also centralizes calling into "cmd.bp" handling via the CoreBind callback.

* Track how the caller wishes to continue

It turns out that handling break point recoils is very complicated. The ptrace
API on Linux returns SIGTRAP for just about every type of operation (not just
breakpoints getting hit). Add the "recoil_mode" flag to indicate whether we are
single-stepping or continuing and whether or not we are inside the recoil.

* Proper handling for swstep=true

Since r_debug_step_soft calls r_debug_continue, it's already hitting the recoil
case there. Move the recoil handling from r_debug_step to r_debug_step_hard
only.

For the swstep=true case, special handling is required inside r_debug_recoil.
By resetting all of the breakpoints except the one we just hit, we ensure we
can step the original instruction and hit the new swstep breakpoint. Add a new
bp function called r_bp_restore_except to do this.

To make matters worse, we cannot use a BreakpointItem pointer because that
leads to a use-after-free condition. Instead, we the breakpoint address
instead.

Now breakpoints should work regardless of the swtep setting.

* Always call the recoil before continuing

Some callers of r_debug_continue might not have ever inserted any breakpoints
before. If we don't restore breakpoints before each call to the underlying
continue we won't hit them.

* Hide software step breakpoint events from the user

When a breakpoint even happens due to a software-step, hide it from the user.
They aren't really breakpoints as far as they are concerned.

* Improve process exit handling on Linux

There are three types of process exiting events on Linux:

1. PTRACE_EVENT_EXIT occurs just before a process exits. It's not possible to
prevent it from exiting, but it can be used to inspect the pre-exit state.
2. The process can exit for a variety of reasons and we can notice when we call
waitpid(2).
3. The process could die randomly on us :-/

On Windows, h->wait will return R_DEBUG_REASON_EXIT_PID, but it's more likely
on Linux to find out the process is already dead.

* Check more bits within waitpid status

We can often make a decision about what happened strictly by looking at the
status returned from waitpid. In other cases, we need to call
r_debug_handle_signals.

If we reach the end of this function without knowing what happened, consider it
an error.
2016-06-22 10:34:45 +02:00
Joshua J. Drake
2b9edf8dc4 Fixes #5154: Stop including source-file whitespace (#5155) 2016-06-16 22:57:10 +02:00
Sven Steinbauer
8da8ad740f Cleanup fixes
* For commit comments and compiler errors
* Fixes for PR comments
* fix some "infer fixes" commits

Signed-off-by: Riccardo Schirone <sirmy15@gmail.com>
2016-05-23 11:25:44 +02:00