Commit Graph

24 Commits

Author SHA1 Message Date
Vincent Torri 7db4714db6 replace strndup with eina_strndup, remove strndup definition in evil and elm_test_dnd
Test Plan: compilation

Reviewers: cedric, zmike, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8814
2019-05-03 13:13:57 +01:00
Carsten Haitzler 642fe42cfc eina - btlog - fix warnign about uninit struct field
sentinel should fill all members to null.
2018-11-09 11:43:58 +00:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Gustavo Sverzut Barbieri d9815a6837 CMake: move eina binaries to single dir, add helper macros.
For one-source directories, be smart and just define SOURCES to that,
will reduce the number of too-simplistic CMakeLists.txt in our tree.

This also fixes problems with libraries, they should be private, not
public. So specify both kinds as different variables.
2017-01-23 18:23:40 +01:00
Gustavo Sverzut Barbieri 5242c3b1d4 eina_btlog: flush stdout for each line.
The huge buffer from stdout is annoying when running inside eo_debug.
2016-12-08 11:40:45 -02:00
Gustavo Sverzut Barbieri 8342548356 eina_btlog: allows continuous running on input, flush when possible.
eina_btlog will make a table of the backtrace and then must compute
columns length.

However, if not running in such mode (ie: show_compact/-c), we don't
need to queue lines or compute column lengths.

Also, now that we accept non-backtrace lines, like other output
interleaved, then flush the table once such line is found, this will
restart the table columns for the next output, but at least allows
eina_btlog to run on a live output, such as:

       myapp 2>&1 | eina_btlog
2016-12-06 14:06:10 -02:00
Gustavo Sverzut Barbieri f0e13ccad9 eina_btlog: cleanup backtrace list. 2016-12-06 13:50:18 -02:00
Gustavo Sverzut Barbieri 84a0f047db eina_btlog: compact output and keep non-bt information.
Now we keep all non-bt prefixes as well, in conjunction with compact
mode it looks like we resolved the address to lines in the output.

Example:

```
$ cat bt-new.txt
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000004e401ca: libeo_dbg.so+0x91ca (in src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000004e3fb42: _efl_add_internal_start+0x1c2 (in src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x0000000010a85f: lt-efl_net_dialer_simple_example+0x285f (in /home/gustavo/Development/git/efl/src/examples/ecore/.libs/lt-efl_net_dialer_simple_example 0x108000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000005c7c291: __libc_start_main+0xf1 (in /usr/lib/libc.so.6 0x5c5c000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x0000000010a38a: _start+0x2a (in /home/gustavo/Development/git/efl/src/examples/ecore/.libs/lt-efl_net_dialer_simple_example 0x108000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del() obj_id=0x400000007feb55b9 deleted obj=0x97870b0, class=0x9785850 (Efl_Net_Dialer_Simple) [0.9045s, 0.0198 ago]:
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000004e409aa: libeo_dbg.so+0x99aa (in src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000004e407f1: libeo_dbg.so+0x97f1 (in src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000004e3eee8: libeo_dbg.so+0x7ee8 (in src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000004e3f09e: _efl_object_call_end+0x4e (in src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000004e48a65: efl_del+0x105 (in src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x0000000010ac2c: lt-efl_net_dialer_simple_example+0x2c2c (in /home/gustavo/Development/git/efl/src/examples/ecore/.libs/lt-efl_net_dialer_simple_example 0x108000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x00000005c7c291: __libc_start_main+0xf1 (in /usr/lib/libc.so.6 0x5c5c000)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    0x0000000010a38a: _start+0x2a (in /home/gustavo/Development/git/efl/src/examples/ecore/.libs/lt-efl_net_dialer_simple_example 0x108000)
ERR<24641>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del() obj_id=0x400000007c9a1109 was already deleted 0.0287 seconds ago!
```

Results in:

```
$ cat /tmp/bt-new.txt | eina_btlog -c
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    _eo_log_obj_new (in eo.c:2691)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    _efl_add_internal_start (in eo.c:844)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    main (in efl_net_dialer_simple_example.c:375)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    __libc_start_main (in ??:375)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    _start (in ??:375)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del() obj_id=0x400000007feb55b9 deleted obj=0x97870b0, class=0x9785850 (Efl_Net_Dialer_Simple) [0.9045s, 0.0198 ago]:
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    _eo_log_obj_free (in eo.c:2714)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    _eo_free (in eo.c:974)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    _efl_unref_internal (in eo_private.h:342)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    _efl_object_call_end (in eo.c:620)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    efl_del (in efl_object.eo.c:78)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    main (in efl_net_dialer_simple_example.c:447)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    __libc_start_main (in ??:447)
ERR<23314>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()    _start (in ??:447)
ERR<24641>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del() obj_id=0x400000007c9a1109 was already deleted 0.0287 seconds ago!
```

which is similar to valgrind's log and is MUCH nicer to read :-)

This commit also simplifies alignment and color display by using a single printf().
2016-12-03 13:01:36 -02:00
Gustavo Sverzut Barbieri 683a508c20 eina_btlog: show comments (non-bt lines)
If the user paste the backtrace he may include some non-backtrace
line, such as Eo logs that includes the message saying what's the
backtrace is about.

