Skip to content

Commit 80b5d59

Browse files
committed
Review
1 parent a02ac33 commit 80b5d59

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed
File renamed without changes.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ if printf "#if __ELF__\nelf\n#endif\n" | $CC -E - | grep elf > /dev/null; then
17041704
PHP_ADD_SOURCES(main, debug_gdb_scripts.c)
17051705

17061706
cat >> Makefile.objects <<EOF
1707-
$abs_srcdir/main/debug_gdb_scripts.c: $abs_srcdir/scripts/gdb/debug_gdb_scripts_gen.php $abs_srcdir/scripts/gdb/php_gdb.py $abs_srcdir/scripts/gdb/php_gdb.gdb
1707+
$abs_srcdir/main/debug_gdb_scripts.c: $abs_srcdir/scripts/gdb/debug_gdb_scripts_gen.php $abs_srcdir/scripts/gdb/php_gdb.py $abs_srcdir/.gdbinit
17081708
@if test ! -z "\$(PHP)"; then \\
17091709
\$(PHP) $abs_srcdir/scripts/gdb/debug_gdb_scripts_gen.php; \\
17101710
fi;

main/debug_gdb_scripts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Generated by debug_gdb_scripts_gen.php.
33
*
4-
* This inlines php_gdb.gdb and php_gdb.py into the .debug_gdb_scripts
4+
* This inlines .gdbinit and php_gdb.py into the .debug_gdb_scripts
55
* section of the binary, so that they can be found by gdb.
66
*
77
* See https://sourceware.org/gdb/current/onlinedocs/gdb.html/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section
@@ -1015,4 +1015,4 @@ asm(
10151015
".ascii \"\\n\"\n"
10161016
".byte 0\n"
10171017
".popsection\n"
1018-
);
1018+
);

scripts/gdb/debug_gdb_scripts_gen.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env php
22
<?php
33

4-
$mainDir = sprintf('%s/main', dirname(__DIR__, 2));
4+
$rootDir = dirname(__DIR__, 2);
5+
$mainDir = sprintf('%s/main', $rootDir);
56
$outputFile = sprintf('%s/debug_gdb_scripts.c', $mainDir);
67

78
printf("Generating %s\n", $outputFile);
89

9-
$gdbscript = file_get_contents(sprintf("%s/php_gdb.gdb", __DIR__));
10+
$gdbscript = file_get_contents(sprintf("%s/.gdbinit", $rootDir));
1011
$pyscript = file_get_contents(sprintf("%s/php_gdb.py", __DIR__));
1112

12-
// We can not inline scripts in the gdb command languages, but we can embed them
13-
// in the python script.
13+
// We can not inline .gdbinit, but we can embed it in the python script.
1414
$pyscript = sprintf(
1515
"gdb.execute('''\n%s\n''')\n%s",
1616
addcslashes($gdbscript, '\'\\'),
@@ -22,7 +22,7 @@
2222
/*
2323
* Generated by %s.
2424
*
25-
* This inlines php_gdb.gdb and php_gdb.py into the .debug_gdb_scripts
25+
* This inlines .gdbinit and php_gdb.py into the .debug_gdb_scripts
2626
* section of the binary, so that they can be found by gdb.
2727
*
2828
* See https://sourceware.org/gdb/current/onlinedocs/gdb.html/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section
@@ -35,6 +35,7 @@
3535
".byte 0\n"
3636
".popsection\n"
3737
);
38+
3839
C,
3940
basename(__FILE__),
4041
implode("\n ", array_map(function ($line) {

0 commit comments

Comments
 (0)