gdb: pass program space to get_current_source_symtab_and_line

Make the current program space reference bubble up one level.

Change-Id: I6ba6dc4a2cb188720cbb61b84ab5c954aac105c6
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
This commit is contained in:
Simon Marchi
2024-05-16 16:50:22 -04:00
committed by Simon Marchi
parent 9c067e2844
commit 3bae94c0fb
16 changed files with 51 additions and 39 deletions

View File

@@ -17,6 +17,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "progspace.h"
#include "ui.h"
#include "ui-out.h"
#include "command.h"
@@ -487,7 +488,8 @@ get_expr_block_and_pc (CORE_ADDR *pc)
if (block == NULL)
{
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
symtab_and_line cursal
= get_current_source_symtab_and_line (current_program_space);
if (cursal.symtab)
block = cursal.symtab->compunit ()->blockvector ()->static_block ();