These lines will be printed as is, unless "-C" is used to discard
them.
2016-12-03 13:01:36 -02:00
Gustavo Sverzut Barbieri 2aa247b334 eina_btlog: understand new backtrace format used by eo.
The output of eo backtrace is much more readable than eina's default,
but still misses addr2line translation done by eina_btlog, so make
eina_btlog understand the new format.
2016-12-03 13:01:36 -02:00
Gustavo Sverzut Barbieri 349daa458f eina_btlog: improve help. 2016-12-03 13:01:36 -02:00
Carsten Haitzler f7b2ec8bff eina_btlog - add spaces at start so when cnp'd into a wiki it formats
without spaces at the start of every line this ends up trying to deal
with this poorly, ensure at least 4 spaces at the start of every line
and wikis tend to format with fixed width monospace layout as a "code
sample blob" which is much more correct. at least this is a simple
always-on feature we can have so copy & paste turns out nicely in bug
reports. we could have multilpe formatting options like maybe -phab
which might output this as a wiki markdown "table". maybe -html so it
prodices raw html? either way... this is a basic improvement out of
the box.
2016-11-17 18:41:32 +09:00
Amitesh Singh d88f08f7e9 eina: module - Add macros for adding module informations
Summary:
These macros allow you to define module informations like
author/description/version/license

e.g.
// Use "Name <email id>" or just "Name"
EINA_MODULE_AUTHOR("Enlightenment Community");
// Mention license
EINA_MODULE_LICENSE("GPL v2");
// What your module does
EINA_MODULE_DESCRIPTION("This is what this module does");
// Module version
EINA_MODULE_VERSION("0.1");

Now eina_modinfo can show these informations to users

$ eina_modinfo module.so
 version: 0.1
 description:   Entry test
 license: GPLv2
 author:  Enlightenment Community

@feature

Reviewers: cedric, tasn, raster, jpeg

Subscribers: seoz

Differential Revision: https://phab.enlightenment.org/D4257
2016-08-31 16:17:53 +05:30
Jean Guyomarc'h b3c8470024 eina: fix eina_btlog for older osx versions
Older Mac OS X deprecated the default atos.
This patch adds support for Mavericks (and
maybe Yosemite as well).
2016-08-23 21:15:24 +02:00
Carsten Haitzler 49f19a1cb2 eina btlog - add -n option to not use color escapes 2016-07-04 21:30:34 +09:00
Jean Guyomarc'h 45b12224ec eina: fix compilation on OpenBSD/Windows of eina_btlog
We only care whether the process terminated successfully or not.
Non-zero values will be anything but a success, so we don't even care
about the exit code of the program.

This should fix compiling on OpenBSD (where WEXITSTATUS needed
to be defined by including a system header) as well on Windows.

Fixes T3733
2016-06-02 00:14:22 +02:00
Jean Guyomarc'h aedeca0ed2 eina_btlog: handle objective-c class methods
Class methods signatures start with a '+'.
2016-05-28 22:45:01 +02:00
Jean Guyomarc'h 0d8e054556 eina_btlog: add Mac OS X support for backtrace
This was actually difficult...
Mac OS X can use addr2line (sometimes called gaddr2line in
function of the package managers). However, addr2line does
NOT handle specific cases.

It was therefore necessary to use Mac OS X' own tool: atos,
which gracefully handles all backtraces, including the one
containing objective-c messages or fat archives.

eina_btlog now tests different utilities one by one, and
determines whether it is supported or not.

Fixes T3711
2016-05-28 19:19:02 +02:00
Jean-Philippe Andre 7bfecbdaf2 eina/btlog: Fix some Coverity issues
CID 1297406
CID 1297408
CID 1297409
2015-08-03 12:27:21 +09:00
Carsten Haitzler f153cad879 eina btlog - util - shut up coverity
eina_btlog is a backtrace "cleaner" that takes a raw bt from eina log
and gives a full readable bt for humans. it's run-and-quit binary like
ls or rm - it does its job and exits, so leaks are really of no
concern here...

CID 1297407
2015-06-09 19:39:01 +09:00
Daniel Zaoui c9d5479ff9 Fix warning on unused parameter 2015-05-21 10:23:41 +03:00
Chris Michael d2bc216886 eina-bt: Fix Coverity CID1297405 (dereference before null check)
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-18 13:43:30 -04:00
Vincent Torri a75155d8ba eina, efl: add copyright notice.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-14 18:41:48 +02:00
Carsten Haitzler 664708b817 eina - start a much improved eina dbug infra and have eina_log use it
this makes eina_log give bt's for all error logs. this is very useful
in finding just where a problem happens. the problem int he past is
that these have not been too useful due to backtrace_symbols() being
"useless". thus use the eina_btlog tool i added too.

also started infra for a debug monitor that can use the backtrace
infra to collect runtime stats ANY TIME for a process (don't need to
run under a debugger).

@feat
2015-05-08 14:13:17 +09:00