Skip to content

Commit

Permalink
Fix for segmentation violation if the gdb_readmem_callback() function
Browse files Browse the repository at this point in the history
gets called from other than a crash command, such as from an epython
command from the mypkdump.so extension module.
([email protected])
  • Loading branch information
Dave Anderson committed Dec 1, 2019
1 parent b265bad commit e13b51a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gdb_interface.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* gdb_interface.c - core analysis suite
*
* Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
* Copyright (C) 2002-2015,2018 David Anderson
* Copyright (C) 2002-2015,2018 Red Hat, Inc. All rights reserved.
* Copyright (C) 2002-2015,2018-2019 David Anderson
* Copyright (C) 2002-2015,2018-2019 Red Hat, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -831,6 +831,11 @@ gdb_readmem_callback(ulong addr, void *buf, int len, int write)
if (write)
return FALSE;

if (!(pc->cur_req)) {
return(readmem(addr, KVADDR, buf, len,
"gdb_readmem_callback", RETURN_ON_ERROR));
}

if (pc->cur_req->flags & GNU_NO_READMEM)
return TRUE;

Expand Down

0 comments on commit e13b51a

Please sign in to comment.