Re: [PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-10-19 Thread Yonggang Luo
I really want this to be merged :) ping Frank,
as this would stop me clone elfutils on windows

On Sat, Oct 15, 2022 at 4:35 AM Mark Wielaard  wrote:
>
> Hi,
>
> On Tue, Sep 20, 2022 at 04:43:01PM +0800, Yonggang Luo via Elfutils-devel
wrote:
> > These filenames are invalid on win32
>
> This looks ok to me, but I don't really know why these files were
> named this way in the first place.
>
> The files themselves are not directly used, they are there to recreate
> the hello3*rpm test files.
>
> Frank, would you mind if these are just renamed to normal *.spec?
>
> Thanks,
>
> Mark
>
> > Signed-off-by: Yonggang Luo 
> > ---
> >  tests/Makefile.am   | 2 +-
> >  tests/debuginfod-rpms/{hello2.spec. => hello2.spec} | 0
> >  tests/debuginfod-rpms/{hello3.spec. => hello3.spec} | 0
> >  3 files changed, 1 insertion(+), 1 deletion(-)
> >  rename tests/debuginfod-rpms/{hello2.spec. => hello2.spec} (100%)
> >  rename tests/debuginfod-rpms/{hello3.spec. => hello3.spec} (100%)
> >
> > diff --git a/tests/Makefile.am b/tests/Makefile.am
> > index 85514898..fc2235f4 100644
> > --- a/tests/Makefile.am
> > +++ b/tests/Makefile.am
> > @@ -563,7 +563,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh
run-ar.sh \
> >debuginfod-rpms/fedora31/hello3-debugsource-1.0-2.x86_64.rpm
\
> >debuginfod-rpms/fedora31/hello3-two-1.0-2.x86_64.rpm \
> >
 debuginfod-rpms/fedora31/hello3-two-debuginfo-1.0-2.x86_64.rpm \
> > -  debuginfod-rpms/hello2.spec. \
> > +  debuginfod-rpms/hello2.spec \
> >debuginfod-rpms/rhel6/hello2-1.0-2.i686.rpm \
> >debuginfod-rpms/rhel6/hello2-1.0-2.src.rpm \
> >debuginfod-rpms/rhel6/hello2-debuginfo-1.0-2.i686.rpm \
> > diff --git a/tests/debuginfod-rpms/hello2.spec.
b/tests/debuginfod-rpms/hello2.spec
> > similarity index 100%
> > rename from tests/debuginfod-rpms/hello2.spec.
> > rename to tests/debuginfod-rpms/hello2.spec
> > diff --git a/tests/debuginfod-rpms/hello3.spec.
b/tests/debuginfod-rpms/hello3.spec
> > similarity index 100%
> > rename from tests/debuginfod-rpms/hello3.spec.
> > rename to tests/debuginfod-rpms/hello3.spec
> > --
> > 2.36.1.windows.1
> >



--
 此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo


Re: [PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-10-19 Thread Frank Ch. Eigler via Elfutils-devel
Hi -

> I really want this to be merged :) ping Frank,
> as this would stop me clone elfutils on windows

If it doesn't break "make rpm" (or at least rpm -ts elfutils*.tar.bz2),
it's fine.  But I don't understand the problem - my windows machines have
no problem with files named "hello2.spec2." with two periods.

- FChE



Re: [PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-10-19 Thread Yonggang Luo
On Thu, Oct 20, 2022 at 3:49 AM Frank Ch. Eigler  wrote:
>
> Hi -
>
> > I really want this to be merged :) ping Frank,
> > as this would stop me clone elfutils on windows
>
> If it doesn't break "make rpm" (or at least rpm -ts elfutils*.tar.bz2),
> it's fine.  But I don't understand the problem - my windows machines have
> no problem with files named "hello2.spec2." with two periods.
>
Hi, Frank, `git clone` can not checkout the file, I didn't know why

> - FChE
>


--
 此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo


Re: [PATCH 1/7] Rename 'hello2.spec.' -> 'hello2.spec' 'hello3.spec.' -> 'hello3.spec'

