Use '--readnever' when invoking GDB from gcore.in

Message ID 20190222182447.15061-1-sergiodj@redhat.com
State New, archived
Headers

Commit Message

Sergio Durigan Junior Feb. 22, 2019, 6:24 p.m. UTC
  Back when I proposed the '--readnever' feature, I somehow forgot or
decided not to include the bits related to gcore.in in the original
patch.  This patch finally updates the gcore script to invoke GDB
using '--readnever'.

We've been carrying this patch on Fedora GDB for quite some time, and
as expected the corefiles generated by gcore on Fedora don't have
problems, which I think is the best indicator that the it's safe to
generate corefiles using '--readnever'.

OK to check in?

gdb/ChangeLog:
2019-02-21  Sergio Durigan Junior  <sergiodj@redhat.com>

	* gcore.in: Add '--readnever' option when invoking GDB.
---
 gdb/ChangeLog | 4 ++++
 gdb/gcore.in  | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)
  

Comments

Kevin Buettner Feb. 22, 2019, 11:12 p.m. UTC | #1
On Fri, 22 Feb 2019 13:24:47 -0500
Sergio Durigan Junior <sergiodj@redhat.com> wrote:

> Back when I proposed the '--readnever' feature, I somehow forgot or
> decided not to include the bits related to gcore.in in the original
> patch.  This patch finally updates the gcore script to invoke GDB
> using '--readnever'.
> 
> We've been carrying this patch on Fedora GDB for quite some time, and
> as expected the corefiles generated by gcore on Fedora don't have
> problems, which I think is the best indicator that the it's safe to
> generate corefiles using '--readnever'.
> 
> OK to check in?

LGTM.

Kevin
  
Sergio Durigan Junior Feb. 23, 2019, 3:06 p.m. UTC | #2
On Friday, February 22 2019, Kevin Buettner wrote:

> On Fri, 22 Feb 2019 13:24:47 -0500
> Sergio Durigan Junior <sergiodj@redhat.com> wrote:
>
>> Back when I proposed the '--readnever' feature, I somehow forgot or
>> decided not to include the bits related to gcore.in in the original
>> patch.  This patch finally updates the gcore script to invoke GDB
>> using '--readnever'.
>> 
>> We've been carrying this patch on Fedora GDB for quite some time, and
>> as expected the corefiles generated by gcore on Fedora don't have
>> problems, which I think is the best indicator that the it's safe to
>> generate corefiles using '--readnever'.
>> 
>> OK to check in?
>
> LGTM.

Thanks, pushed.

8a6a85134d78531c6adb72a888844f7cfa3a5c56
  

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b57cc87ed9..345fdf200a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@ 
+2019-02-21  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+	* gcore.in: Add '--readnever' option when invoking GDB.
+
 2019-02-21  Alan Hayward  <alan.hayward@arm.com>
 
 	* NEWS: Update style defaults.
diff --git a/gdb/gcore.in b/gdb/gcore.in
index 25602396d5..b9770ea415 100644
--- a/gdb/gcore.in
+++ b/gdb/gcore.in
@@ -97,7 +97,8 @@  for pid in "$@"
 do
 	# `</dev/null' to avoid touching interactive terminal if it is
 	# available but not accessible as GDB would get stopped on SIGTTIN.
-	"$binary_path/@GDB_TRANSFORM_NAME@" </dev/null --nx --batch \
+	"$binary_path/@GDB_TRANSFORM_NAME@" </dev/null \
+	    --nx --batch --readnever \
 	    -ex "set pagination off" -ex "set height 0" -ex "set width 0" \
 	    "${dump_all_cmds[@]}" \
 	    -ex "attach $pid" -ex "gcore $prefix.$pid" -ex detach -ex quit