#2 Switch to new upstream, Python 3, get glibc version dynamically
Merged a year ago by zbyszek. Opened 2 years ago by churchyard.
rpms/ churchyard/gdb-heap update  into  master

file modified
+1 -2
@@ -1,2 +1,1 @@ 

- gdb-heap-0.4.tar.bz2

- /gdb-heap-0.5.tar.bz2

+ /gdb-heap-*.tar.*

file added
+60
@@ -0,0 +1,60 @@ 

+ From 60676c5ad2052aa6a515444465a2d15310689221 Mon Sep 17 00:00:00 2001

+ From: Kevin Chen <kevin@bloxroute.com>

+ Date: Tue, 2 Jul 2019 17:30:16 -0500

+ Subject: [PATCH] Fix sorting for Python3, field names, and lib paths

+ 

+ ---

+  heap/commands.py | 3 ++-

+  heap/glibc.py    | 4 ++--

+  heap/gobject.py  | 2 +-

+  3 files changed, 5 insertions(+), 4 deletions(-)

+ 

+ diff --git a/heap/commands.py b/heap/commands.py

+ index d6244c0..062a49a 100644

+ --- a/heap/commands.py

+ +++ b/heap/commands.py

+ @@ -115,7 +115,8 @@ def invoke(self, args, from_tty):

+              pass # FIXME

+          t = Table(['Chunk size', 'Num chunks', 'Allocated size'])

+          for size in sorted(chunks_by_size.keys(),

+ -                           lambda s1, s2: chunks_by_size[s2] * s2 - chunks_by_size[s1] * s1):

+ +                           key=lambda s1: chunks_by_size[s1] * s1,

+ +                           reverse=True):

+              t.add_row([fmt_size(size),

+                         chunks_by_size[size],

+                         fmt_size(chunks_by_size[size] * size)])

+ diff --git a/heap/glibc.py b/heap/glibc.py

+ index cd90807..330a4e3 100644

+ --- a/heap/glibc.py

+ +++ b/heap/glibc.py

+ @@ -68,7 +68,7 @@ def gdb_type(cls):

+  

+      def size(self):

+          if not(hasattr(self, '_cached_size')):

+ -            self._cached_size = int(self.field('size'))

+ +            self._cached_size = int(self.field('mchunk_size'))

+          return self._cached_size

+  

+      def chunksize(self):

+ @@ -94,7 +94,7 @@ def __str__(self):

+          if self.has_PREV_INUSE():

+              result += ' PREV_INUSE'

+          else:

+ -            result += ' prev_size=%i' % self.field('prev_size')

+ +            result += ' prev_size=%i' % self.field('mchunk_prev_size')

+          if self.has_NON_MAIN_ARENA():

+              result += ' NON_MAIN_ARENA'

+          if self.has_IS_MMAPPED():

+ diff --git a/heap/gobject.py b/heap/gobject.py

+ index e16e232..0509433 100644

+ --- a/heap/gobject.py

+ +++ b/heap/gobject.py

+ @@ -25,7 +25,7 @@

+  dir_ = '/usr/share/glib-2.0/gdb'

+  if not dir_ in sys.path:

+      sys.path.insert(0, dir_)

+ -from glib import read_global_var, g_quark_to_string

+ +from glib_gdb import read_global_var, g_quark_to_string

+  

+  

+  # This was adapted from glib's gobject.py:g_type_to_name

file removed
-26
@@ -1,26 +0,0 @@ 

- From 70e7228da13b61421fd27c2b18f429bdc4803e71 Mon Sep 17 00:00:00 2001

- From: David Malcolm <dmalcolm@redhat.com>

- Date: Wed, 29 Sep 2010 12:40:07 -0400

- Subject: [PATCH] Fix missing import

- 

- ---

-  heap/glibc.py |    3 ++-

-  1 files changed, 2 insertions(+), 1 deletions(-)

- 

- diff --git a/heap/glibc.py b/heap/glibc.py

- index 0c61643..4b340d2 100644

- --- a/heap/glibc.py

- +++ b/heap/glibc.py

- @@ -27,7 +27,8 @@ import re

-  

-  import gdb

-  

- -from heap import WrappedPointer, WrappedValue, caching_lookup_type, type_char_ptr

- +from heap import WrappedPointer, WrappedValue, caching_lookup_type, \

- +    type_char_ptr, check_missing_debuginfo

-  

-  class MChunkPtr(WrappedPointer):

-      '''Wrapper around glibc's mchunkptr

- -- 

- 1.5.5.6

- 

file modified
+17 -10
@@ -7,24 +7,27 @@ 

  

  Name:           gdb-heap

  Version:        0.5

- Release:        35%{?dist}

+ %global commit  f3dcc5309e55683c67ccb35e98b090421825a22a

+ %global shortcommit %(c=%{commit}; echo ${c:0:7})

+ Release:        36.20191013git%{shortcommit}%{?dist}

  Summary:        Extensions to gdb for debugging dynamic memory allocation

  

- 

  # The code is almost all LGPLv2+, apart from heap/python.py, which is

  # Python-licensed:

  License:        LGPLv2+ and Python

  

- URL:            https://fedorahosted.org/gdb-heap/

- Source0:        https://fedorahosted.org/released/gdb-heap/gdb-heap-%{version}.tar.bz2

+ URL:            https://github.com/rogerhu/gdb-heap

+ Source0:        %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz

  

- Patch1:         fix-rhbz638662.patch

+ # Fix sorting for Python3, field names, and lib paths

+ Patch1:         %{url}/pull/25.patch

  

- Requires:       python2-ply

+ BuildRequires:  python3-devel

  

- BuildRequires:  python2

+ Requires:       python3

+ Requires:       python3-ply

  

- %global glibc_version 2.26.90

+ %global glibc_version %(rpm -q glibc --qf "%%{VERSION}")

  %global glibc_soversion %{glibc_version}

  %global glibc_dso_name  ld-%{glibc_soversion}.so

  %global gdb_autoload_dir %{_datadir}/gdb/auto-load
@@ -51,8 +54,7 @@ 

  dynamic memory allocation problems in user space.

  

  %prep

- %setup -q

- %patch1 -p1

+ %autosetup -p1 -n %{name}-%{commit}

  

  %build

  # empty
@@ -83,6 +85,11 @@ 

  

  

  %changelog

+ * Sun Oct 13 2019 Miro Hrončok <mhroncok@redhat.com> - 0.5-36.20191013gitf3dcc53

+ - Switch to new upstream

+ - Switch to Python 3

+ - Get glibc version dynamically

+ 

  * Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-35

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- 333ac7c58a51c666e4d653af91611ea0  gdb-heap-0.5.tar.bz2

+ SHA512 (gdb-heap-f3dcc53.tar.gz) = 4ec67fae0db07a2999487f82bb5630b62cdbac738fd6633c6d9836f7a2dd71131cb39ea111a7b118be834b0012c3217812f12f0d0c996345feeabd215e62189d