From ab11c8905fecb3f2321f0a0ea2e719648560f2ad Mon Sep 17 00:00:00 2001 From: Vladimir Mezentsev Date: Tue, 15 Nov 2022 21:31:15 -0800 Subject: [PATCH] PR29788, gprofng cannot display Java's generated assembly code gprofng/ChangeLog 2022-11-15 Vladimir Mezentsev PR gprofng/29788 * src/Experiment.h: Declare dyntext_name. * src/Experiment.cc: Use dyntext_name to initialize img_fname. --- gprofng/src/Experiment.cc | 10 +++++----- gprofng/src/Experiment.h | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gprofng/src/Experiment.cc b/gprofng/src/Experiment.cc index 98aae9714ac..44de387f3d2 100644 --- a/gprofng/src/Experiment.cc +++ b/gprofng/src/Experiment.cc @@ -1370,6 +1370,7 @@ Experiment::Experiment () expt_name = NULL; arch_name = NULL; fndr_arch_name = NULL; + dyntext_name = NULL; logFile = NULL; dataDscrs = new Vector; @@ -1432,6 +1433,7 @@ Experiment::~Experiment () free (expt_name); free (arch_name); free (fndr_arch_name); + free (dyntext_name); delete jthreads_idx; delete cstack; delete cstackShowHide; @@ -6052,11 +6054,10 @@ Experiment::fetch_pprocq () int Experiment::read_dyntext_file () { - char *data_file_name = dbe_sprintf ("%s/%s", expt_name, SP_DYNTEXT_FILE); - Data_window *dwin = new Data_window (data_file_name); + dyntext_name = dbe_sprintf ("%s/%s", expt_name, SP_DYNTEXT_FILE); + Data_window *dwin = new Data_window (dyntext_name); if (dwin->not_opened ()) { - free (data_file_name); delete dwin; return 1; } @@ -6089,7 +6090,7 @@ Experiment::read_dyntext_file () case DT_CODE: if (fp) { - fp->img_fname = data_file_name; + fp->img_fname = dyntext_name; fp->img_offset = offset + sizeof (DT_common); if ((platform != Intel) && (platform != Amd64)) { //ARCH(SPARC) @@ -6178,7 +6179,6 @@ Experiment::read_dyntext_file () offset += cpcktsize; } free (progress_msg); - free (data_file_name); delete dwin; return 0; } diff --git a/gprofng/src/Experiment.h b/gprofng/src/Experiment.h index 17c91bda23e..46abbc73d3d 100644 --- a/gprofng/src/Experiment.h +++ b/gprofng/src/Experiment.h @@ -434,7 +434,8 @@ protected: char *expt_name; // name of experiment char *arch_name; // /archive char *fndr_arch_name; // /archive - //TBR? hrtime_t sample_time; // total of sample durations + char *dyntext_name; // /dyntext + int yyparse (); // Allow yyparse actions to access Vaddr stack_base; // Stack base -- 2.30.2