2022-10-19 Thread Yonggang Luo
> If it doesn't break "make rpm" (or at least rpm -ts elfutils*.tar.bz2),
> it's fine.  But I don't understand the problem - my windows machines have
> no problem with files named "hello2.spec2." with two periods.
>
> - FChE

This is the error log:
```
C:\Users\lygstate>cd /d C:\work\xemu\elfutils

C:\work\xemu\elfutils>git reset --hard
4cc429d2761846967678fb8cf5868d311d1f7862
error: invalid path 'tests/debuginfod-rpms/hello2.spec.'
fatal: Could not reset index file to revision
'4cc429d2761846967678fb8cf5868d311d1f7862'.

C:\work\xemu\elfutils>
```



--
 此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo


[PATCH] readelf: Handle DW_LLE_GNU_view_pair

2022-10-19 Thread Mark Wielaard
DW_LLE_GNU_view_pair is used by gcc -gvariable-location-views=incompat5.
As described in http://www.fsfla.org/~lxoliva/papers/sfn/dwarf6-sfn-lvu.txt
and proposed for DWARF6 https://dwarfstd.org/ShowIssue.php?issue=170427.1

Signed-off-by: Mark Wielaard 
---
 libdw/ChangeLog |  4 
 libdw/dwarf.h   |  6 +-
 src/ChangeLog   |  6 ++
 src/readelf.c   | 12 
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index b14b5383..2efcaeb9 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,7 @@
+2022-10-19  Mark Wielaard  
+
+   * dwarf.h (DW_LLE_GNU_view_pair): New constant.
+
 2022-09-20  Yonggang Luo  
 
* memory-access.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
diff --git a/libdw/dwarf.h b/libdw/dwarf.h
index c961bc36..b2e49db2 100644
--- a/libdw/dwarf.h
+++ b/libdw/dwarf.h
@@ -931,7 +931,11 @@ enum
 DW_LLE_GNU_end_of_list_entry = 0x0,
 DW_LLE_GNU_base_address_selection_entry = 0x1,
 DW_LLE_GNU_start_end_entry = 0x2,
-DW_LLE_GNU_start_length_entry = 0x3
+DW_LLE_GNU_start_length_entry = 0x3,
+
+// http://www.fsfla.org/~lxoliva/papers/sfn/dwarf6-sfn-lvu.txt
+// https://dwarfstd.org/ShowIssue.php?issue=170427.1
+DW_LLE_GNU_view_pair = 0x9
   };
 
 /* DWARF5 package file section identifiers.  */
diff --git a/src/ChangeLog b/src/ChangeLog
index 23c971d1..1f369ef6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2022-10-19  Mark Wielaard  
+
+   * readelf.c (dwarf_loc_list_encoding_string): Handle
+   DW_LLE_GNU_view_pair.
+   (print_debug_loclists_section): Likewise.
+
 2022-09-20  Yonggang Luo  
 
* arlib.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
diff --git a/src/readelf.c b/src/readelf.c
index a206e60e..7671a31d 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -4185,6 +4185,8 @@ dwarf_loc_list_encoding_string (unsigned int kind)
 #define DWARF_ONE_KNOWN_DW_LLE(NAME, CODE) case CODE: return #NAME;
   DWARF_ALL_KNOWN_DW_LLE
 #undef DWARF_ONE_KNOWN_DW_LLE
+/* DW_LLE_GNU_view_pair is special/incompatible with default codes.  */
+case DW_LLE_GNU_view_pair: return "GNU_view_pair";
 default:
   return NULL;
 }
@@ -9744,6 +9746,16 @@ print_debug_loclists_section (Dwfl_Module *dwflmod,
  readp += len;
  break;
 
+   case DW_LLE_GNU_view_pair:
+ if ((uint64_t) (nexthdr - readp) < 1)
+   goto invalid_entry;
+ get_uleb128 (op1, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < 1)
+   goto invalid_entry;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" %" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ break;
+
default:
  goto invalid_entry;
}
-- 
2.30.2