1. 25 Jan, 2019 2 commits
    • Salamandar's avatar
      (source modifs) Fix: Rename macros as it conflicts with Mingw headers. · fc8303dd
      Salamandar authored
      * DATADIR -> GIMPDATADIR
      * SYSCONFDIR -> GIMPSYSCONFDIR
      * DATADIR -> SYSDATADIR (tools/)
      fc8303dd
    • Jehan's avatar
      libgimpbase: display thread id of the calling thread as hexadecimal... · 8e013536
      Jehan authored
      ... on macOS.
      The debugger running on macOS is usually lldb and (from the reports we
      get) it looks like lldb displays the tid as hexadecimal on macOS
      (whereas lldb displays decimal tid on Linux! I know, it's confusing, yet
      consistent with crash report experience!). So let's just do the same,
      making it easy to quickly copy-search in order to look up the crashing
      thread (without having to convert from decimal to hexa).
      This is a bit of an approximation as I imagine we could have gdb on
      macOS or whatever edge case. Let's say it's good for the common case and
      still not an error otherwise (just a base conversion away).
      8e013536
  2. 10 Aug, 2018 1 commit
    • Jehan's avatar
      Issue #1999: Opening the Preferences dialogue triggers Xcode warning. · 04bbe941
      Jehan authored
      It seems that calling `lldb` when it is absent triggers some popup
      proposing to install Xcode on macOS. This is obviously not good. Let's
      check presence with g_find_program_in_path() instead. I was refraining
      from doing so until now, because this function allocates memory, hence
      may not do well during a crash.
      Fortunately we don't need to check for lldb during crash (unlike gdb
      which has some unacceptable behavior for older versions, at least on
      FreeBSD) so that should be ok.
      04bbe941
  3. 11 Jul, 2018 1 commit
  4. 24 Jun, 2018 2 commits
    • Jehan's avatar
      libgimpbase: fix declaration after statement and reset safecheck... · 49b4b1a5
      Jehan authored
      ... after each successful read().
      I completely missed this declaration after a statement during the review
      of !13 even though I saw another similar issue!
      
      Also let's reset the error counter to 0 each time a successful read()
      happens so that we can continue reading even if a lot of EINTR were to
      happen, as long as we globally go forward. Only consecutive errors
      increment the counter.
      
      Finally add a small comment to explain why we let EINTR pass instead of
      breaking directly.
      49b4b1a5
    • Alex Samorukov's avatar
      Fix empty lldb backtrace on OSX · 559d9b89
      Alex Samorukov authored
      When lldb attaching to the process it triggers few "-1" errors on read with
      EINTR error. After 1-2 errors read() call works again.
      Also this patch fixing TID detection, syscall SYS_gettid is oficially deprecated
      now and does not work. Also adding safecheck to avoid enldless loop.
      559d9b89
  5. 28 Apr, 2018 1 commit
  6. 24 Apr, 2018 1 commit
    • Jehan's avatar
      Bug 795510 - SYS_gettid is not available on non-Linux system. · 106fc930
      Jehan authored
      I could not find for sure what to use on FreeBSD instead, so let's just
      not get this information there. It is quite useful information to know
      where thread traces were asked from, but it is more important to make
      sure the program can be compiled everywhere. Also we can just check
      which thread has gimp_stack_trace*() calls. Thus it can be seen as
      redundant information in any case.
      
      SYS_gettid is apparently defined as a macro, so let's simply check for
      it being defined.
      106fc930
  7. 10 Apr, 2018 1 commit
    • Jehan's avatar
      libgimpbase: improve multi-threaded stack traces. · ae6a7bf9
      Jehan authored
      Since commit bb52431c, we get multi-thread traces in functions
      gimp_stack_trace_*(). Adding now the LLDB equivalent improvement.
      
      Also adding the process and thread id information, from which the trace
      order was made, atop the listing, as well as the thread list. This would
      allow to easily find and associate the threads.
      The problem is that sometimes the thread where we got a trace from may
      not matter (for instance signals, even such as SIGABRT or SIGSEGV, seem
      to sent a bit randomly to either the thread which provoked them or the
      main thread; there is a bit of contradictory info on this when reading
      on the topic, in my case I experienced this), in such case, getting all
      thread stack is important to find the origin of the signal.
      Other times it will highly matter, in particular when getting a trace
      for a WARNING or CRITICAL. This information will help to discriminate
      between thread traces.
      ae6a7bf9
  8. 09 Apr, 2018 2 commits
  9. 05 Mar, 2018 3 commits
    • Ell's avatar
      libgimpbase: in gimp_stack_trace_print(), shuffle some code around · 86939d84
      Ell authored
      Reap the child *after* we're done reading its output, so that we
      can disable ptracing after reading, but before reaping.  This
      avoids a window during which the child is gone, but ptracing using
      its PID is still allowed.
      86939d84
    • Ell's avatar
      libgimpbase: in gimp_stack_trace_print(), clear ptrace permission on exit · a1a126c3
      Ell authored
      Clear the ptrace permission given to the child after it terminates,
      so that a future process that happens to have the same PID the
      child had can't ptrace us.
      a1a126c3
    • Ell's avatar
      libgimpbase: in gimp_stack_trace_print(), enable ptrace under Yama · 0f2c966c
      Ell authored
      On Linux, when /proc/sys/kernel/yama/ptrace_scope is 1, a process
      may only ptrace its descendants by default, which prevents the GDB
      process spawned by gimp_stack_trace_print() from attaching to, and
      producing a backtrace for, the calling process.
      
      Use prctl() with PR_SET_PTRACER, when available, in the parent
      process, to allow the child process to ptrace it.
      0f2c966c
  10. 22 Feb, 2018 2 commits
    • Michael Natterer's avatar
      libgimpbase: consistent gimp_stack_trace namespace for stack trace functions · 374fee45
      Michael Natterer authored
      Change the rest of the source accordingly.
      374fee45
    • Jehan's avatar
      Bug 793514 - Adding version check for gdb. · 6975188d
      Jehan authored
      It seems that older GDB (under version 7) are not handling very well
      some common debug information format, in particular DWARF > 3. Such
      version of GDB is usually not a problem since it is quite old (more than
      10 years old, it would seem) so you don't see it anymore on any modern
      GNU/Linux distribution. On FreeBSD on the other hand, it is still
      available (probably for license reasons) and even installed by default!
      As a consequence, it makes debugging fail, even though LLDB is also
      installed by default.
      
      That is even more of a problem because it would seem that GIMP is killed
      (most likely by FreeBSD kernel according to the reporter tests) as a
      side-effect of GDB failing, which is seriously bad, in particular since
      we also use the debug dialog for non-fatal errors (which could therefore
      end up killing GIMP as side effect of a bad GDB!).
      
      So I add some GDB version check. I implement this without any dynamic
      memory management, as usual, since this needs to happen also during
      crash handling where the state is unstable and prone to memory
      allocation failure.
      I also add gimp_utils_backtrace_available() public API which can be used
      by the Preferences.
      6975188d
  11. 15 Feb, 2018 2 commits
  12. 12 Feb, 2018 2 commits
    • Jehan's avatar
      Bug 793393 - gimputils.c compilation error under Win32. · 1282a95e
      Jehan authored
      The header sys/wait.h is not for Win32.
      1282a95e
    • Jehan's avatar
      libgimpbase: allow NULL prog_name in gimp_print_stack_trace(). · 4e293a86
      Jehan authored
      The only debugger command which uses this value currently is gdb. And
      even there, it doesn't look mandatory. The alternative call using "-p"
      option does not require the program name. The manual doesn't say if
      calling with the program name has any advantage (but I don't see why it
      would, the PID is enough to find a process). Just in case, I leave the
      prog_name parameter (because it's easier to make a parameter useless
      than changing a libgimp* API) but simply allows setting it to NULL.
      4e293a86
  13. 11 Feb, 2018 1 commit
    • Jehan's avatar
      libgimpbase: use backtrace_symbols_fd() rather than... · 04053324
      Jehan authored
      ... backtrace_symbols() when possible.
      When we allocate a new string, anyway we have memory allocation. But
      when we just print to a file descriptor, this version of the API is
      guaranteed without any memory allocation and therefore should always
      work. This is important since allocations may fail in particular after
      memory errors.
      04053324
  14. 09 Feb, 2018 1 commit
  15. 04 Dec, 2017 1 commit
  16. 30 Nov, 2017 1 commit
    • Ell's avatar
      libgimpbase: add gimp_{enum,flags}_value_get_abbrev() · 7df42758
      Ell authored
      Add support for specifying an abbreviated description for enum/
      flags values, which can be used in contexts where the full
      description is too long.
      
      Since the exact layout and size of Gimp{Enum,Flags}Desc is part of
      the ABI, we can't simply add a field to these structs to hold the
      abbreviated description.  Instead, we use the fact that entries
      with a repeated value in the value descriptions array are ignored,
      and that the array is NULL terminated (in particular, that all non-
      NULL entries are followed by at least one additional entry), and
      specify the abbreviation in the "value_desc" field of the entry
      that immediately follows the initial entry for a given value,
      setting the "value" field of both entries to the same value.
      
      Right now this behavior is undocumented, so there is no proper way
      to specify abbreviated descriptions in the API, and is only meant
      to be used in generated enum files.
      7df42758
  17. 25 Jun, 2016 1 commit
    • Richard Kreckel's avatar
      Bug 768044 - Fix many typos · dd9b0fc5
      Richard Kreckel authored
      This fixes many typos in comments and one in a user-visible string (msgid
      "center abscisse" changed to "center abscissa" in affected po files. too).
      dd9b0fc5
  18. 31 May, 2015 2 commits
  19. 27 Feb, 2015 2 commits
  20. 19 Feb, 2015 1 commit
  21. 16 Feb, 2015 1 commit
    • Michael Natterer's avatar
      libgimpbase, app: implement File -> Show in File Manager · e448cc31
      Michael Natterer authored
      Add gimp_file_show_in_file_manager() to libgimpbase and a menu item
      in app which shows the image's file (if any) in the file manager.
      
      Implemented calling the org.freedesktop.FileManager1 interface
      and dropped snippets found on stackoverflow for somebody to
      turn into working code for OSX and Windows.
      e448cc31
  22. 12 Aug, 2014 1 commit
  23. 03 Aug, 2014 1 commit
  24. 01 Jul, 2014 1 commit
  25. 27 Nov, 2013 1 commit
  26. 25 Nov, 2011 1 commit
  27. 29 Jun, 2010 1 commit
  28. 17 Jan, 2009 1 commit
    • Michael Natterer's avatar
      Change licence to GPLv3 (and to LGPLv3 for libgimp). · d9b5207a
      Michael Natterer authored
      2009-01-17  Michael Natterer  <mitch@gimp.org>
      
      	* all files with a GPL header and all COPYING files:
      
      	Change licence to GPLv3 (and to LGPLv3 for libgimp).
      
      	Cleaned up some copyright headers and regenerated the parsers in
      	the ImageMap plugin.
      
      
      svn path=/trunk/; revision=27913
      d9b5207a
  29. 06 Nov, 2008 2 commits
    • Sven Neumann's avatar
      comments · 549d6eae
      Sven Neumann authored
      svn path=/trunk/; revision=27563
      549d6eae
    • Sven Neumann's avatar
      use NC_() to mark enum values for translation. Use a lower-case short form · 02817081
      Sven Neumann authored
      2008-11-06  Sven Neumann  <sven@gimp.org>
      
      	* tools/gimp-mkenums: use NC_() to mark enum values for 
      translation.
      	Use a lower-case short form of the type name as translation 
      context.
      
      	* libgimp/libgimp-intl.h: define the NC_() macro as noop.
      
      	* libgimpbase/gimpbasetypes.[ch]
      	* libgimpbase/gimpbase.def: added new functions to set and
      	get a translation context on an enum type.
      
      	* app/base/Makefile.am
      	* app/core/Makefile.am
      	* app/display/Makefile.am
      	* app/paint/Makefile.am
      	* app/plug-in/Makefile.am
      	* app/text/Makefile.am
      	* app/tools/Makefile.am
      	* app/widgets/Makefile.am
      	* libgimp/Makefile.am
      	* libgimpbase/Makefile.am:
      	* libgimpconfig/Makefile.am
      	* libgimpthumb/Makefile.am
      	* libgimpwidgets/Makefile.am: register the translation context
      	with the enum types.
      
      	* app/display/display-enums.h
      	* libgimpbase/gimpbaseenums.h
      	* libgimpconfig/gimpcolorconfig-enums.h: removed old-style 
      explicit
      	translation context.
      
      	* app/base/base-enums.c
      	* app/core/core-enums.c
      	* app/display/display-enums.c
      	* app/paint/paint-enums.c
      	* app/plug-in/plug-in-enums.c
      	* app/text/text-enums.c
      	* app/tools/tools-enums.c
      	* app/widgets/widgets-enums.c
      	* libgimpbase/gimpbaseenums.c
      	* libgimpconfig/gimpcolorconfig-enums.c
      	* libgimpwidgets/gimpwidgetsenums.c: regenerated.
      
      
      svn path=/trunk/; revision=27562
      02817081