Skip to content

GDB: Python Exception <class 'TypeError'>: exceptions must derive from BaseException #15923

Closed
@DanielEScherzer

Description

@DanielEScherzer

Description

The following code:

<?php

$a = 1;
var_dump( $a );

in /var/www/html/test.php. when run with GDB:

(gdb) set print pretty on
(gdb) break /usr/src/php/ext/standard/var.c:105
Breakpoint 1 at 0x4b6130: file /usr/src/php/ext/standard/var.c, line 105.
(gdb) run /var/www/html/test.php
Starting program: /usr/local/bin/php /var/www/html/test.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, php_var_dump (struc=0x7ffff54140f0, level=1) at /usr/src/php/ext/standard/var.c:113
113             if (level > 1) {
(gdb) p *struc

Where var.c:113 at the time was

if (level > 1) {

Resulted in this output:

$1 = Python Exception <class 'TypeError'>: exceptions must derive from BaseException
Python Exception <class 'TypeError'>: exceptions must derive from BaseException
{
  value = {
    lval = 1,
...
}

But I expected this output instead:

No errors

PHP Version

PHP 8.4-dev

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions