[PATCHv3,0/3] gdb/python: avoid throwing an exception over libopcodes code

Message ID cover.1668790576.git.aburgess@redhat.com
Headers
Series gdb/python: avoid throwing an exception over libopcodes code |

Message

Andrew Burgess Nov. 18, 2022, 4:57 p.m. UTC
  Changes since v2:

  - Rebase onto current upstream/master, no merged conflicts.

Changes since v1:

  - Patch #1 is largely unchanged.  I'm still in discussion with Simon
    as to whether this is the correct solution or not.

  - Patch #2 has grown a little since the first version I posted, I
    found a few extra callbacks which can be marked as noexcept.

  - Patch #3 is new, this adds the noexcept keyword to the typedefs
    used to handle the libopcode callbacks, but only when we compile
    for C++17 or later.

---

Andrew Burgess (3):
  gdb/python: avoid throwing an exception over libopcodes code
  gdb/disasm: mark functions passed to the disassembler noexcept
  gdb: mark disassembler function callback types as noexcept

 gdb/disasm-selftests.c |  5 ++-
 gdb/disasm.c           | 25 ++++++------
 gdb/disasm.h           | 48 ++++++++++++++++------
 gdb/guile/scm-disasm.c |  2 +-
 gdb/python/py-disasm.c | 91 ++++++++++++++++++++++++++++++++----------
 5 files changed, 121 insertions(+), 50 deletions(-)


base-commit: f9f88aede3bb84efd088a59a5f6bccb3a6bb6516
  

Comments

Tom de Vries Nov. 28, 2022, 8:35 a.m. UTC | #1
On 11/18/22 17:57, Andrew Burgess via Gdb-patches wrote:
> Changes since v2:
> 
>    - Rebase onto current upstream/master, no merged conflicts.
> 
> Changes since v1:
> 
>    - Patch #1 is largely unchanged.  I'm still in discussion with Simon
>      as to whether this is the correct solution or not.
> 
>    - Patch #2 has grown a little since the first version I posted, I
>      found a few extra callbacks which can be marked as noexcept.
> 
>    - Patch #3 is new, this adds the noexcept keyword to the typedefs
>      used to handle the libopcode callbacks, but only when we compile
>      for C++17 or later.
> 
> ---
> 
> Andrew Burgess (3):
>    gdb/python: avoid throwing an exception over libopcodes code
>    gdb/disasm: mark functions passed to the disassembler noexcept
>    gdb: mark disassembler function callback types as noexcept
> 

Hi,

I ran into the same problem on powerpc64le, applied the patch series and 
rebuild gdb, reran the test-case gdb.python/py-disasm.exp and it passes now.

Thanks,
- Tom

>   gdb/disasm-selftests.c |  5 ++-
>   gdb/disasm.c           | 25 ++++++------
>   gdb/disasm.h           | 48 ++++++++++++++++------
>   gdb/guile/scm-disasm.c |  2 +-
>   gdb/python/py-disasm.c | 91 ++++++++++++++++++++++++++++++++----------
>   5 files changed, 121 insertions(+), 50 deletions(-)
> 
> 
> base-commit: f9f88aede3bb84efd088a59a5f6bccb3a6bb6516